public FIN_CashBankAccountResult GetInfo(FIN_CashBankAccountParam param)
        {
            FIN_CashBankAccountResult ret = new FIN_CashBankAccountResult();
            ExeResult rst = new ExeResult();

            rst = this.Execute("ZNLCRM.BLL.FIN.FIN_CashBankAccountBLL", "GetInfo", param);
            ret = rst == null ? new FIN_CashBankAccountResult() : rst.Result as FIN_CashBankAccountResult;
            return(ret);
        }
        public WCFAddUpdateResult AddOrUpdate(FIN_CashBankAccountResult param)
        {
            WCFAddUpdateResult ret = new WCFAddUpdateResult();
            ExeResult          rst = new ExeResult();

            rst = this.Execute("ZNLCRM.BLL.FIN.FIN_CashBankAccountBLL", "AddOrUpdate", param);
            ret = (rst == null ? new WCFAddUpdateResult() : rst.Result as WCFAddUpdateResult);
            return(ret);
        }
Exemple #3
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            FIN_CashBankAccountResult info = new FIN_CashBankAccountResult();

            info = this.ConvertControlToEntity <FIN_CashBankAccountResult>(this.panelAccount.Controls, info, null);
            WCFAddUpdateResult result = this.AsyncExecute <WCFAddUpdateResult, FIN_CashBankAccountResult>(info, accountLogic.AddOrUpdate, a =>
            {
                if (a.Key > 0)
                {
                    this.HidEditWindow();
                    BindDataGrid();
                }
            });
        }
Exemple #4
0
        /// <summary>
        /// 获取一条信息记录
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        public FIN_CashBankAccountResult GetInfo(FIN_CashBankAccountParam param)
        {
            this.CheckSession();
            FIN_CashBankAccountResult rst = new FIN_CashBankAccountResult();

            #region 判断
            if (param.CBID == null)
            {
                throw new WarnException("请指定账户ID!");
            }
            #endregion
            #region 保存实体
            WhereClip where = GetWhereClip(param);

            rst = this.Select <FIN_CashBankAccountResult>(where);
            //Sys_EmpDataRightBLL.SetRecIsEdit<FIN_CashBankAccountResult>(rst, "BeLongEmpID", "", "OrgID", this.SessionInfo);
            #endregion
            return(rst);
        }
Exemple #5
0
        /// <summary>
        /// 删除实体
        /// </summary>
        /// <param name="param">删除条件实体</param>
        /// <returns></returns>
        public WCFAddUpdateResult DelInfo(FIN_CashBankAccountParam param)
        {
            this.CheckSession();
            WCFAddUpdateResult ret = new WCFAddUpdateResult();
            int affect             = 0;

            try
            {
                #region 判断
                if (param.CBID == null)
                {
                    throw new WarnException("请指定要删除的记录!");
                }
                #endregion
                WhereClip where = GetWhereClip(param);
                //FIN_CashBankAccountResult oldInfo = this.GetInfo(param);
                //oldInfo = Sys_EmpDataRightBLL.SetRecIsEdit<FIN_CashBankAccountResult>(oldInfo, "BeLongEmpID", "", "OrgID", this.SessionInfo);
                //if (oldInfo.RecStatu != 2)
                //{
                //    throw new WarnException("您无权删除当前记录!");
                //}
                FIN_CashBankAccountResult info = new FIN_CashBankAccountResult();
                info.IsDeleted      = true;
                info.UpdatedTime    = DateTime.Now;
                info.UpdatedEmpID   = this.SessionInfo.UserID;
                info.UpdatedEmpName = this.SessionInfo.UserName;
                affect = this.Update <FIN_CashBankAccountResult>(info, where);
                #region 设置返回值
                ret.Key = affect;
                #endregion
            }
            catch (WarnException exp)
            {
                throw exp;
            }
            catch (System.Exception exp)
            {
                LogInfoBLL.WriteLog(this.SessionInfo, exp);
                throw exp;
            }
            return(ret);
        }
Exemple #6
0
        private void tsbEditAccount_Click(object sender, EventArgs e)
        {
            ClearContent();

            txtCBID.Text = cbid.ToStringHasNull();
            if (txtCBID.Text.ToInt32() > 0)
            {
                ShowEditWindow("编辑银行账号", panelAccount);
                FIN_CashBankAccountResult info = new FIN_CashBankAccountResult();
                info = accountLogic.GetInfo(new FIN_CashBankAccountParam()
                {
                    CBID = int.Parse(txtCBID.Text)
                });
                this.ConvertEntityToControl <FIN_CashBankAccountResult>(this.panelAccount.Controls, info, null);
            }
            else
            {
                ShowMessage("请选择需要修改的银行账号!");
            }
        }
