/// <summary>
        ///[To_Collecting]表修改的方法
        /// </summary>
        public static int updateTo_CollectingById(To_Collecting to_collecting)
        {
            string sql = "update To_Collecting set receiptNum=@receiptNum,receiptAmount=@receiptAmount,receiptDate=@receiptDate,businessUnit=@businessUnit,businessUnitID=@businessUnitID,paymentUnit=@paymentUnit,paymentUnitID=@paymentUnitID,paymentMode=@paymentMode,marker=@marker,markerID=@markerID,markerDepartment=@markerDepartment,markerDepartmentID=@markerDepartmentID,markDate=@markDate,receiptMark=@receiptMark,payBank=@payBank,payBankAcount=@payBankAcount,confirmReceipt=@confirmReceipt,receiptStatusCode=@receiptStatusCode,orderNum=@orderNum,codeFormat=@codeFormat,payBankId=@payBankId where ID=@ID";

            SqlParameter[] sp = new SqlParameter[]
            {
                new SqlParameter("@ID", to_collecting.ID),
                new SqlParameter("@receiptNum", to_collecting.ReceiptNum),
                new SqlParameter("@receiptAmount", to_collecting.ReceiptAmount),
                new SqlParameter("@receiptDate", to_collecting.ReceiptDate),
                new SqlParameter("@businessUnit", to_collecting.BusinessUnit),
                new SqlParameter("@businessUnitID", to_collecting.BusinessUnitID),
                new SqlParameter("@paymentUnit", to_collecting.PaymentUnit),
                new SqlParameter("@paymentUnitID", to_collecting.PaymentUnitID),
                new SqlParameter("@paymentMode", to_collecting.PaymentMode),
                new SqlParameter("@marker", to_collecting.Marker),
                new SqlParameter("@markerID", to_collecting.MarkerID),
                new SqlParameter("@markerDepartment", to_collecting.MarkerDepartment),
                new SqlParameter("@markerDepartmentID", to_collecting.MarkerDepartmentID),
                new SqlParameter("@markDate", to_collecting.MarkDate),
                new SqlParameter("@receiptMark", to_collecting.ReceiptMark),
                new SqlParameter("@payBank", to_collecting.PayBank),
                new SqlParameter("@payBankAcount", to_collecting.PayBankAcount),
                new SqlParameter("@confirmReceipt", to_collecting.ConfirmReceipt),
                new SqlParameter("@receiptStatusCode", to_collecting.receiptStatusCode),
                new SqlParameter("@orderNum", to_collecting.orderNum),
                new SqlParameter("@codeFormat", to_collecting.codeFormat),
                new SqlParameter("@payBankId", to_collecting.payBankId)
            };
            return(DBHelper.ExecuteCommand(sql, sp));
        }
Example #2
0
        /// <summary>
        /// 加载收款信息
        /// </summary>
        private void LoadClaimInfo()
        {
            string collectId = Request.QueryString["collectId"];
            string claimId   = Request.QueryString["claimId"];

            if (collectId == "" || claimId == "")
            {
                Page.ClientScript.RegisterClientScriptBlock(GetType(), "error", "alert('参数错误');self.location.href='ClaimList.aspx';", true);
            }

            To_Collecting collecting = To_CollectingManager.getTo_CollectingById(int.Parse(collectId));

            LblNumber.Text = collecting.ReceiptNum;               //收款单号
            txtUnit.Text   = collecting.PaymentUnit;              //付款单位
            hidComID.Value = collecting.PaymentUnitID.ToString(); //付款单位id
            LoginInfo login = (LoginInfo)Session["login"];

            LblMaker.Text  = login.Cname;                             //登记人员
            HidMaker.Value = login.Id.ToString();                     //登记人员id

            LtrAmount.Text = collecting.ReceiptAmount.ToString("N2"); //收款金额
            this.HidReceiptAmount.Value = collecting.ReceiptAmount.ToString();

            LoadClaimDetail(claimId);
        }
