public static To_Outcome getTo_OutcomeBySql(string sql) { DataTable dt = DBHelper.GetDataSet(sql); To_Outcome model = null; if (dt.Rows.Count > 0) { model = new To_Outcome(); foreach (DataRow dr in dt.Rows) { model.ID = Convert.ToInt32(dr["Id"]); model.OutComeDate = Convert.ToDateTime(dr["outComeDate"]); model.OutComeItem = Convert.ToString(dr["outComeItem"]); model.OutComeItemId = Convert.IsDBNull(dr["outComeItemid"]) ? 0 : Convert.ToInt32(dr["outComeItemid"]); model.OutComeStatus = Convert.ToString(dr["outComeStatus"]); model.ComeUnit = Convert.ToString(dr["comeUnit"]); model.OutComeMoney = Convert.ToDouble(dr["outComeMoney"]); model.OutComeBankName = Convert.ToString(dr["outComeBankName"]); model.OutComeBankId = Convert.ToInt32(dr["outComeBankId"]); model.OutComeBankAccount = Convert.ToString(dr["outComeBankAccount"]); model.OutComeDepart = Convert.ToString(dr["outComeDepart"]); model.OutComeDepartId = Convert.ToInt32(dr["outComeDepartId"]); model.MakeName = Convert.ToString(dr["makeName"]); model.MakeId = Convert.ToInt32(dr["makeId"]); model.MakeDate = Convert.ToDateTime(dr["makeDate"]); model.Remark = Convert.ToString(dr["remark"]); } } return(model); }
public static int Add(To_Outcome outcome) { string sql = "insert into To_Outcome([outComeDate],[outComeItem],[outComeItemid],[outComeStatus],[comeUnit],[outComeMoney],[outComeBankName],[outComeBankId],[outComeBankAccount],[outComeDepart],[outComeDepartId],[makeName],[makeId],[makeDate],[remark]) values (@outComeDate,@outComeItem,@outComeItemid,@outComeStatus,@comeUnit,@outComeMoney,@outComeBankName,@outComeBankId,@outComeBankAccount,@outComeDepart,@outComeDepartId,@makeName,@makeId,@makeDate,@remark)"; SqlParameter[] sp = new SqlParameter[] { new SqlParameter("@outComeDate", outcome.OutComeDate), new SqlParameter("@outComeItem", outcome.OutComeItem), new SqlParameter("@outComeItemid", outcome.OutComeItemId), new SqlParameter("@outComeStatus", outcome.OutComeStatus), new SqlParameter("@comeUnit", outcome.ComeUnit), new SqlParameter("@outComeMoney", outcome.OutComeMoney), new SqlParameter("@outComeBankName", outcome.OutComeBankName), new SqlParameter("@outComeBankId", outcome.OutComeBankId), new SqlParameter("@outComeBankAccount", outcome.OutComeBankAccount), new SqlParameter("@outComeDepart", outcome.OutComeDepart), new SqlParameter("@outComeDepartId", outcome.OutComeDepartId), new SqlParameter("@makeName", outcome.MakeName), new SqlParameter("@makeId", outcome.MakeId), new SqlParameter("@makeDate", outcome.MakeDate), new SqlParameter("@remark", outcome.Remark) }; return(DBHelper.ExecuteCommand(sql, sp)); }
public static int Update(To_Outcome outcome) { string sql = "update To_Outcome set outComeDate=@outComeDate,outComeItem=@outComeItem,outComeItemid=@outComeItemid,outComeStatus=@outComeStatus,comeUnit=@comeUnit,outComeMoney=@outComeMoney,outComeBankName=@outComeBankName,outComeBankId=@outComeBankId,outComeBankAccount=@outComeBankAccount,outComeDepart=@outComeDepart,outComeDepartId=@outComeDepartId,makeName=@makeName,makeId=@makeId,makeDate=@makeDate,remark=@remark where id=@id"; SqlParameter[] sp = new SqlParameter[] { new SqlParameter("@id", outcome.ID), new SqlParameter("@outComeDate", outcome.OutComeDate), new SqlParameter("@outComeItem", outcome.OutComeItem), new SqlParameter("@outComeItemid", outcome.OutComeItemId), new SqlParameter("@outComeStatus", outcome.OutComeStatus), new SqlParameter("@comeUnit", outcome.ComeUnit), new SqlParameter("@outComeMoney", outcome.OutComeMoney), new SqlParameter("@outComeBankName", outcome.OutComeBankName), new SqlParameter("@outComeBankId", outcome.OutComeBankId), new SqlParameter("@outComeBankAccount", outcome.OutComeBankAccount), new SqlParameter("@outComeDepart", outcome.OutComeDepart), new SqlParameter("@outComeDepartId", outcome.OutComeDepartId), new SqlParameter("@makeName", outcome.MakeName), new SqlParameter("@makeId", outcome.MakeId), new SqlParameter("@makeDate", outcome.MakeDate), new SqlParameter("@remark", outcome.Remark) }; return(DBHelper.ExecuteCommand(sql, sp)); }
private int AddPayment() { LoginInfo currentUser = Session["login"] as LoginInfo; To_Outcome outcome = new To_Outcome(); outcome.OutComeDate = DateTime.Parse(this.txtFKDate.Text.Trim()); //付款日期 outcome.OutComeItem = this.ddlpayitem.SelectedItem.Text;; //付款类别 outcome.OutComeItemId = int.Parse(ddlpayitem.SelectedValue); //付款类别对应id outcome.OutComeMoney = double.Parse(this.txtPayMoney.Text); //付款金额 outcome.ComeUnit = this.txtSKUnit.Text.Trim(); //收款单位 outcome.OutComeBankName = this.ddlPayBank.SelectedItem.Text; //付款银行 outcome.OutComeBankId = int.Parse(this.ddlPayBank.SelectedValue); outcome.OutComeBankAccount = this.lblPayAccount.Text.Trim(); //付款帐号 outcome.OutComeDepart = this.ddlPayDepart.SelectedItem.Text; //所属部门 outcome.OutComeDepartId = int.Parse(this.ddlPayDepart.SelectedValue); //所属部门id outcome.Remark = this.txtMark.Value.Trim(); //备注 outcome.MakeName = currentUser.Cname; outcome.MakeId = currentUser.Id; outcome.MakeDate = DateTime.Now; outcome.OutComeStatus = this.payStatus.Checked ? "1" : "0"; int result = To_OutcomeManager.Add(outcome); return(result); }
private void Load_InititalData() { string id = Request.QueryString["id"]; if (!string.IsNullOrEmpty(id)) { To_Outcome outcome = To_OutcomeManager.GetModel(id); this.lblOutcomeDate.Text = outcome.OutComeDate.ToString("yyyy-MM-dd"); this.lblOutComeItem.Text = outcome.OutComeItem; this.lblOutcomeMoney.Text = outcome.OutComeMoney.ToString("0.00"); this.lblComeDepart.Text = outcome.ComeUnit; this.lblOutcomeBank.Text = outcome.OutComeBankName; this.lblOutcomeBankAccount.Text = outcome.OutComeBankAccount; this.lblOutcomeDepart.Text = outcome.OutComeDepart; this.LtrMark.Text = outcome.Remark; this.lblmakeName.Text = outcome.MakeName; this.lblmakeDate.Text = outcome.MakeDate.ToString("yyyy-MM-dd"); this.lblOutcomeStatus.Text = outcome.OutComeStatus == "1" ? "已支付" : "未支付"; } }
private int UpdatePayment() { string id = Request.QueryString["id"]; To_Outcome outcome = To_OutcomeManager.GetModel(id); outcome.OutComeDate = DateTime.Parse(this.txtFKDate.Text.Trim()); //付款日期 outcome.OutComeItem = this.ddlpayitem.SelectedItem.Text;; //付款类别 outcome.OutComeItemId = int.Parse(ddlpayitem.SelectedValue); //付款类别对应id outcome.OutComeMoney = double.Parse(this.txtPayMoney.Text); //付款金额 outcome.ComeUnit = this.txtSKUnit.Text.Trim(); //收款单位 outcome.OutComeBankName = this.ddlPayBank.SelectedItem.Text; //付款银行 outcome.OutComeBankId = int.Parse(this.ddlPayBank.SelectedValue); outcome.OutComeBankAccount = this.lblPayAccount.Text.Trim(); //付款帐号 outcome.OutComeDepart = this.ddlPayDepart.SelectedItem.Text; //所属部门 outcome.OutComeDepartId = int.Parse(this.ddlPayDepart.SelectedValue); //所属部门id outcome.Remark = this.txtMark.Value.Trim(); //备注 outcome.OutComeStatus = this.payStatus.Checked ? "1" : "0"; int result = To_OutcomeManager.Update(outcome); return(result); }
/// <summary> /// 加载初始信息 /// </summary> private void Load_InitialData() { Load_Bank(); Load_Depart(); BindOutComeType(); string id = Request.QueryString["id"]; if (!string.IsNullOrEmpty(id)) { To_Outcome outcome = To_OutcomeManager.GetModel(id); this.txtFKDate.Text = outcome.OutComeDate.ToString("yyyy-MM-dd"); this.ddlpayitem.SelectedValue = outcome.OutComeItemId.ToString(); this.txtPayMoney.Text = outcome.OutComeMoney.ToString("0.00"); this.txtSKUnit.Text = outcome.ComeUnit.ToString(); this.ddlPayBank.SelectedValue = outcome.OutComeBankId.ToString(); this.lblPayAccount.Text = outcome.OutComeBankAccount; this.ddlPayDepart.SelectedValue = outcome.OutComeDepartId.ToString(); this.txtMark.Value = outcome.Remark; this.lblMaker.Text = outcome.MakeName; this.lblMakeDate.Text = outcome.MakeDate.ToString("yyyy-MM-dd"); this.payStatus.Checked = outcome.OutComeStatus == "1" ? true : false; } }
public static int Update(To_Outcome outcome) { return(To_OutcomeService.Update(outcome)); }
/// <summary> /// 新增方法 /// </summary> /// <param name="outcome"></param> /// <returns></returns> public static int Add(To_Outcome outcome) { return(To_OutcomeService.Add(outcome)); }