Example #1
0
        /// <summary>
        /// 保存收款认领方法
        /// </summary>
        private void SaveClaim()
        {
            To_Claim claimModel = new To_Claim();

            claimModel.collectingID  = int.Parse(Request.QueryString["id"]); //收款id
            claimModel.collectingNum = LblNumber.Text;                       //收款单号
            claimModel.makerman      = LblMaker.Text;                        //认领人员
            claimModel.MakerID       = int.Parse(HidMaker.Value);            //认领人员id
            claimModel.payer         = txtUnit.Text;                         //付款单位
            claimModel.payerID       = int.Parse(hidComID.Value);            //付款单位id
            claimModel.collectAmount = double.Parse(HidReceiptAmount.Value); //收款金额

            To_Collecting collectModel = To_CollectingManager.getTo_CollectingById(claimModel.collectingID);

            collectModel.PaymentUnit = txtUnit.Text;
            int comid = 0;

            int.TryParse(hidComID.Value, out comid);
            collectModel.PaymentUnitID = comid;
            To_CollectingManager.updateTo_CollectPaymentUnit(collectModel);

            To_ClaimManager claimManager = new To_ClaimManager();
            int             result       = claimManager.Add(claimModel);

            if (result > 0)
            {
                SaveClaimDetail(result, claimModel.collectingID);
                ClientScript.RegisterClientScriptBlock(this.GetType(), "page", "alert('认领成功');self.location.href='ClaimList.aspx';", true);
            }
        }
Example #2
0
        /// <summary>
        /// 保存收款认领的方法
        /// </summary>
        private void SaveClaim()
        {
            string          claimId      = Request.QueryString["claimId"];
            To_ClaimManager claimManager = new To_ClaimManager();
            To_Claim        claimModel   = claimManager.GetModel(int.Parse(claimId));

            //更新收款单的单位信息
            To_Collecting collectModel = To_CollectingManager.getTo_CollectingById(claimModel.collectingID);

            collectModel.PaymentUnit = txtUnit.Text;
            int comid = 0;

            int.TryParse(hidComID.Value, out comid);
            collectModel.PaymentUnitID = comid;
            To_CollectingManager.updateTo_CollectPaymentUnit(collectModel);
            //认领主表的数据没有什么需要修改,故没有写,只修改认领明细中的数据

            int result = SaveClaimDetail(claimModel.ID, claimModel.collectingID);

            if (result == 1)
            {
                ClientScript.RegisterClientScriptBlock(this.GetType(), "page", "alert('修改成功');self.location.href='ClaimList.aspx';", true);
            }
        }