/// <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.OtherOutInfo model = null; if (Utils.GetQueryStringValue("id") != "") { model = bll.GetOtherOutInfo(Utils.GetQueryStringValue("id")); } else { model = new EyouSoft.Model.FinanceStructure.OtherOutInfo(); } model.CompanyId = CurrentUserCompanyID; model.CustromCName = txt_com.Value; model.Item = txt_ziqu.Text; model.OperatorId = SiteUserInfo.ID; model.Remark = txt_Remarks.Value; model.Amount = Utils.GetDecimal(txt_money.Value); model.CreateTime = DateTime.Now; model.PayTime = Utils.GetDateTime(txt_date.Text); model.Payee = txt_sendUser.Text; model.PayType = (EyouSoft.Model.EnumType.TourStructure.RefundType)Utils.GetInt(Utils.GetFormValue(this.ddlPayType.ClientID)); model.AddAmount = Utils.GetDecimal(hd_addMoney.Value); model.ReduceAmount = Utils.GetDecimal(hd_subMoney.Value); model.TotalAmount = model.Amount + model.AddAmount - model.ReduceAmount; model.Status = model.Status = Utils.GetFormValue(this.ddlStatus.UniqueID).Trim() == "True";; if (Utils.GetQueryStringValue("id") != "") { int i = bll.UpdateOtherOut(model); if (i > 0) { 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"]; int i = bll.AddOtherOut(model); if (i > 0) { EyouSoft.Common.Function.MessageBox.ResponseScript(this, "javascript:alert('保存成功!');parent.Boxy.getIframeDialog('" + Request.QueryString["iframeid"] + "').hide();parent.window.location.reload();"); } } }
/// <summary> /// 绑定信息 /// </summary> /// <param name="id"></param> void BindInfo(string id) { EyouSoft.BLL.FinanceStructure.OtherCost bll = new EyouSoft.BLL.FinanceStructure.OtherCost(SiteUserInfo); EyouSoft.Model.FinanceStructure.OtherOutInfo model = bll.GetOtherOutInfo(id); txt_date.Text = model.PayTime.ToString("yyyy-MM-dd"); txt_sendUser.Text = model.Payee; txt_com.Value = model.CustromCName; txt_ziqu.Text = model.Item; txt_Remarks.Value = model.Remark; txt_money.Value = Utils.FilterEndOfTheZeroDecimal(model.Amount); hd_addMoney.Value = Utils.FilterEndOfTheZeroDecimal(model.AddAmount); hd_subMoney.Value = Utils.FilterEndOfTheZeroDecimal(model.ReduceAmount); DdlPayTypeInit(((int)model.PayType).ToString()); if (model.Status) { ddlStatus.SelectedIndex = 0; } else { ddlStatus.SelectedIndex = 1; } }