Exemple #7
0
        private void tsbFrozenAccount_Click(object sender, EventArgs e)
        {
            List <FIN_CashBankAccountResult> rstList = new List <FIN_CashBankAccountResult>();

            foreach (DataGridViewRow dgvRow in dgvAccount.Rows)
            {
                if (dgvRow.Cells["colSelect"].Value.ToBooleanHasNull())
                {
                    FIN_CashBankAccountResult result = new FIN_CashBankAccountResult();
                    result.IsFrozen = true;
                    result.CBID     = dgvRow.Cells["colCBID"].Value.ToInt32();
                    rstList.Add(result);
                }
            }
            WCFAddUpdateResult wcfResult = this.AsyncExecute <WCFAddUpdateResult, List <FIN_CashBankAccountResult> >(rstList, accountLogic.UpdateOrInsertList, (a) => { if (a.Key > 0)
                                                                                                                                                                        {
                                                                                                                                                                            BindDataGrid();
                                                                                                                                                                        }
                                                                                                                     });
        }
Exemple #8
0
        private void tsbDelAccount_Click(object sender, EventArgs e)
        {
            FIN_CashBankAccountParam param = new FIN_CashBankAccountParam();

            param.CBID = cbid;

            FIN_CashBankAccountResult rst = accountLogic.GetInfo(param);

            if (rst != null)
            {
                if (MessageBox.Show("请确认是否要删除银行账号:【" + rst.CBNo + "】", "操作提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
                {
                    WCFAddUpdateResult result = this.AsyncExecute <WCFAddUpdateResult, FIN_CashBankAccountParam>(param, accountLogic.DelInfo, (a) => { BindDataGrid(); });
                }
            }
            else
            {
                this.ShowMessage("请选择需要删除的银行账号!");
            }
        }
Exemple #9
0
        /// <summary>
        /// 添加和新增修改
        /// </summary>
        /// <param name="param">新增或修改的实体</param>
        /// <returns></returns>
        public WCFAddUpdateResult AddOrUpdate(FIN_CashBankAccountResult param)
        {
            this.CheckSession();
            WCFAddUpdateResult ret = new WCFAddUpdateResult();

            try
            {
                int affect = 0;
                #region 判断
                if (string.IsNullOrEmpty(param.CBNo))
                {
                    throw new WarnException("请指定账号!");
                }
                if (string.IsNullOrEmpty(param.CBName))
                {
                    throw new WarnException("请指定开户行!");
                }
                if (string.IsNullOrEmpty(param.BCode))
                {
                    throw new WarnException("请指定户名!");
                }
                if (string.IsNullOrEmpty(param.Currency))
                {
                    throw new WarnException("请指定币种!");
                }

                #endregion
                #region 系统默认值

                if (param.CBID.ToInt32() > 0)
                {
                    WhereClip where      = FIN_CashBankAccount._.CBID == param.CBID;
                    param.GCompanyID     = this.SessionInfo.CompanyID;
                    param.UpdatedEmpID   = this.SessionInfo.UserID;
                    param.UpdatedEmpName = this.SessionInfo.UserName;
                    param.UpdatedTime    = DateTime.Now;
                    affect = this.Update <FIN_CashBankAccountResult>(param, where);
                }
                else
                {
                    param.GCompanyID     = this.SessionInfo.CompanyID;
                    param.CBGuid         = Guid.NewGuid();
                    param.CreatedEmpID   = this.SessionInfo.UserID;
                    param.CreatedEmpName = this.SessionInfo.UserName;
                    param.CreatedTime    = DateTime.Now;
                    param.IsFrozen       = false;
                    param.IsDeleted      = false;
                    affect = this.Insert <FIN_CashBankAccountResult>(param);
                    param  = this.Select <FIN_CashBankAccountResult>(new List <Field>()
                    {
                        FIN_CashBankAccount._.CBID
                    }, FIN_CashBankAccount._.CBGuid == param.CBGuid);
                }
                #region 设置返回值
                ret.Key            = param.CBID;
                ret.BillNo         = param.CBNo;
                ret.CreatedTime    = param.CreatedTime;
                ret.CreatedEmpID   = param.CreatedEmpID;
                ret.CreatedEmpName = param.CreatedEmpName;
                ret.UpdatedEmpID   = param.UpdatedEmpID;
                ret.UpdatedEmpName = param.UpdatedEmpName;
                ret.UpdatedTime    = param.UpdatedTime;
                #endregion

                #endregion
            }
            catch (WarnException exp)
            {
                throw exp;
            }
            catch (System.Exception exp)
            {
                LogInfoBLL.WriteLog(this.SessionInfo, exp);
                throw exp;
            }
            return(ret);
        }