protected void lbtnSave_Click(object sender, EventArgs e) { string AddCash = this.txtAddCash.Value.Trim(); //补充现金 DateTime AddTime = DateTime.Now; //补充时间 string iframeId = Utils.GetQueryStringValue("IframeId"); EyouSoft.BLL.StatisticStructure.CompanyCashFlow CashFlowBll = new EyouSoft.BLL.StatisticStructure.CompanyCashFlow(this.SiteUserInfo); EyouSoft.Model.StatisticStructure.CompanyCashFlow Model = new EyouSoft.Model.StatisticStructure.CompanyCashFlow(); Model.IssueTime = AddTime; Model.OperatorId = this.SiteUserInfo.ID; Model.CompanyId = this.SiteUserInfo.CompanyID; Model.CashReserve = decimal.Parse(AddCash); Model.CashType = EyouSoft.Model.EnumType.StatisticStructure.CashType.现金储备; if (AddCash != "" && AddTime != null) { //调用保存方法 if (CashFlowBll.Add(Model)) { Utils.ShowMsgAndCloseBoxy("添加成功!", iframeId, true); } else { Utils.ShowMsgAndCloseBoxy("添加失败!", iframeId, false); } } else { Page.RegisterStartupScript("提示", Utils.ShowMsg("输入信息不完整,无法保存!")); } //释放资源 Model = null; CashFlowBll = null; }
/// <summary> /// 添加现金流量明细 /// </summary> /// <param name="model">现金流量明细实体</param> /// <returns>true:成功 false:失败</returns> public bool Add(EyouSoft.Model.StatisticStructure.CompanyCashFlow model) { if (model == null) { return(false); } return(idal.Add(model)); }
/// <summary> /// 添加 /// </summary> /// <param name="model">现金流量明细实体</param> /// <returns>true:成功 false:失败</returns> public bool Add(EyouSoft.Model.StatisticStructure.CompanyCashFlow model) { DbCommand dc = this._db.GetStoredProcCommand("proc_CompanyCashFlow_Add"); this._db.AddInParameter(dc, "CashReserve", DbType.Decimal, model.CashReserve); this._db.AddInParameter(dc, "CashType", DbType.Byte, (int)model.CashType); this._db.AddInParameter(dc, "CompanyId", DbType.Int32, model.CompanyId); this._db.AddInParameter(dc, "OperatorId", DbType.Int32, model.OperatorId); this._db.AddOutParameter(dc, "Result", DbType.Int32, 4); DbHelper.RunProcedure(dc, this._db); object obj = this._db.GetParameterValue(dc, "Result"); if (obj == null) { return(false); } return(int.Parse(obj.ToString()) > 0 ? true : false); }