Example #3
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);
            }
        }
        /// <summary>
        /// 添加收款数据
        /// </summary>
        /// <returns>添加成功返回true</returns>
        private int AddCollecting()
        {
            string number      = ""; //单号
            string codeFormart = ""; //自动编码规则
            string orderNum    = ""; //流水号

            if (StrNumbers(txtNumber.Text.Trim(), out number, out codeFormart, out orderNum))
            {
                LoginInfo currentUser = Session["login"] as LoginInfo;

                To_Collecting collectingModel = new To_Collecting();
                collectingModel.ReceiptNum         = number;                                                                         //收款单号
                collectingModel.codeFormat         = codeFormart;                                                                    //编码规则
                collectingModel.orderNum           = orderNum;
                collectingModel.ReceiptDate        = DateTime.Parse(txtDate.Text.Trim());                                            //收款时间
                collectingModel.ReceiptAmount      = double.Parse(txtMoney.Text.Trim());                                             // 收款金额
                collectingModel.BusinessUnit       = ddlUnit.SelectedItem.Text;                                                      //经营单位
                collectingModel.BusinessUnitID     = int.Parse(ddlUnit.SelectedValue);
                collectingModel.PaymentUnit        = txtUnit.Text;                                                                   //付款单位
                collectingModel.PaymentUnitID      = int.Parse(hidComID.Value.Trim() == string.Empty ? "0" : hidComID.Value.Trim()); //付款单位id
                collectingModel.PaymentMode        = 1;                                                                              /* int.Parse(ddlWay.SelectedValue.Trim()); //入账方式*/
                collectingModel.ReceiptMark        = txtMark.Value;                                                                  //备注
                collectingModel.Marker             = currentUser.Cname;
                collectingModel.MarkerID           = currentUser.Id;
                collectingModel.MarkerDepartment   = lblMarkerDepartment.Text;
                collectingModel.MarkerDepartmentID = currentUser.Departid;
                collectingModel.MarkDate           = DateTime.Parse(txtMarkDate.Text);
                collectingModel.ConfirmReceipt     = ChkConfirm.Checked ? 1 : 0;
                collectingModel.receiptStatusCode  = 0;

                collectingModel.payBankId     = int.Parse(DdlBank.SelectedValue);
                collectingModel.PayBank       = DdlBank.SelectedItem.Text;//txtBank.Text;
                collectingModel.PayBankAcount = txtBankAccount.Text;

                //if (int.Parse(ddlWay.SelectedValue.Trim()) != 0)
                //{
                //    collectingModel.payBankId = int.Parse(DdlBank.SelectedValue);
                //    collectingModel.PayBank = DdlBank.SelectedItem.Text;//txtBank.Text;
                //    collectingModel.PayBankAcount = txtBankAccount.Text;
                //}
                //else
                //{
                //    collectingModel.payBankId = 0;
                //    collectingModel.PayBank = "";//txtBank.Text;
                //    collectingModel.PayBankAcount = "";
                //}

                int id = To_CollectingManager.addTo_Collecting(collectingModel);
                if (ChkConfirm.Checked) //如果确认登记了。那么需要登记确认人和确认日期
                {
                    To_CollectingManager.updateConfirm(id.ToString(), currentUser.Cname, DateTime.Now.ToString());
                }
                AddLimit(id);
                return(id);
            }
            else
            {
                return(0);
            }
        }
        /// <summary>
        /// 更新收款单的单位信息
        /// </summary>
        /// <param name="to_collecting"></param>
        /// <returns></returns>
        public static int updateTo_CollectPaymentUnit(To_Collecting to_collecting)
        {
            string sql = " update To_Collecting set paymentUnit=@paymentUnit,paymentUnitID=@paymentUnitID where ID=@ID ";

            SqlParameter[] sp = new SqlParameter[]
            {
                new SqlParameter("@ID", to_collecting.ID),
                new SqlParameter("@paymentUnit", to_collecting.PaymentUnit),
                new SqlParameter("@paymentUnitID", to_collecting.PaymentUnitID)
            };
            return(DBHelper.ExecuteCommand(sql, sp));
        }
        /// <summary>
        ///[To_Collecting]表查询实体的方法
        /// </summary>
        public static To_Collecting getTo_CollectingById(int ID)
        {
            To_Collecting to_collecting = null;

            string sql = "select * from To_Collecting where ID=@ID";

            SqlParameter[] sp = new SqlParameter[]
            {
                new SqlParameter("@ID", ID)
            };
            DataTable dt = DBHelper.GetDataSet(sql, sp);

            if (dt.Rows.Count > 0)
            {
                to_collecting = new To_Collecting();
                foreach (DataRow dr in dt.Rows)
                {
                    to_collecting.ID                 = Convert.ToInt32(dr["ID"]);
                    to_collecting.ReceiptNum         = Convert.ToString(dr["receiptNum"]);
                    to_collecting.ReceiptAmount      = Convert.ToDouble(dr["receiptAmount"]);
                    to_collecting.ReceiptDate        = Convert.ToDateTime(dr["receiptDate"]);
                    to_collecting.BusinessUnit       = Convert.ToString(dr["businessUnit"]);
                    to_collecting.BusinessUnitID     = Convert.ToInt32(dr["businessUnitID"]);
                    to_collecting.PaymentUnit        = Convert.ToString(dr["paymentUnit"]);
                    to_collecting.PaymentUnitID      = Convert.ToInt32(dr["paymentUnitID"]);
                    to_collecting.PaymentMode        = Convert.ToInt32(dr["paymentMode"]);
                    to_collecting.Marker             = Convert.ToString(dr["marker"]);
                    to_collecting.MarkerID           = Convert.ToInt32(dr["markerID"]);
                    to_collecting.MarkerDepartment   = Convert.ToString(dr["markerDepartment"]);
                    to_collecting.MarkerDepartmentID = Convert.ToInt32(dr["markerDepartmentID"]);
                    to_collecting.MarkDate           = Convert.ToDateTime(dr["markDate"]);
                    to_collecting.ReceiptMark        = Convert.ToString(dr["receiptMark"]);

                    to_collecting.payBankId = Convert.IsDBNull(dr["payBankId"]) ? 0 : Convert.ToInt32(dr["payBankId"]);

                    to_collecting.PayBank           = Convert.ToString(dr["payBank"]);
                    to_collecting.PayBankAcount     = Convert.ToString(dr["payBankAcount"]);
                    to_collecting.ConfirmReceipt    = Convert.ToInt32(dr["confirmReceipt"]);
                    to_collecting.receiptStatusCode = Convert.ToInt32(dr["receiptStatusCode"]);
                    to_collecting.orderNum          = Convert.ToString(dr["orderNum"]);
                    to_collecting.codeFormat        = Convert.ToString(dr["codeFormat"]);
                }
            }

            return(to_collecting);
        }
