/// <summary>
        /// 保存
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void XMBProjectInfoSave_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            bindingSource1.EndEdit();
            RefXMBProjectInfo.ProjectBalance = ProjectBalanceEdit.Text;

            if (!norm.Validate())
            {
                XtraMessageBox.Show("填写项不符合验证规则");
                return;
            }
            DoWork("保存数据", "保存数据", () =>
            {
                client.GetIXMBProjectInfoService().Update(RefXMBProjectInfo, LoginInfor.LoginName);


                //添加操作记录
                cmn_operation opreation = new cmn_operation();
                opreation.SystemNo      = AppConfig.SYSTEM_NO;
                opreation.BusinessNo    = RefXMBProjectInfo.ProjectNo;
                opreation.BusinessName  = RefXMBProjectInfo.ProjectName;
                opreation.Version       = RefXMBProjectInfo.Version;
                opreation.OperationNo   = "0";
                opreation.OperationName = "修改";
                //获取服务器时间
                DataTable dt = GpClient.CreateInstance().Execute("SELECT GETDATE() AS NowDate", CommandType.Text).Table;
                if (dt != null)
                {
                    if (dt.Rows.Count > 0)
                    {
                        opreation.OperationDate = DateTime.Parse(dt.Rows[0]["NowDate"].ToString());
                    }
                }
                else
                {
                    opreation.OperationDate = DateTime.Now;
                }
                opreation.OperByUserName = LoginInfor.UserName;
                opreation.Remark         = String.Format("{0} 在 {1} 修改了本条记录", LoginInfor.UserName, opreation.OperationDate);
                Erp.GpServiceClient.GpClient.CreateInstance().CmnOperationAdd(opreation, LoginInfor.LoginName);
            }, (ex) =>
            {
                if (ex == null)
                {
                    IsEdit = false;

                    #region 刷新当前选择项目
                    if (AppConfig.SelectProject != null && AppConfig.SelectProject.ProjectNo == RefXMBProjectInfo.ProjectNo)
                    {
                        ProjectInfo project     = new ProjectInfo();
                        project.ProjectName     = RefXMBProjectInfo.ProjectName;
                        project.ProjectNo       = RefXMBProjectInfo.ProjectNo;
                        AppConfig.SelectProject = new MeteringPaymentClient().GetIProjectInfoService().GetCurrencyAndExchangeRate(project);
                    }
                    #endregion
                    //if (MainHandler != null)
                    //    MainHandler.LoadGrid();
                    //this.Close();
                }
            });
        }
 private static void InitEndPoint()
 {
     if (String.IsNullOrEmpty(sEndPoint))
     {
         if (String.IsNullOrEmpty(ServerInfo.ServiceEndPoint))
         {
             ServerInfo.ServiceEndPoint  = System.Configuration.ConfigurationManager.AppSettings["DbServiceEndPoint"].ToString();
             ServerInfo.ServiceLoginName = Encrypt.DecryptDES(System.Configuration.ConfigurationManager.AppSettings["ServiceLoginName"], "shj20140");
             ServerInfo.ServicePsw       = Encrypt.DecryptDES(System.Configuration.ConfigurationManager.AppSettings["ServicePsw"], "shj20140");
         }
         ModuleEndPointInfor pointInfor = GpClient.CreateInstance().GetModuleEndPoint("HD.MeteringPayment.Service");
         sEndPoint  = pointInfor.EndPoint;
         sLoginName = pointInfor.LoginName;
         sPsw       = pointInfor.Psw;
     }
 }
Beispiel #3
0
 public ModuleEndPointInfor GetServiceEndPoint(string moduleName)
 {
     return(GpClient.CreateInstance().GetModuleEndPoint(moduleName));
 }