Exemple #1
0
 /// <summary>
 /// 新增服务包相关
 /// </summary>
 public bool AddServiceBundle(ivt_service_bundle SerBun, long userId, string serIds)
 {
     try
     {
         var timeNow = Tools.Date.DateHelper.ToUniversalTimeStamp(DateTime.Now);
         var isbDal  = new ivt_service_bundle_dal();
         SerBun.id             = isbDal.GetNextIdCom();
         SerBun.create_time    = timeNow;
         SerBun.update_time    = timeNow;
         SerBun.create_user_id = userId;
         SerBun.update_user_id = userId;
         isbDal.Insert(SerBun);
         OperLogBLL.OperLogAdd <ivt_service_bundle>(SerBun, SerBun.id, userId, DTO.DicEnum.OPER_LOG_OBJ_CATE.IVT_SERVICE_BUNDLE, "新增服务包");
         ServiceBundleManage(SerBun.id, serIds, userId);
     }
     catch (Exception msg)
     {
         return(false);
     }
     return(true);
 }
Exemple #2
0
 /// <summary>
 /// 编辑服务包
 /// </summary>
 public bool EditServiceBundle(ivt_service_bundle SerBun, long userId, string serIds)
 {
     try
     {
         var isbDal    = new ivt_service_bundle_dal();
         var oldSerBun = isbDal.FindNoDeleteById(SerBun.id);
         if (oldSerBun == null)
         {
             return(false);
         }
         var timeNow = Tools.Date.DateHelper.ToUniversalTimeStamp(DateTime.Now);
         SerBun.update_time    = timeNow;
         SerBun.update_user_id = userId;
         isbDal.Update(SerBun);
         OperLogBLL.OperLogUpdate <ivt_service_bundle>(SerBun, oldSerBun, SerBun.id, userId, DTO.DicEnum.OPER_LOG_OBJ_CATE.IVT_SERVICE_BUNDLE, "编辑服务包");
         ServiceBundleManage(SerBun.id, serIds, userId);
     }
     catch (Exception)
     {
         return(false);
     }
     return(true);
 }
Exemple #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            periodType = new GeneralBLL().GetDicValues(GeneralTableEnum.QUOTE_ITEM_PERIOD_TYPE);
            if (!IsPostBack)
            {
                if (!string.IsNullOrEmpty(Request.QueryString["id"]))
                {
                    serviceBundle = bll.GetServiceBundleById(long.Parse(Request.QueryString["id"]));
                    if (serviceBundle != null)
                    {
                        isAdd   = false;
                        serList = bll.GetServiceListByServiceBundleId(serviceBundle.id);
                    }
                }
            }
            else
            {
                if (!string.IsNullOrEmpty(Request.QueryString["id"]))
                {
                    serviceBundle = bll.GetServiceBundleById(long.Parse(Request.QueryString["id"]));
                    if (serviceBundle != null)
                    {
                        isAdd = false;
                    }
                }

                var pageServiceBundle = AssembleModel <ivt_service_bundle>();
                if (!string.IsNullOrEmpty(Request.Form["active"]) && Request.Form["active"].Equals("on"))
                {
                    pageServiceBundle.is_active = 1;
                }
                else
                {
                    pageServiceBundle.is_active = 0;
                }
                var serIds = Request.Form["ServiceIds"];

                var other_price = Request.Form["other_price"];
                if (!string.IsNullOrEmpty(other_price))
                {
                    pageServiceBundle.old_selected_service_sum = decimal.Parse(other_price);
                }
                else
                {
                    pageServiceBundle.old_selected_service_sum = null;
                }

                var extended_price = Request.Form["extended_price"];
                if (!string.IsNullOrEmpty(extended_price))
                {
                    pageServiceBundle.unit_price = decimal.Parse(extended_price);
                }
                else
                {
                    pageServiceBundle.unit_price = 0;
                }

                var discount_dollars_calc = Request.Form["discount_dollars_calc"];
                if (!string.IsNullOrEmpty(discount_dollars_calc))
                {
                    pageServiceBundle.discount = decimal.Parse(discount_dollars_calc);
                }
                else
                {
                    pageServiceBundle.discount = null;
                }

                var discount_percent = Request.Form["discount_percent"];
                if (!string.IsNullOrEmpty(discount_percent))
                {
                    pageServiceBundle.discount_percent = decimal.Parse(discount_percent);
                }
                else
                {
                    pageServiceBundle.discount_percent = null;
                }


                var result = false;
                if (isAdd)
                {
                    result = bll.AddServiceBundle(pageServiceBundle, LoginUserId, serIds ?? "");
                }
                else
                {
                    pageServiceBundle.id  = serviceBundle.id;
                    pageServiceBundle.oid = serviceBundle.oid;
                    pageServiceBundle.vendor_account_id = serviceBundle.vendor_account_id;
                    pageServiceBundle.create_time       = serviceBundle.create_time;
                    pageServiceBundle.create_user_id    = serviceBundle.create_user_id;
                    result = bll.EditServiceBundle(pageServiceBundle, LoginUserId, serIds ?? "");
                }


                var SaveType = Request.Form["SaveType"];
                if (SaveType == "SaveNew")
                {
                    ClientScript.RegisterStartupScript(this.GetType(), "提示信息", $"<script>alert('保存{(result ? "成功" : "失败")}!');self.opener.location.reload();location.href = 'ServiceBundle';</script>");
                }
                else
                {
                    ClientScript.RegisterStartupScript(this.GetType(), "提示信息", $"<script>alert('保存{(result ? "成功" : "失败")}!');self.opener.location.reload();window.close();</script>");
                }
            }
        }
