Esempio n. 1
0
 /// <summary>
 /// 新增证照详情
 /// </summary>
 private void LicenseDetailAdd()
 {
     try
     {
         T_OA_LICENSEDETAIL licenseDetailTmp = new T_OA_LICENSEDETAIL();
         licenseDetailTmp.LICENSEDETAILID = Guid.NewGuid().ToString();
         //comboSeletedItem = this.comboxType.SelectedItem as RegisterType;
         licenseDetailTmp.T_OA_LICENSEMASTER = licenseMaster;
         licenseDetailTmp.T_OA_LICENSEMASTER.LICENSEMASTERID = licenseMaster.LICENSEMASTERID;
         //licenseDetailTmp.LICENSEMASTERID = licenseMaster.LICENSEMASTERID;
         licenseDetailTmp.REGISTERTYPE  = Utility.GetCbxSelectItemText(comboxType);
         licenseDetailTmp.ADDRESS       = licenseMaster.ADDRESS;
         licenseDetailTmp.BUSSINESSAREA = licenseMaster.BUSSINESSAREA;
         licenseDetailTmp.FROMDATE      = Convert.ToDateTime(licenseMaster.FROMDATE);
         licenseDetailTmp.TODATE        = licenseMaster.TODATE;
         licenseDetailTmp.LICENCENO     = licenseMaster.LICENCENO;
         licenseDetailTmp.LEGALPERSON   = licenseMaster.LEGALPERSON;
         LicenseDetail.Add(licenseDetailTmp);
         licenseNewDetail.Add(licenseDetailTmp);
         //dgDetail.Height += 240;
         BindData();
     }
     catch (Exception ex)
     {
         //RefreshUI(RefreshedTypes.ProgressBar);
         Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), ex.Message.ToString());
     }
 }
Esempio n. 2
0
        public string AddLicenseDetail(T_OA_LICENSEDETAIL licenseObj)
        {
            using (LicenseDetailManagementBll licenseDetailBll = new LicenseDetailManagementBll())
            {
                string returnStr = "";

                if (!licenseDetailBll.AddLicenseDetail(licenseObj))
                {
                    returnStr = "添加数据失败";
                }
                return(returnStr);
            }
        }
Esempio n. 3
0
 public string UpdateLicenseDetail(T_OA_LICENSEDETAIL[] licenseDetailObj,T_OA_LICENSEMASTER licenseMasterObj)
 {
     string returnStr = "";
     using (LicenseDetailManagementBll licenseDetailBll = new LicenseDetailManagementBll())
     {
         if (!licenseDetailBll.UpdateLicenseDetail(licenseDetailObj, licenseMasterObj))
         {
             returnStr = "更新数据失败";
         }
         return returnStr;
     }
 }
Esempio n. 4
0
        public string AddLicenseDetail(T_OA_LICENSEDETAIL licenseObj)
        {
            using (LicenseDetailManagementBll licenseDetailBll = new LicenseDetailManagementBll())
            {
                string returnStr = "";

                if (!licenseDetailBll.AddLicenseDetail(licenseObj))
                {
                    returnStr = "添加数据失败";
                }
                return returnStr;
            }
        }