Example #7
0
        /// <summary>
        /// 发消息给用户
        /// </summary>
        /// <param name="falg">0:取消确认,1:取消认领</param>
        private void SendMessage(int collectingID, int falg)
        {
            To_Collecting collecting = To_CollectingManager.getTo_CollectingById(collectingID);

            if (collecting == null)
            {
                return;
            }

            EtNet_Models.Information messageEntity = new EtNet_Models.Information();

            To_ClaimManager claimBLL = new To_ClaimManager();

            string salesman = claimBLL.GetFiledValue(collectingID, "salesman");

            string msg = "";

            if (falg == 0)
            {
                msg = string.Format("收款编号:{0},被业务员:{1},取消认领,取消时间:{2}", collecting.ReceiptNum, salesman, DateTime.Now.ToShortDateString());
            }
            else
            {
                msg = string.Format("业务员:{0},对收款编号:{1},进行收款认定修改!", salesman, collecting.ReceiptNum);
            }

            messageEntity.associationid = 0;//此处不需要,默认给一个值
            messageEntity.contents      = msg;
            messageEntity.createtime    = DateTime.Now;
            messageEntity.founderid     = (Session["login"] as LoginInfo).Id;
            messageEntity.sendtime      = DateTime.Now;
            messageEntity.sortid        = 1;//消息分类:个人消息

            if (InformationManager.Add(messageEntity))
            {
                int messageID = InformationManager.GetMaxId();

                EtNet_Models.InformationNotice messageNoticeEntity = new InformationNotice();
                messageNoticeEntity.informationid = messageID;

                messageNoticeEntity.recipientid = collecting.MarkerID;
                messageNoticeEntity.remind      = "是";//默认未阅读;

                InformationNoticeManager.Add(messageNoticeEntity);
            }
        }
        /// <summary>
        /// 根据单据ID加载收款单据数据
        /// </summary>
        /// <param name="id"></param>
        private void LoadCollecting(int id)
        {
            To_Collecting collectingModel = To_CollectingManager.getTo_CollectingById(id);

            if (collectingModel == null)
            {
                form1.InnerHtml = "<p style='font-size:14px;'>单据不存在,可能已被删除!<br /><a href='CollectingList.aspx'>返回单据列表</a></p>";
                return;
            }

            txtMarkDate.Text         = collectingModel.MarkDate.ToShortDateString();
            lblMarkerDepartment.Text = collectingModel.MarkerDepartment;
            //txtBank.Text = collectingModel.PayBank;
            txtBankAccount.Text = collectingModel.PayBankAcount.Trim();
            txtUnit.Text        = collectingModel.PaymentUnit;
            txtMoney.Text       = collectingModel.ReceiptAmount.ToString("F2");
            txtDate.Text        = collectingModel.ReceiptDate.ToShortDateString();
            txtMark.Value       = collectingModel.ReceiptMark;
            lblMarker.Text      = collectingModel.Marker;

            hidComID.Value = collectingModel.PaymentUnitID.ToString() == "0" ? string.Empty : collectingModel.PaymentUnitID.ToString();
            //ddlWay.SelectedValue = collectingModel.PaymentMode.ToString();

            LoginInfo userInfo = LoginInfoManager.getLoginInfoById(collectingModel.MarkerID);

            if (userInfo != null)
            {
                LoadUnit(userInfo, collectingModel.BusinessUnitID);
            }

            if (collectingModel.PaymentMode == 0)
            {
                paymentInfo.Style.Add("display", "none");
            }

            LoadBank(collectingModel.PayBank);
            if (Request.QueryString["action"] == null)
            {
                txtNumber.Text     = collectingModel.ReceiptNum;
                txtNumber.ReadOnly = true;
                txtMarkDate.Text   = collectingModel.MarkDate.ToShortDateString();
                ChkConfirm.Checked = collectingModel.ConfirmReceipt == 1;
            }
        }
        /// <summary>
        ///[To_Collecting]表添加的方法
        /// </summary>
        public static int addTo_Collecting(To_Collecting to_collecting)
        {
            string sql = "insert into To_Collecting([receiptNum],[receiptAmount],[receiptDate],[businessUnit],[businessUnitID],[paymentUnit],[paymentUnitID],[paymentMode],[marker],[markerID],[markerDepartment],[markerDepartmentID],[markDate],[receiptMark],[payBank],[payBankAcount],[confirmReceipt],[receiptStatusCode],[orderNum],[codeFormat],[payBankId]) values (@receiptNum,@receiptAmount,@receiptDate,@businessUnit,@businessUnitID,@paymentUnit,@paymentUnitID,@paymentMode,@marker,@markerID,@markerDepartment,@markerDepartmentID,@markDate,@receiptMark,@payBank,@payBankAcount,@confirmReceipt,@receiptStatusCode,@orderNum,@codeFormat,@payBankId);select @@IDENTITY";

            SqlParameter[] sp = new SqlParameter[]
            {
                new SqlParameter("@receiptNum", to_collecting.ReceiptNum),
                new SqlParameter("@receiptAmount", to_collecting.ReceiptAmount),
                new SqlParameter("@receiptDate", to_collecting.ReceiptDate),
                new SqlParameter("@businessUnit", to_collecting.BusinessUnit),
                new SqlParameter("@businessUnitID", to_collecting.BusinessUnitID),
                new SqlParameter("@paymentUnit", to_collecting.PaymentUnit),
                new SqlParameter("@paymentUnitID", to_collecting.PaymentUnitID),
                new SqlParameter("@paymentMode", to_collecting.PaymentMode),
                new SqlParameter("@marker", to_collecting.Marker),
                new SqlParameter("@markerID", to_collecting.MarkerID),
                new SqlParameter("@markerDepartment", to_collecting.MarkerDepartment),
                new SqlParameter("@markerDepartmentID", to_collecting.MarkerDepartmentID),
                new SqlParameter("@markDate", to_collecting.MarkDate),
                new SqlParameter("@receiptMark", to_collecting.ReceiptMark),
                new SqlParameter("@payBank", to_collecting.PayBank),
                new SqlParameter("@payBankAcount", to_collecting.PayBankAcount),
                new SqlParameter("@confirmReceipt", to_collecting.ConfirmReceipt),
                new SqlParameter("@receiptStatusCode", to_collecting.receiptStatusCode),
                new SqlParameter("@orderNum", to_collecting.orderNum),
                new SqlParameter("@codeFormat", to_collecting.codeFormat),
                new SqlParameter("@payBankId", to_collecting.payBankId),
            };
            using (SqlConnection conn = new SqlConnection(DBHelper.connectionString))
            {
                conn.Open();
                SqlCommand sqlCmd = new SqlCommand();
                sqlCmd.CommandText = sql;
                sqlCmd.Connection  = conn;
                sqlCmd.Parameters.AddRange(sp);

                object objResult = sqlCmd.ExecuteScalar();

                return(objResult != null && objResult != DBNull.Value ? Convert.ToInt32(objResult) : 0);
            }
        }
        protected void ibtnDeleteAll_Click(object sender, ImageClickEventArgs e)
        {
            string delId = "";

            //先遍历取得选中项

            for (int i = 0; i < this.rpCollecting.Items.Count; i++)
            {
                CheckBox cbx = (CheckBox)(rpCollecting.Items[i].FindControl("cbx"));
                Label    lbl = (Label)rpCollecting.Items[i].FindControl("lbl");
                if (cbx != null || cbx.Text != "")
                {
                    if (cbx.Checked)
                    {
                        delId += lbl.Text + ",";
                    }
                }
            }
            //去掉最后一个,
            delId = (delId + ")").Replace(",)", "");
            IList check = delId.Split(',');

            To_ClaimManager       b_claim       = new To_ClaimManager();
            To_ClaimDetailManager b_claimDetail = new To_ClaimDetailManager();

            for (int i = 0; i < check.Count; i++)
            {
                To_Collecting to_Collecting = To_CollectingManager.getTo_CollectingById(Convert.ToInt32(check[i]));
                if (to_Collecting != null)
                {
                    To_CollectingManager.deleteTo_Collecting(Convert.ToInt32(check[i]));
                }
                string claimID = b_claim.GetID(Convert.ToInt32(check[i]));
                if (claimID != "" && b_claim.Delete(int.Parse(claimID)))
                {
                    b_claimDetail.DeleteByClaim(claimID);
                }
            }
            dataBind();
        }
        /// <summary>
        ///根据SQL语句获取集合
        /// </summary>
        public static IList <To_Collecting> getTo_CollectingsBySql(string sql)
        {
            IList <To_Collecting> list = new List <To_Collecting>();
            DataTable             dt   = DBHelper.GetDataSet(sql);

            if (dt.Rows.Count > 0)
            {
                foreach (DataRow dr in dt.Rows)
                {
                    To_Collecting to_collecting = new To_Collecting();
                    to_collecting.ID                 = Convert.ToInt32(dr["ID"]);
                    to_collecting.ReceiptNum         = Convert.ToString(dr["receiptNum"]);
                    to_collecting.ReceiptAmount      = Convert.ToDouble(dr["receiptAmount"]);
                    to_collecting.ReceiptDate        = Convert.ToDateTime(dr["receiptDate"]);
                    to_collecting.BusinessUnit       = Convert.ToString(dr["businessUnit"]);
                    to_collecting.BusinessUnitID     = Convert.ToInt32(dr["businessUnitID"]);
                    to_collecting.PaymentUnit        = Convert.ToString(dr["paymentUnit"]);
                    to_collecting.PaymentUnitID      = Convert.ToInt32(dr["paymentUnitID"]);
                    to_collecting.PaymentMode        = Convert.ToInt32(dr["paymentMode"]);
                    to_collecting.Marker             = Convert.ToString(dr["marker"]);
                    to_collecting.MarkerID           = Convert.ToInt32(dr["markerID"]);
                    to_collecting.MarkerDepartment   = Convert.ToString(dr["markerDepartment"]);
                    to_collecting.MarkerDepartmentID = Convert.ToInt32(dr["markerDepartmentID"]);
                    to_collecting.MarkDate           = Convert.ToDateTime(dr["markDate"]);
                    to_collecting.ReceiptMark        = Convert.ToString(dr["receiptMark"]);

                    to_collecting.payBankId = Convert.IsDBNull(dr["payBankId"]) ? 0 : Convert.ToInt32(dr["payBankId"]);

                    to_collecting.PayBank           = Convert.ToString(dr["payBank"]);
                    to_collecting.PayBankAcount     = Convert.ToString(dr["payBankAcount"]);
                    to_collecting.ConfirmReceipt    = Convert.ToInt32(dr["confirmReceipt"]);
                    to_collecting.receiptStatusCode = Convert.ToInt32(dr["receiptStatusCode"]);
                    to_collecting.orderNum          = Convert.ToString(dr["orderNum"]);
                    to_collecting.codeFormat        = Convert.ToString(dr["codeFormat"]);
                    list.Add(to_collecting);
                }
            }
            return(list);
        }