Exemple #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                var taskId = Request.QueryString["id"];
                if (!string.IsNullOrEmpty(taskId))
                {
                    thisTicket = new sdk_task_dal().FindNoDeleteById(long.Parse(taskId));
                    if (thisTicket != null)
                    {
                        isAdd              = false;
                        thisBookMark       = new IndexBLL().GetSingBook(Request.Url.LocalPath + "?id=" + taskId, LoginUserId);
                        ticketUdfValueList = new UserDefinedFieldsBLL().GetUdfValue(DicEnum.UDF_CATE.TASK, thisTicket.id, tickUdfList);
                        thisAccount        = new CompanyBLL().GetCompany(thisTicket.account_id);
                        if (thisTicket.contact_id != null)
                        {
                            thisContact = new crm_contact_dal().FindNoDeleteById((long)thisTicket.contact_id);
                        }
                        if (thisTicket.owner_resource_id != null && thisTicket.role_id != null)
                        {
                            var resDepList = new sys_resource_department_dal().GetResDepByResAndRole((long)thisTicket.owner_resource_id, (long)thisTicket.role_id);
                            if (resDepList != null && resDepList.Count > 0)
                            {
                                proResDep = resDepList[0];
                                priRes    = new sys_resource_dal().FindNoDeleteById((long)thisTicket.owner_resource_id);
                            }
                        }

                        if (thisTicket.installed_product_id != null)
                        {
                            insPro = new crm_installed_product_dal().FindNoDeleteById((long)thisTicket.installed_product_id);
                        }
                        if (thisTicket.contract_id != null)
                        {
                            thisContract = new ctt_contract_dal().FindNoDeleteById((long)thisTicket.contract_id);
                        }
                        if (thisTicket.cost_code_id != null)
                        {
                            thisCostCode = new d_cost_code_dal().FindNoDeleteById((long)thisTicket.cost_code_id);
                        }
                        ticketCheckList = new sdk_task_checklist_dal().GetCheckByTask(thisTicket.id);
                        if (ticketCheckList != null && ticketCheckList.Count > 0)
                        {
                            ticketCheckList = ticketCheckList.OrderBy(_ => _.sort_order).ToList();
                        }
                        entryList = new sdk_work_entry_dal().GetList(thisTicket.id);

                        var otherResList = new sdk_task_resource_dal().GetTaskResByTaskId(thisTicket.id);
                        if (otherResList != null && otherResList.Count > 0)
                        {
                            ticketResList = new List <sys_resource_department>();
                            var srdDal = new sys_resource_department_dal();
                            foreach (var resRole in otherResList)
                            {
                                if (resRole.resource_id == null || resRole.role_id == null)
                                {
                                    continue;
                                }
                                var thisResDep = srdDal.GetResDepByResAndRole((long)resRole.resource_id, (long)resRole.role_id);
                                if (thisResDep != null && thisResDep.Count > 0)
                                {
                                    ticketResList.Add(thisResDep[0]);
                                }
                            }
                        }

                        if (thisTicket.service_id != null)
                        {
                            thisService = new ivt_service_dal().FindNoDeleteById((long)thisTicket.service_id);
                            if (thisService == null)
                            {
                                thisServiceBun = new ivt_service_bundle_dal().FindNoDeleteById((long)thisTicket.service_id);
                            }
                        }
                        createRes = new sys_resource_dal().FindNoDeleteById(thisTicket.create_user_id);

                        var    slaValue     = new sdk_task_dal().GetSlaTime(thisTicket);
                        string slaTimeValue = "";
                        if (slaValue != null)
                        {
                            slaTimeValue = slaValue.ToString();
                        }
                        if (!string.IsNullOrEmpty(slaTimeValue))
                        {
                            if (slaTimeValue.Substring(0, 1) == "{")
                            {
                                slaDic = new EMT.Tools.Serialize().JsonToDictionary(slaTimeValue);
                            }
                        }
                        var actList = new d_general_dal().GetGeneralByTableId((int)GeneralTableEnum.ACTION_TYPE);
                        if (actList != null && actList.Count > 0)
                        {
                            ticketNoteTypeList = actList.Where(_ => _.ext2 == ((int)DicEnum.ACTIVITY_CATE.TASK_NOTE).ToString()).ToList();
                        }
                        ticketOther     = new sdk_task_other_dal().GetTicketOther(thisTicket.id);
                        ticketOtherList = new sdk_task_other_person_dal().GetTicketOther(thisTicket.id);
                    }
                }
                var ticketIds = Request.QueryString["ids"];
                if (!string.IsNullOrEmpty(ticketIds))
                {
                    pageTicketList = new sdk_task_dal().GetTicketByIds(ticketIds);
                }


                if (thisTicket == null)
                {
                    Response.Write("<script>alert('未查询到该工单信息!');window.close();</script>");
                    return;
                }
                var history = new sys_windows_history()
                {
                    title = "工单:" + thisTicket.no + ":" + thisTicket.title,
                    url   = Request.RawUrl,
                };
                new IndexBLL().BrowseHistory(history, LoginUserId);
            }
            catch (Exception msg)
            {
                Response.Write("<script>alert('" + msg.Message + "');window.close();</script>");
            }
        }