username@email.com
2025-01-03 58758cab891e0a1cbe060f2ce8fda0805cdfc99a
CY_ECommercePlatform/CY.WebForm/Pages/financial/FirmAccountExpensesEdit.aspx.cs
@@ -8,6 +8,7 @@
using CY.Infrastructure.Common;
using CY.BLL.OA;
using CY.BLL.Sys;
using CY.BLL;
namespace CY.WebForm.Pages.financial
{
@@ -19,7 +20,8 @@
        OA_FirmAccountRecordBLL _OA_FirmAccountRecordBLL = null;
        OA_FirmAccountRecord firmAccountRecord = null;
        OA_FirmAccount firmAccount = null;
        OA_BaozhengjinBLL oA_BaozhengjinBLL = null;
        OA_StaffBLL staffBLL = null;
        public FirmAccountExpensesEdit()
        {
            firmAccount = new OA_FirmAccount();
@@ -28,6 +30,8 @@
            _OA_FirmAccountRecordBLL = new OA_FirmAccountRecordBLL();
            _OA_SubjectSetBLL = new OA_SubjectSetBLL();
            firmAccountRecord = new OA_FirmAccountRecord();
            oA_BaozhengjinBLL = new OA_BaozhengjinBLL();
            staffBLL = new OA_StaffBLL();
        }
        protected void Page_Load(object sender, EventArgs e)
@@ -68,6 +72,9 @@
            ///账户类型
            selAcoountType.DataSource = _Sys_DictionaryBLL.GetDataByType("账户类型");
            selAcoountType.DataBind();
            selshenqingren.DataSource =  staffBLL.SelectListByFirmId(CurrentUser.MemberId,null, null).Where(x => x.DepartmentId == 2);
            selshenqingren.DataBind();
        }
        protected string reLoadAccountName(string selAcoountType)
@@ -79,6 +86,8 @@
        {
            try
            {
               // selshenqingren
                firmAccount = _OA_FirmAccountBLL.getSingleSubject(Request["selAccountName"].ToInt32());
                firmAccountRecord.AccountId = Request["selAccountName"].ToInt32();
@@ -98,6 +107,53 @@
                if (_OA_FirmAccountRecordBLL.AddModel(firmAccountRecord, firmAccount))
                {
                    if (!string.IsNullOrEmpty(this.selSubject.Value))
                    {
                        var oA_SubjectSet = _OA_SubjectSetBLL.getSingleSubject(firmAccountRecord.SubjectId);
                        if (oA_SubjectSet.SubjectName.IndexOf("投标保证金") >= 0 || oA_SubjectSet.SubjectName.IndexOf("履约保证金") >= 0)
                        {
                            //如果选择科目是保证金,插入以条保证金数据
                            OA_Baozhengjin oA_Baozhengjin = new OA_Baozhengjin();
                            oA_Baozhengjin.FirmId = CurrentUser.MemberId;
                            oA_Baozhengjin.FukuanTime = DateTime.Now;
                            oA_Baozhengjin.Zhanghuleixing = this.selAcoountType.Value;
                            var ss = _Sys_DictionaryBLL.GetDataByType("账户类型").FirstOrDefault(x => x.Name == oA_Baozhengjin.Zhanghuleixing);
                            if (ss != null)
                            {
                                oA_Baozhengjin.ReceiveWay = ss.Keyid;
                            }
                            oA_Baozhengjin.Account = Request["selAccountName"].ToInt32();
                            oA_Baozhengjin.Fukuanzhanghu = firmAccount.AccountName + "-" + firmAccount.UserName;
                            oA_Baozhengjin.Subject = firmAccountRecord.SubjectId;
                            oA_Baozhengjin.Fukuankemu = oA_SubjectSet.SubjectName;
                            oA_Baozhengjin.Fukuanmoney = firmAccountRecord.Money;
                            oA_Baozhengjin.Shoukuandanwei = firmAccountRecord.PaymentUnit;
                            oA_Baozhengjin.remark = firmAccountRecord.OperationalMatters;
                            oA_Baozhengjin.TuikuanTime = null;
                            oA_Baozhengjin.TuikuanStatus = 1;
                            oA_Baozhengjin.Creater = CurrentUser.ShortName;
                            oA_Baozhengjin.CreateTime = oA_Baozhengjin.FukuanTime;
                            oA_Baozhengjin.Updater = CurrentUser.ShortName;
                            oA_Baozhengjin.LastUpdateTime = oA_Baozhengjin.FukuanTime;
                            oA_Baozhengjin.MemberId = this.selshenqingren.Value.ToInt32();
                            if(oA_Baozhengjin.MemberId.HasValue && oA_Baozhengjin.MemberId.Value > 0)
                            {
                                var aaa = staffBLL.GetModelByKeyid(oA_Baozhengjin.MemberId);
                                if (aaa != null)
                                {
                                    oA_Baozhengjin.MemberName = aaa.Name;
                                }
                            }
                            var sss = oA_BaozhengjinBLL.InsertModel(oA_Baozhengjin);
                        }
                    }
                    this.selSubject.Value = "";
                    this.txtMoney.Value = "";
                    this.txtDepartment.Value = "";