| | |
| | | { |
| | | res = oA_WorkReminderBll.UpdateModel(m_OA_WorkPlan); |
| | | |
| | | if (res && m_OA_WorkPlan.PlanDataType == 15) |
| | | if (res ) |
| | | { |
| | | var HideKeyidFapiao = Request["HideKeyidFapiao"].Split(','); |
| | | var HideAttachmentFapiao = Request["HideAttachmentFapiao"].Split(','); |
| | | |
| | | |
| | | //需要删除的附件 |
| | | var oA_WorkPlan_Attachments = oA_WorkPlan_AttachmentBLL.GetModelByKaipiaoIdandType(m_OA_WorkPlan.Keyid.Value, 15); |
| | | List<int> HideKeyidFujianid = new List<int>(); |
| | | for (int i = 0; i < HideKeyidFapiao.Length; i++) |
| | | if(m_OA_WorkPlan.PlanDataType == 15) |
| | | { |
| | | if (!string.IsNullOrEmpty(HideKeyidFapiao[i]) && HideKeyidFapiao[i].ToInt32() != 0) |
| | | var HideKeyidFapiao = Request["HideKeyidFapiao"].Split(','); |
| | | var HideAttachmentFapiao = Request["HideAttachmentFapiao"].Split(','); |
| | | |
| | | |
| | | //需要删除的附件 |
| | | var oA_WorkPlan_Attachments = oA_WorkPlan_AttachmentBLL.GetModelByKaipiaoIdandType(m_OA_WorkPlan.Keyid.Value, 15); |
| | | List<int> HideKeyidFujianid = new List<int>(); |
| | | for (int i = 0; i < HideKeyidFapiao.Length; i++) |
| | | { |
| | | HideKeyidFujianid.Add(HideKeyidFapiao[i].ToInt32().Value); |
| | | if (!string.IsNullOrEmpty(HideKeyidFapiao[i]) && HideKeyidFapiao[i].ToInt32() != 0) |
| | | { |
| | | HideKeyidFujianid.Add(HideKeyidFapiao[i].ToInt32().Value); |
| | | } |
| | | } |
| | | |
| | | var oA_WorkPlan_Attachments1 = oA_WorkPlan_Attachments.Where(x => !HideKeyidFujianid.Contains(x.Keyid)).ToList(); |
| | | |
| | | foreach (var oa_WorkPlan_Attachment in oA_WorkPlan_Attachments1) |
| | | { |
| | | res = oA_WorkPlan_AttachmentBLL.DeleteModel(oa_WorkPlan_Attachment); |
| | | } |
| | | |
| | | for (int i = 0; i < HideKeyidFapiao.Length; i++) |
| | | { |
| | | if (string.IsNullOrEmpty(HideKeyidFapiao[i])) |
| | | { |
| | | var a_WorkPlan_Attachment = new OA_WorkPlan_attachment(); |
| | | a_WorkPlan_Attachment.OA_WorkPlanId = m_OA_WorkPlan.Keyid; |
| | | a_WorkPlan_Attachment.AttachmentType = 15; |
| | | a_WorkPlan_Attachment.PlanAttachment = HideAttachmentFapiao[i]; |
| | | a_WorkPlan_Attachment.CreateTime = DateTime.Now; |
| | | a_WorkPlan_Attachment.Operator = CurrentUser.TrueName; |
| | | var sss = oA_WorkPlan_AttachmentBLL.InsertModel(a_WorkPlan_Attachment); |
| | | } |
| | | else |
| | | { |
| | | continue; |
| | | } |
| | | } |
| | | } |
| | | |
| | | var oA_WorkPlan_Attachments1 = oA_WorkPlan_Attachments.Where(x => !HideKeyidFujianid.Contains(x.Keyid)).ToList(); |
| | | |
| | | foreach (var oa_WorkPlan_Attachment in oA_WorkPlan_Attachments1) |
| | | { |
| | | res = oA_WorkPlan_AttachmentBLL.DeleteModel(oa_WorkPlan_Attachment); |
| | | } |
| | | |
| | | for (int i = 0; i < HideKeyidFapiao.Length; i++) |
| | | { |
| | | if (string.IsNullOrEmpty(HideKeyidFapiao[i])) |
| | | { |
| | | var a_WorkPlan_Attachment = new OA_WorkPlan_attachment(); |
| | | a_WorkPlan_Attachment.OA_WorkPlanId = m_OA_WorkPlan.Keyid; |
| | | a_WorkPlan_Attachment.AttachmentType = 15; |
| | | a_WorkPlan_Attachment.PlanAttachment = HideAttachmentFapiao[i]; |
| | | a_WorkPlan_Attachment.CreateTime = DateTime.Now; |
| | | a_WorkPlan_Attachment.Operator = CurrentUser.TrueName; |
| | | var sss = oA_WorkPlan_AttachmentBLL.InsertModel(a_WorkPlan_Attachment); |
| | | } |
| | | else |
| | | { |
| | | continue; |
| | | } |
| | | } |
| | | |
| | | |
| | | scope.Complete(); |
| | | |
| | |
| | | |
| | | var aaaa = oA_WorkReminderBll.InserModelAndGetId(m_OA_WorkPlan); |
| | | m_OA_WorkPlan.Keyid = aaaa; |
| | | if (aaaa > 0 && m_OA_WorkPlan.PlanDataType == 15) |
| | | if (aaaa > 0 ) |
| | | { |
| | | var HideKeyidFapiao = Request["HideKeyidFapiao"].Split(','); |
| | | var HideAttachmentFapiao = Request["HideAttachmentFapiao"].Split(','); |
| | | |
| | | |
| | | |
| | | |
| | | for (int i = 0; i < HideKeyidFapiao.Length; i++) |
| | | if(m_OA_WorkPlan.PlanDataType == 15) |
| | | { |
| | | if (string.IsNullOrEmpty(HideKeyidFapiao[i])) |
| | | var HideKeyidFapiao = Request["HideKeyidFapiao"].Split(','); |
| | | var HideAttachmentFapiao = Request["HideAttachmentFapiao"].Split(','); |
| | | |
| | | |
| | | |
| | | |
| | | for (int i = 0; i < HideKeyidFapiao.Length; i++) |
| | | { |
| | | var a_WorkPlan_Attachment = new OA_WorkPlan_attachment(); |
| | | a_WorkPlan_Attachment.OA_WorkPlanId = m_OA_WorkPlan.Keyid; |
| | | a_WorkPlan_Attachment.AttachmentType = 15; |
| | | a_WorkPlan_Attachment.PlanAttachment = HideAttachmentFapiao[i]; |
| | | a_WorkPlan_Attachment.CreateTime = DateTime.Now; |
| | | a_WorkPlan_Attachment.Operator = CurrentUser.TrueName; |
| | | var sss = oA_WorkPlan_AttachmentBLL.InsertModel(a_WorkPlan_Attachment); |
| | | if (string.IsNullOrEmpty(HideKeyidFapiao[i])) |
| | | { |
| | | var a_WorkPlan_Attachment = new OA_WorkPlan_attachment(); |
| | | a_WorkPlan_Attachment.OA_WorkPlanId = m_OA_WorkPlan.Keyid; |
| | | a_WorkPlan_Attachment.AttachmentType = 15; |
| | | a_WorkPlan_Attachment.PlanAttachment = HideAttachmentFapiao[i]; |
| | | a_WorkPlan_Attachment.CreateTime = DateTime.Now; |
| | | a_WorkPlan_Attachment.Operator = CurrentUser.TrueName; |
| | | var sss = oA_WorkPlan_AttachmentBLL.InsertModel(a_WorkPlan_Attachment); |
| | | } |
| | | else |
| | | { |
| | | continue; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | continue; |
| | | } |
| | | |
| | | } |
| | | |
| | | |