public bool Update(AccounPayoutModel model) { StringBuilder builder = new StringBuilder(); builder.Append("update Fund_Prj_Accoun_Payout set "); builder.Append("PayOutCode=@PayOutCode,"); builder.Append("prjGuid=@prjGuid,"); builder.Append("RPGuid=@RPGuid,"); builder.Append("PayOutMoney=@PayOutMoney,"); builder.Append("PayOutPeople=@PayOutPeople,"); builder.Append("PayOutTime=@PayOutTime,"); builder.Append("Handler=@Handler,"); builder.Append("Remark=@Remark,"); builder.Append("UpdateUser=@UpdateUser,"); builder.Append("UpdateTime=@UpdateTime"); builder.Append(" where PayOutGuid=@PayOutGuid "); SqlParameter[] commandParameters = new SqlParameter[] { new SqlParameter("@PayOutGuid", SqlDbType.UniqueIdentifier, 0x10), new SqlParameter("@PayOutCode", SqlDbType.VarChar, 100), new SqlParameter("@prjGuid", SqlDbType.VarChar, 100), new SqlParameter("@RPGuid", SqlDbType.VarChar, 100), new SqlParameter("@PayOutMoney", SqlDbType.Decimal, 9), new SqlParameter("@PayOutPeople", SqlDbType.VarChar, 100), new SqlParameter("@PayOutTime", SqlDbType.DateTime), new SqlParameter("@Handler", SqlDbType.VarChar, 100), new SqlParameter("@Remark", SqlDbType.VarChar), new SqlParameter("@UpdateUser", SqlDbType.VarChar, 100), new SqlParameter("@UpdateTime", SqlDbType.DateTime) }; commandParameters[0].Value = model.PayOutGuid; commandParameters[1].Value = model.PayOutCode; commandParameters[2].Value = model.prjGuid; commandParameters[3].Value = model.RPGuid; commandParameters[4].Value = model.PayOutMoney; commandParameters[5].Value = model.PayOutPeople; commandParameters[6].Value = model.PayOutTime; commandParameters[7].Value = model.Handler; commandParameters[8].Value = model.Remark; commandParameters[9].Value = model.UpdateUser; commandParameters[10].Value = model.UpdateTime; return(SqlHelper.ExecuteNonQuery(CommandType.Text, builder.ToString(), commandParameters) > 0); }
public AccounPayoutModel GetModel(Guid PayOutGuid) { StringBuilder builder = new StringBuilder(); builder.Append("select top 1 *,ContractName from Fund_Prj_Accoun_Payout "); builder.Append(" left join Con_Payout_Payment on Fund_Prj_Accoun_Payout.RPGuid=Con_Payout_Payment.ID "); builder.Append(" left join Con_Payout_Contract on Con_Payout_Payment.ContractID=Con_Payout_Contract.ContractID "); builder.Append(" where PayOutGuid=@PayOutGuid "); SqlParameter[] commandParameters = new SqlParameter[] { new SqlParameter("@PayOutGuid", SqlDbType.UniqueIdentifier) }; commandParameters[0].Value = PayOutGuid; AccounPayoutModel model = new AccounPayoutModel(); DataTable table = SqlHelper.ExecuteQuery(CommandType.Text, builder.ToString(), commandParameters); if (table.Rows.Count <= 0) { return(null); } if (table.Rows[0]["PayOutGuid"].ToString() != "") { model.PayOutGuid = new Guid(table.Rows[0]["PayOutGuid"].ToString()); } model.PayOutCode = table.Rows[0]["PayOutCode"].ToString(); model.prjGuid = table.Rows[0]["prjGuid"].ToString(); model.RPGuid = table.Rows[0]["RPGuid"].ToString(); if (table.Rows[0]["PayOutMoney"].ToString() != "") { model.PayOutMoney = new decimal?(decimal.Parse(table.Rows[0]["PayOutMoney"].ToString())); } model.PayOutPeople = table.Rows[0]["PayOutPeople"].ToString(); if (table.Rows[0]["PayOutTime"].ToString() != "") { model.PayOutTime = new DateTime?(DateTime.Parse(table.Rows[0]["PayOutTime"].ToString())); } model.Handler = table.Rows[0]["Handler"].ToString(); if (table.Rows[0]["FloeState"].ToString() != "") { model.FloeState = new int?(int.Parse(table.Rows[0]["FloeState"].ToString())); } model.Remark = table.Rows[0]["Remark"].ToString(); model.UpdateUser = table.Rows[0]["UpdateUser"].ToString(); if (table.Rows[0]["UpdateTime"].ToString() != "") { model.UpdateTime = new DateTime?(DateTime.Parse(table.Rows[0]["UpdateTime"].ToString())); } if (table.Rows[0]["Type"].ToString() != "") { model.Type = new int?(int.Parse(table.Rows[0]["Type"].ToString())); } model.ContractName = table.Rows[0]["ContractName"].ToString(); return(model); }
private AccounPayoutModel getModel() { this.accountModel = new AccounPayoutModel(); this.accountModel.PayOutCode = this.txtAccCode.Text.ToString(); this.accountModel.PayOutTime = new DateTime?(Convert.ToDateTime(this.txtInDate.Text.ToString())); this.accountModel.PayOutMoney = new decimal?(Convert.ToDecimal(this.txtInMoney.Text.ToString())); this.accountModel.PayOutPeople = this.hdnPeopleCode.Value; this.accountModel.PayOutGuid = new Guid(this.hdnAccountID.Value); this.accountModel.prjGuid = this.hdnProjectCode.Value; this.accountModel.Remark = this.txtRemark.Text.ToString(); this.accountModel.Handler = this.txtHandler.Text.ToString(); this.accountModel.RPGuid = this.hdnRPUID.Value.ToString(); this.accountModel.UpdateTime = new DateTime?(DateTime.Now); this.accountModel.UpdateUser = base.UserCode; this.accountModel.Type = new int?(Convert.ToInt32(base.Request.QueryString["Sub"].ToString())); return(this.accountModel); }
public List <AccounPayoutModel> DataTableToList(DataTable dt) { List <AccounPayoutModel> list = new List <AccounPayoutModel>(); int count = dt.Rows.Count; if (count > 0) { for (int i = 0; i < count; i++) { AccounPayoutModel item = new AccounPayoutModel(); if (dt.Rows[i]["PayOutGuid"].ToString() != "") { item.PayOutGuid = new Guid(dt.Rows[i]["PayOutGuid"].ToString()); } item.PayOutCode = dt.Rows[i]["PayOutCode"].ToString(); item.prjGuid = dt.Rows[i]["prjGuid"].ToString(); item.RPGuid = dt.Rows[i]["RPGuid"].ToString(); if (dt.Rows[i]["PayOutMoney"].ToString() != "") { item.PayOutMoney = new decimal?(decimal.Parse(dt.Rows[i]["PayOutMoney"].ToString())); } item.PayOutPeople = dt.Rows[i]["PayOutPeople"].ToString(); if (dt.Rows[i]["PayOutTime"].ToString() != "") { item.PayOutTime = new DateTime?(DateTime.Parse(dt.Rows[i]["PayOutTime"].ToString())); } item.Handler = dt.Rows[i]["Handler"].ToString(); if (dt.Rows[i]["FloeState"].ToString() != "") { item.FloeState = new int?(int.Parse(dt.Rows[i]["FloeState"].ToString())); } item.Remark = dt.Rows[i]["Remark"].ToString(); item.UpdateUser = dt.Rows[i]["UpdateUser"].ToString(); if (dt.Rows[i]["UpdateTime"].ToString() != "") { item.UpdateTime = new DateTime?(DateTime.Parse(dt.Rows[i]["UpdateTime"].ToString())); } list.Add(item); } } return(list); }
protected void btnSave_Click(object sender, EventArgs e) { StringBuilder stringBuilder = new StringBuilder(); this.accountModel = this.getModel(); if (this.AccountBll.Exists(this.accountModel.PayOutCode, this.accountModel.PayOutGuid)) { stringBuilder.Append("top.ui.alert('账单编号重复,请重新输入');"); base.RegisterScript(stringBuilder.ToString()); return; } if (base.Request.QueryString["Action"] == "Add") { this.accountModel.FloeState = new int?(-1); this.AccountBll.Add(this.accountModel); base.RegisterScript("top.ui.tabSuccess({ parentName: '_accountpayout' }); "); return; } this.AccountBll.Update(this.accountModel); base.RegisterScript("top.ui.tabSuccess({ parentName: '_accountpayout' }); "); }
public bool Add(AccounPayoutModel model) { StringBuilder builder = new StringBuilder(); builder.Append("insert into Fund_Prj_Accoun_Payout("); builder.Append("PayOutGuid,PayOutCode,prjGuid,RPGuid,PayOutMoney,PayOutPeople,PayOutTime,Handler,FloeState,Remark,UpdateUser,UpdateTime,Type)"); builder.Append(" values ("); builder.Append("@PayOutGuid,@PayOutCode,@prjGuid,@RPGuid,@PayOutMoney,@PayOutPeople,@PayOutTime,@Handler,@FloeState,@Remark,@UpdateUser,@UpdateTime,@Type)"); SqlParameter[] commandParameters = new SqlParameter[] { new SqlParameter("@PayOutGuid", SqlDbType.UniqueIdentifier, 0x10), new SqlParameter("@PayOutCode", SqlDbType.VarChar, 100), new SqlParameter("@prjGuid", SqlDbType.VarChar, 100), new SqlParameter("@RPGuid", SqlDbType.VarChar, 100), new SqlParameter("@PayOutMoney", SqlDbType.Decimal, 9), new SqlParameter("@PayOutPeople", SqlDbType.VarChar, 100), new SqlParameter("@PayOutTime", SqlDbType.DateTime), new SqlParameter("@Handler", SqlDbType.VarChar, 100), new SqlParameter("@FloeState", SqlDbType.Int, 4), new SqlParameter("@Remark", SqlDbType.VarChar), new SqlParameter("@UpdateUser", SqlDbType.VarChar, 100), new SqlParameter("@UpdateTime", SqlDbType.DateTime), new SqlParameter("@Type", SqlDbType.Int, 4) }; commandParameters[0].Value = model.PayOutGuid; commandParameters[1].Value = model.PayOutCode; commandParameters[2].Value = model.prjGuid; commandParameters[3].Value = model.RPGuid; commandParameters[4].Value = model.PayOutMoney; commandParameters[5].Value = model.PayOutPeople; commandParameters[6].Value = model.PayOutTime; commandParameters[7].Value = model.Handler; commandParameters[8].Value = model.FloeState; commandParameters[9].Value = model.Remark; commandParameters[10].Value = model.UpdateUser; commandParameters[11].Value = model.UpdateTime; commandParameters[12].Value = model.Type; return(SqlHelper.ExecuteNonQuery(CommandType.Text, builder.ToString(), commandParameters) > 0); }
public bool Add(AccounPayoutModel model) { return(this.dal.Add(model)); }
public bool Update(AccounPayoutModel model) { return(this.dal.Update(model)); }
protected void Page_Load(object sender, EventArgs e) { if (!base.IsPostBack) { this.hdnAccountID.Value = base.Request.QueryString["ic"].ToString(); this.accountModel = this.AccountBll.GetModel(new Guid(this.hdnAccountID.Value)); this.lblcode.Text = this.accountModel.PayOutCode.ToString(); this.lblInDate.Text = Convert.ToDateTime(this.accountModel.PayOutTime).ToString("yyyy-MM-dd"); this.lblInPeople.Text = com.jwsoft.pm.entpm.PageHelper.QueryUser(this, this.accountModel.PayOutPeople); PrjInfoModel modelByPrjGuid = this.ptPrjInfo.GetModelByPrjGuid(this.accountModel.prjGuid); if (modelByPrjGuid != null) { this.lblProject.Text = modelByPrjGuid.PrjName; } this.lblPayMoney.Text = this.AccountBll.getMoneyByPayCode(this.accountModel.RPGuid.ToString()).ToString(); PayoutPayment payoutPayment = new PayoutPayment(); PayoutPaymentModel model = payoutPayment.GetModel(this.accountModel.RPGuid.ToString()); if (model != null) { this.lblContPayCode.Text = model.PaymentCode.ToString(); this.lblContMoney.Text = model.PaymentMoney.ToString(); } else { this.lblWord.Text = "费用名称"; string strwhere = " inDiaryId ='" + this.accountModel.RPGuid.ToString() + "' "; DataTable dtByWhere = OrganizationDiary.getDtByWhere(strwhere); if (dtByWhere.Rows.Count > 0) { if (string.IsNullOrEmpty(dtByWhere.Rows[0]["Total"].ToString())) { this.lblContMoney.Text = "0.00"; } else { this.lblContMoney.Text = dtByWhere.Rows[0]["Total"].ToString(); } this.lblContPayCode.Text = dtByWhere.Rows[0]["Name"].ToString(); } } this.lblInMoney.Text = this.accountModel.PayOutMoney.ToString(); this.lblHandler.Text = this.accountModel.Handler.ToString(); this.lblRemark.Text = this.accountModel.Remark.ToString(); this.lblContractName.Text = this.accountModel.ContractName.ToString(); this.upload.InnerHtml = this.FilesBind(this.hdnAccountID.Value); this.lblPrintDate.Text = DateTime.Now.ToShortDateString(); this.lblPrintPeople.Text = com.jwsoft.pm.entpm.action.PageHelper.QueryUser(this, base.UserCode); this.lblContMoney.Text = (string.IsNullOrEmpty(this.lblContMoney.Text) ? "0.00" : this.lblContMoney.Text); if (this.accountModel.PayOutMoney > Convert.ToDecimal(this.lblContMoney.Text) - Convert.ToDecimal(this.lblPayMoney.Text)) { this.lblInMoney.Attributes.Add("style", "Color:red"); } this.lbljianMoney.Text = (Convert.ToDecimal(this.lblContMoney.Text) - Convert.ToDecimal(this.lblPayMoney.Text)).ToString(); Fund_Prj_Accoun fund_Prj_Accoun = new Fund_Prj_Accoun(); string strwhere2 = " and AccountID='" + fund_Prj_Accoun.getAccountByPrjGuid(this.accountModel.prjGuid.ToString()) + "' "; DataTable accounSumInfo = fund_Prj_Accoun.getAccounSumInfo(strwhere2); this.lblAccountYue.Text = accounSumInfo.Rows[0]["JE"].ToString(); if (base.Request.QueryString["see"] != null && base.Request.QueryString["see"].ToString() == "see") { this.lblAccountYue.Attributes.Add("style", "font-weight:bold"); } else { this.bllProducer.Visible = false; this.btnPrnt.Visible = false; if (Convert.ToDecimal(this.lblAccountYue.Text.ToString()) < Convert.ToDecimal(this.lblInMoney.Text.ToString())) { Label expr_4D5 = this.lblAccountYue; expr_4D5.Text += " 本次记账金额大于账户余额!"; this.lblAccountYue.Attributes.Add("style", "font-weight:bold;color:red"); } } this.ShowGuideLine(this.accountModel.RPGuid.ToString()); } }
protected void Page_Load(object sender, EventArgs e) { if (!base.IsPostBack) { this.hdnZHID.Value = base.Request.QueryString["ZHID"].ToString(); this.HdnSub.Value = base.Request.QueryString["Sub"].ToString(); string strwhere = " and AccountID='" + base.Request["ZHID"].ToString() + "' "; Fund_Prj_Accoun fund_Prj_Accoun = new Fund_Prj_Accoun(); DataTable accounSumInfo = fund_Prj_Accoun.getAccounSumInfo(strwhere); this.hdnyue.Value = accounSumInfo.Rows[0]["JE"].ToString(); if (this.HdnSub.Value == "0") { this.lblSel.Text = "资金支付申请"; } else { this.lblSel.Text = "费用名称"; } if (base.Request.QueryString["Action"] == "Add") { this.txtAccCode.Text = DateTime.Now.ToString("yyyyMMddHHmmssfff"); this.hdnAccountID.Value = Guid.NewGuid().ToString(); this.txtInDate.Text = DateTime.Now.ToString("yyyy-MM-dd"); this.txtInPeople.Text = com.jwsoft.pm.entpm.PageHelper.QueryUser(this, base.UserCode); this.hdnPeopleCode.Value = base.UserCode; this.aM = this.al.GetModel(this.hdnZHID.Value); if (!this.aM.PrjGuid.StartsWith("'")) { PrjInfoModel modelByPrjGuid = this.ptPrjInfo.GetModelByPrjGuid(this.aM.PrjGuid); if (modelByPrjGuid != null) { this.txtPrjName.Text = modelByPrjGuid.PrjName; this.hdnProjectCode.Value = this.aM.PrjGuid; } } } else { this.hdnAccountID.Value = base.Request.QueryString["AccountID"].ToString(); this.accountModel = this.AccountBll.GetModel(new Guid(this.hdnAccountID.Value)); this.txtAccCode.Text = this.accountModel.PayOutCode.ToString(); this.txtInDate.Text = Convert.ToDateTime(this.accountModel.PayOutTime).ToString("yyyy-MM-dd"); this.txtInPeople.Text = com.jwsoft.pm.entpm.PageHelper.QueryUser(this, this.accountModel.PayOutPeople); this.hdnPeopleCode.Value = this.accountModel.PayOutPeople; this.hdnProjectCode.Value = this.accountModel.prjGuid.ToString(); PrjInfoModel modelByPrjGuid2 = this.ptPrjInfo.GetModelByPrjGuid(this.accountModel.prjGuid); if (modelByPrjGuid2 != null) { this.txtPrjName.Text = modelByPrjGuid2.PrjName; } this.txtRemark.Text = this.accountModel.Remark.ToString(); this.txtInMoney.Text = this.accountModel.PayOutMoney.ToString(); this.txtHandler.Text = this.accountModel.Handler.ToString(); this.hdnRPUID.Value = this.accountModel.RPGuid.ToString(); this.txtPayOut.Text = this.AccountBll.getMoneyByPayCode(this.accountModel.RPGuid.ToString()).ToString(); this.txtPayMoney.Text = "0.00"; if (this.HdnSub.Value == "0") { PayoutPayment payoutPayment = new PayoutPayment(); PayoutPaymentModel model = payoutPayment.GetModel(this.accountModel.RPGuid.ToString()); if (model != null) { this.txtRPCode.Text = model.PaymentCode.ToString(); this.txtPayMoney.Text = model.PaymentMoney.ToString(); } } else { string strwhere2 = " inDiaryId ='" + this.accountModel.RPGuid.ToString() + "' "; DataTable dtByWhere = OrganizationDiary.getDtByWhere(strwhere2); if (dtByWhere.Rows.Count > 0) { if (string.IsNullOrEmpty(dtByWhere.Rows[0]["Total"].ToString())) { this.txtPayMoney.Text = "0.00"; } else { this.txtPayMoney.Text = dtByWhere.Rows[0]["Total"].ToString(); } this.txtRPCode.Text = dtByWhere.Rows[0]["Name"].ToString(); } } this.txtJianMoney.Text = (Convert.ToDecimal(this.txtPayMoney.Text) - Convert.ToDecimal(this.txtPayOut.Text)).ToString(); } this.FileUpload1.Class = "AccountPayOut"; this.FileUpload1.RecordCode = this.hdnAccountID.Value; } }