Esempio n. 5
0
        private void Save()
        {
            try
            {
                if (Check())
                {
                    RefreshUI(RefreshedTypes.ProgressBar);
                    List <T_OA_LICENSEDETAIL> removeArr = new List <T_OA_LICENSEDETAIL>();
                    for (int i = 0; i < licenseDetail.Count; i++)
                    {
                        if (i < licenseOriginalDetail.Count)
                        {
                            if (licenseDetail[i].ADDRESS != licenseOriginalDetail[i].ADDRESS)
                            {
                                continue;
                            }
                            if (licenseDetail[i].BUSSINESSAREA != licenseOriginalDetail[i].BUSSINESSAREA)
                            {
                                continue;
                            }
                            if (licenseDetail[i].FROMDATE != licenseOriginalDetail[i].FROMDATE)
                            {
                                continue;
                            }
                            if (licenseDetail[i].TODATE != licenseOriginalDetail[i].TODATE)
                            {
                                continue;
                            }
                            if (licenseDetail[i].REGISTERTYPE != licenseOriginalDetail[i].REGISTERTYPE)
                            {
                                continue;
                            }
                            if (licenseDetail[i].REGISTERCHARGE != licenseOriginalDetail[i].REGISTERCHARGE)
                            {
                                continue;
                            }
                            if (licenseDetail[i].REMARK != licenseOriginalDetail[i].REMARK)
                            {
                                continue;
                            }
                            if (licenseDetail[i].LEGALPERSON != licenseOriginalDetail[i].LEGALPERSON)
                            {
                                continue;
                            }
                            if (licenseDetail[i].LICENCENO != licenseOriginalDetail[i].LICENCENO)
                            {
                                continue;
                            }
                            removeArr.Add(licenseDetail[i]);
                        }
                    }
                    if (removeArr.Count > 0)
                    {
                        foreach (var item in removeArr)
                        {
                            licenseDetail.Remove(item);
                        }
                    }
                    licenseOriginalDetail.Clear();
                    //更新的
                    foreach (var license in licenseDetail)
                    {
                        T_OA_LICENSEDETAIL licenseDetailTmp = new T_OA_LICENSEDETAIL();
                        licenseDetailTmp.LICENSEDETAILID    = Guid.NewGuid().ToString();
                        licenseDetailTmp.T_OA_LICENSEMASTER = licenseMaster;
                        licenseDetailTmp.T_OA_LICENSEMASTER.LICENSEMASTERID = licenseMaster.LICENSEMASTERID;
                        licenseDetailTmp.REGISTERTYPE   = license.REGISTERTYPE;
                        licenseDetailTmp.REGISTERCHARGE = license.REGISTERCHARGE;
                        licenseDetailTmp.ADDRESS        = license.ADDRESS;
                        licenseDetailTmp.BUSSINESSAREA  = license.BUSSINESSAREA;
                        licenseDetailTmp.FROMDATE       = license.FROMDATE;
                        licenseDetailTmp.TODATE         = license.TODATE;
                        licenseDetailTmp.LICENCENO      = license.LICENCENO;
                        licenseDetailTmp.LEGALPERSON    = license.LEGALPERSON;
                        licenseDetailTmp.REMARK         = license.REMARK;

                        licenseDetailTmp.CREATEUSERID       = Common.CurrentLoginUserInfo.EmployeeID;
                        licenseDetailTmp.CREATEUSERNAME     = Common.CurrentLoginUserInfo.EmployeeName;
                        licenseDetailTmp.CREATEPOSTID       = Common.CurrentLoginUserInfo.UserPosts[0].PostID;
                        licenseDetailTmp.CREATEDEPARTMENTID = Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID;
                        licenseDetailTmp.CREATECOMPANYID    = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
                        licenseDetailTmp.CREATEDATE         = DateTime.Now;

                        licenseDetailTmp.OWNERID           = Common.CurrentLoginUserInfo.EmployeeID;
                        licenseDetailTmp.OWNERNAME         = Common.CurrentLoginUserInfo.EmployeeName;
                        licenseDetailTmp.OWNERPOSTID       = Common.CurrentLoginUserInfo.UserPosts[0].PostID;
                        licenseDetailTmp.OWNERDEPARTMENTID = Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID;
                        licenseDetailTmp.OWNERCOMPANYID    = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;

                        licenseDetailTmp.UPDATEDATE     = DateTime.Now;
                        licenseDetailTmp.UPDATEUSERID   = Common.CurrentLoginUserInfo.EmployeeID;
                        licenseDetailTmp.UPDATEUSERNAME = Common.CurrentLoginUserInfo.EmployeeName;

                        licenseOriginalDetail.Add(licenseDetailTmp);
                    }
                    licenseMaster.UPDATEDATE     = DateTime.Now;
                    licenseMaster.UPDATEUSERID   = Common.CurrentLoginUserInfo.EmployeeID;
                    licenseMaster.UPDATEUSERNAME = Common.CurrentLoginUserInfo.EmployeeName;
                    client.UpdateLicenseDetailAsync(licenseOriginalDetail, licenseMaster);
                }
            }
            catch (Exception ex)
            {
                RefreshUI(RefreshedTypes.ProgressBar);
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), ex.Message.ToString());
            }
        }
