/// <summary> /// 绑定信息 /// </summary> /// <param name="id"></param> void BindInfo(string id) { EyouSoft.BLL.FinanceStructure.OtherCost bll = new EyouSoft.BLL.FinanceStructure.OtherCost(SiteUserInfo); EyouSoft.Model.FinanceStructure.OtherIncomeInfo model = bll.GetOtherIncomeInfo(id); if (model != null) { txt_date.Text = model.PayTime.ToString("yyyy-MM-dd"); txt_com.Value = model.CustromCName; txt_ziqu.Text = model.Item; txt_sendUser.Text = model.Payee; SiteUserInfo.ID = model.OperatorId; txt_Remarks.Value = model.Remark; txt_money.Value = Utils.FilterEndOfTheZeroDecimal(model.TotalAmount); this.txtAddMoney.Value = model.AddAmount.ToString("0.00"); this.txtCutMoney.Value = model.ReduceAmount.ToString("0.00"); DdlPayTypeInit(((int)model.PayType).ToString()); if (model.Status) { ddlStatus.SelectedIndex = 0; } else { ddlStatus.SelectedIndex = 1; } } }
/// <summary> /// 按钮保存事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void lbtn_Submit_Click(object sender, EventArgs e) { EyouSoft.BLL.FinanceStructure.OtherCost bll = new EyouSoft.BLL.FinanceStructure.OtherCost(SiteUserInfo); EyouSoft.Model.FinanceStructure.OtherIncomeInfo model = null; #region 获取初始数据 if (Utils.GetQueryStringValue("id") != "") { model = bll.GetOtherIncomeInfo(Request.QueryString["id"]); if (model == null) { Utils.ShowAndRedirect("无该条记录信息!", Request.Url.ToString()); return; } } else { model = new EyouSoft.Model.FinanceStructure.OtherIncomeInfo(); } model.CompanyId = CurrentUserCompanyID; model.CustromCName = txt_com.Value; model.Item = txt_ziqu.Text; model.OperatorId = SiteUserInfo.ID; model.Remark = txt_Remarks.Value; model.CreateTime = DateTime.Now; model.PayTime = Utils.GetDateTime(this.txt_date.Text); model.Amount = Utils.GetDecimal(txt_money.Value); model.Payee = this.txt_sendUser.Text.Trim(); model.AddAmount = Utils.GetDecimal(this.txtAddMoney.Value); model.ReduceAmount = Utils.GetDecimal(this.txtCutMoney.Value); model.PayType = (EyouSoft.Model.EnumType.TourStructure.RefundType)Utils.GetInt(Utils.GetFormValue(this.ddlPayType.UniqueID)); model.TotalAmount = model.Amount + model.AddAmount - model.ReduceAmount; model.Status = Utils.GetFormValue(this.ddlStatus.UniqueID).Trim() == "True"; #endregion #region 提交数据库 if (Utils.GetQueryStringValue("id") != "") { model.IncomeId = Request.QueryString["id"]; bll.UpdateOtherIncome(model); EyouSoft.Common.Function.MessageBox.ResponseScript(this, "javascript:alert('修改成功!');parent.Boxy.getIframeDialog('" + Request.QueryString["iframeid"] + "').hide();parent.window.location.reload();"); } else { model.TourId = Request.QueryString["tourid"]; bll.AddOtherIncome(model); EyouSoft.Common.Function.MessageBox.ResponseScript(this, "javascript:alert('添加成功!');parent.Boxy.getIframeDialog('" + Request.QueryString["iframeid"] + "').hide();parent.window.location.reload();"); } #endregion }