Example #12
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);
            }
        }
Example #13
0
        /// <summary>
        /// 根据单据ID加载收款单据数据
        /// </summary>
        /// <param name="id"></param>
        private void LoadCollecting(int id)
        {
            To_Collecting collectingModel = To_CollectingManager.getTo_CollectingById(id);

            if (collectingModel == null)
            {
                form1.InnerHtml = "<p style='font-size:14px;'>单据不存在,可能已被删除!<br /><a href='CollectingList.aspx'>返回单据列表</a></p>";
                return;
            }

            LblMakeDate.Text       = collectingModel.MarkDate.ToShortDateString();
            LblMakeDepartment.Text = collectingModel.MarkerDepartment;
            LblPayBank.Text        = collectingModel.PayBank;
            LblPayBankAcount.Text  = collectingModel.PayBankAcount;
            LblPaymentUnit.Text    = collectingModel.PaymentUnit;
            LblReceiptAmount.Text  = collectingModel.ReceiptAmount.ToString("N2");
            LblReceiptDate.Text    = collectingModel.ReceiptDate.ToShortDateString();
            LtrMark.Text           = collectingModel.ReceiptMark;
            LblReceiptNum.Text     = collectingModel.ReceiptNum;
            LtrConfirm.Text        = collectingModel.ConfirmReceipt == 1 ? "已确认" : "<font color='red'>未确认</font>";
            LblMaker.Text          = collectingModel.Marker;

            //如果已经确认那么显示确认信息
            if (collectingModel.ConfirmReceipt == 1)
            {
                confirm.Visible = true;
                DataTable dt = To_CollectingManager.getConfirmInfo(id.ToString());
                if (dt.Rows.Count > 0)
                {
                    this.lblConfirmMan.Text  = dt.Rows[0]["confirmMan"].ToString();
                    this.lblConfirmDate.Text = dt.Rows[0]["confirmDate"].ToString();
                }
            }

            switch (collectingModel.PaymentMode)
            {
            case 0:
                LblPaymentMode.Text = "现金";
                break;

            case 1:
                LblPaymentMode.Text = "转账";
                break;

            case 2:
                LblPaymentMode.Text = "网银";
                break;

            default:
                LblPaymentMode.Text = "未知";
                break;
            }

            LblBusinessUnit.Text = collectingModel.BusinessUnit;

            if (collectingModel.PaymentMode != 0)
            {
                paymentInfo.Visible = true;
            }
            else
            {
                paymentInfo.Visible = false;
            }

            LoadClaimDetail(id);
        }
        /// <summary>
        /// 添加收款数据
        /// </summary>
        /// <returns>添加成功返回true</returns>
        private bool EditCollecting()
        {
            LoginInfo currentUser = Session["login"] as LoginInfo;

            To_Collecting collectingModel = new To_Collecting();

            int ID = Convert.ToInt32(Request.QueryString["id"]);

            collectingModel = To_CollectingManager.getTo_CollectingById(ID);

            collectingModel.BusinessUnit       = ddlUnit.SelectedItem.Text;
            collectingModel.BusinessUnitID     = int.Parse(ddlUnit.SelectedValue);
            collectingModel.MarkDate           = DateTime.Parse(txtMarkDate.Text);
            collectingModel.Marker             = currentUser.Cname;
            collectingModel.MarkerID           = currentUser.Id;
            collectingModel.MarkerDepartment   = lblMarkerDepartment.Text;
            collectingModel.MarkerDepartmentID = currentUser.Departid;
            collectingModel.payBankId          = int.Parse(DdlBank.SelectedValue);
            collectingModel.PayBank            = DdlBank.SelectedItem.Text;//txtBank.Text;
            collectingModel.PayBankAcount      = txtBankAccount.Text;

            //collectingModel.PaymentMode = int.Parse(ddlWay.SelectedValue.Trim());
            //if (int.Parse(ddlWay.SelectedValue.Trim()) != 0)
            //{
            //    if (DdlBank.SelectedIndex < 0)
            //    {
            //        return false;
            //    }
            //    collectingModel.payBankId = int.Parse(DdlBank.SelectedValue);
            //    collectingModel.PayBank = DdlBank.SelectedItem.Text;//txtBank.Text;
            //    collectingModel.PayBankAcount = txtBankAccount.Text;
            //}
            //else
            //{
            //    collectingModel.payBankId = 0;
            //    collectingModel.PayBank = "";//txtBank.Text;
            //    collectingModel.PayBankAcount = "";
            //}

            collectingModel.PaymentUnit    = txtUnit.Text;
            collectingModel.PaymentUnitID  = int.Parse(hidComID.Value.Trim() == string.Empty ? "0" : hidComID.Value.Trim());
            collectingModel.ReceiptAmount  = float.Parse(txtMoney.Text);
            collectingModel.ReceiptDate    = DateTime.Parse(txtDate.Text);
            collectingModel.ReceiptMark    = txtMark.Value;
            collectingModel.ReceiptNum     = txtNumber.Text;
            collectingModel.ConfirmReceipt = ChkConfirm.Checked ? 1 : 0;

            AddLimit(ID);
            if (ChkConfirm.Checked) //如果确认登记了。那么需要登记确认人和确认日期
            {
                To_CollectingManager.updateConfirm(ID.ToString(), currentUser.Cname, DateTime.Now.ToString());
            }
            if (Request.QueryString["action"] == null)
            {
                collectingModel.ID = Convert.ToInt32(Request.QueryString["id"]);
                return(To_CollectingManager.updateTo_Collecting(collectingModel) > 0);
            }
            else
            {
                return(To_CollectingManager.addTo_Collecting(collectingModel) > 0);
            }
        }
Example #15
0
 public static int addTo_Collecting(To_Collecting to_collecting)
 {
     return(To_CollectingService.addTo_Collecting(to_collecting));
 }
Example #16
0
 /// <summary>
 /// 更新收款单的单位信息
 /// </summary>
 /// <param name="to_collecting"></param>
 /// <returns></returns>
 public static int updateTo_CollectPaymentUnit(To_Collecting to_collecting)
 {
     return(To_CollectingService.updateTo_CollectPaymentUnit(to_collecting));
 }
Example #17
0
 public static int updateTo_Collecting(To_Collecting to_collecting)
 {
     return(To_CollectingService.updateTo_CollectingById(to_collecting));
 }