Esempio n. 6
0
        /// <summary>
        ///  更新
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void OKButton_Click(object sender, RoutedEventArgs e)
        {
            List <SMT.SaaS.FrameworkUI.Validator.ValidatorBase> validators = Group1.ValidateAll();

            if (validators.Count > 0)
            {
                //could use the content of the list to show an invalid message summary somehow
                //MessageBox.Show(validators.Count.ToString() + " invalid validators");
                return;
            }
            List <T_OA_LICENSEDETAIL> removeArr = new List <T_OA_LICENSEDETAIL>();

            for (int i = 0; i < licenseDetail.Count; i++)
            {
                if (i < licenseOriginalDetail.Count)
                {
                    if (licenseDetail[i].ADDRESS != licenseOriginalDetail[i].ADDRESS)
                    {
                        continue;
                    }
                    if (licenseDetail[i].BUSSINESSAREA != licenseOriginalDetail[i].BUSSINESSAREA)
                    {
                        continue;
                    }
                    if (licenseDetail[i].FROMDATE != licenseOriginalDetail[i].FROMDATE)
                    {
                        continue;
                    }
                    if (licenseDetail[i].TODATE != licenseOriginalDetail[i].TODATE)
                    {
                        continue;
                    }
                    if (licenseDetail[i].REGISTERTYPE != licenseOriginalDetail[i].REGISTERTYPE)
                    {
                        continue;
                    }
                    if (licenseDetail[i].REGISTERCHARGE != licenseOriginalDetail[i].REGISTERCHARGE)
                    {
                        continue;
                    }
                    if (licenseDetail[i].REMARK != licenseOriginalDetail[i].REMARK)
                    {
                        continue;
                    }
                    if (licenseDetail[i].LEGALPERSON != licenseOriginalDetail[i].LEGALPERSON)
                    {
                        continue;
                    }
                    if (licenseDetail[i].LICENCENO != licenseOriginalDetail[i].LICENCENO)
                    {
                        continue;
                    }
                    removeArr.Add(licenseDetail[i]);
                }
            }
            if (removeArr.Count > 0)
            {
                foreach (var item in removeArr)
                {
                    licenseDetail.Remove(item);
                }
            }
            licenseOriginalDetail.Clear();
            //更新的
            foreach (var license in licenseDetail)
            {
                T_OA_LICENSEDETAIL licenseDetailTmp = new T_OA_LICENSEDETAIL();
                licenseDetailTmp.LICENSEDETAILID    = Guid.NewGuid().ToString();
                licenseDetailTmp.T_OA_LICENSEMASTER = licenseMaster;
                licenseDetailTmp.T_OA_LICENSEMASTER.LICENSEMASTERID = licenseMaster.LICENSEMASTERID;
                //licenseDetailTmp.LICENSEMASTERID = license.LICENSEMASTERID;
                licenseDetailTmp.REGISTERTYPE       = license.REGISTERTYPE;
                licenseDetailTmp.REGISTERCHARGE     = license.REGISTERCHARGE;
                licenseDetailTmp.ADDRESS            = license.ADDRESS;
                licenseDetailTmp.BUSSINESSAREA      = license.BUSSINESSAREA;
                licenseDetailTmp.FROMDATE           = license.FROMDATE;
                licenseDetailTmp.TODATE             = license.TODATE;
                licenseDetailTmp.LICENCENO          = license.LICENCENO;
                licenseDetailTmp.LEGALPERSON        = license.LEGALPERSON;
                licenseDetailTmp.REMARK             = license.REMARK;
                licenseDetailTmp.CREATECOMPANYID    = "smt";
                licenseDetailTmp.CREATEDEPARTMENTID = "oa";
                licenseDetailTmp.CREATEPOSTID       = "soft";
                licenseDetailTmp.CREATEDATE         = DateTime.Now;
                licenseDetailTmp.CREATEUSERID       = "admin";
                licenseDetailTmp.UPDATEDATE         = DateTime.Now;
                licenseDetailTmp.UPDATEUSERID       = "admin";
                licenseOriginalDetail.Add(licenseDetailTmp);
            }
            licenseMaster.UPDATEDATE   = DateTime.Now;
            licenseMaster.UPDATEUSERID = "admin";
            client.UpdateLicenseDetailAsync(licenseOriginalDetail, licenseMaster);
        }