/// <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); } }