123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- using System.Data;
- using PL.Base;
- using PL.UI.Controls;
- using FMS.ServiceList;
- using FMS.Entity;
- using FMS.UI;
- using System.Activities.Expressions;
- using System.Data.Common.CommandTrees;
- public partial class AppFms_ServiceMoudle_frmBdMoudleHeadEdit : BasePage
- {
- private string key
- {
- get { return this.hidKey.Value; }
- set { this.hidKey.Value = value; }
- }
- private string biztype
- {
- get { return this.hidBizType.Value; }
- set { this.hidBizType.Value = value; }
- }
- private string moudle
- {
- get { return this.hidMoudle.Value; }
- set { this.hidMoudle.Value = value; }
- }
- protected void Page_Load(object sender, EventArgs e)
- {
- if (!IsPostBack)
- {
- this.cboBizType.InitItems();//业务范畴
- this.cboMoudleType.InitItems();//模板类型
- this.key = PageHelper.Request("key");
- this.cboBizType.SelectedValue = PageHelper.Request("biztype");
- this.cboMoudleType.SelectedValue = PageHelper.Request("moudle");
- this.biztype = PageHelper.Request("biztype");
- this.moudle = PageHelper.Request("moudle");
- this.gvData.Columns[2].HeaderText = (this.moudle == "M01" ? "应收服务" : "应付服务");
- //this.cboServiceId.InitItems();
- if (this.key.HasValue())
- {
- LoadRecord();
- }
- else
- {
- this.btnAdd.Enabled = false;
- }
- }
- }
- private void LoadRecord()
- {
- EciRequest request = new EciRequest(FMSService.BdMoudleHeadLoad);
- request.Key = this.key;
- EciResponse response = SOA.Execute(request);
- BD_MOUDLE_HEAD data = response.DataTable.ToEntity<BD_MOUDLE_HEAD>();
- this.Bind(data);
- EciRequest requestBody = new EciRequest(FMSService.BdMoudleBodyLoad);
- request.Key = this.key;
- EciResponse responseBody = SOA.Execute(request);
- BD_MOUDLE_BODY dataBody = response.DataTable.ToEntity<BD_MOUDLE_BODY>();
- this.Bind(dataBody);
- }
- protected void btnSave_Click(object sender, EventArgs e)
- {
- EciRequest request = new EciRequest(FMSService.BdMoudleHeadSave);
- request.IsAdd = this.key.NullOrEmpty();
- BD_MOUDLE_HEAD saveEntity = new BD_MOUDLE_HEAD();
- request.Entity = saveEntity;
- saveEntity.Data = this.GetEntityFromUI().Data;
- saveEntity.GUID = this.key;
- EciResponse response = SOA.Execute(request);
- BD_MOUDLE_HEAD data = response.Entity.Upgrade<BD_MOUDLE_HEAD>();
- if (request.IsAdd)
- {
- this.key = data.GUID;
- this.btnAdd.Enabled = true;
- //this.txtCreateDate.Text = DateTime.Now.ToFullString();
- //this.txtCreateUser.Text = this.UserInfo.UserName;
- }
- //this.txtUpdateDate.Text = DateTime.Now.ToFullString();
- //this.txtUpdateUser.Text = this.UserInfo.UserName;
- response.Message.Tip();
- }
- protected void btnDelete2_Click(object sender, EventArgs e)
- {
- Button btn = sender as Button;
- string key = btn.CommandArgument;
- EciRequest request = new EciRequest(FMSService.BdMoudleBodyDelete);
- request.ListKey = new List<string>() { key };
- SOA.Execute(request);
- EAlert.Tip("删除执行成功");
- //this.Search();
- }
- /// <summary>
- ///
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- protected void gvData_RowDataBound(object sender, GridViewRowEventArgs e)
- {
- if (e.Row.RowType == DataControlRowType.DataRow)
- {
- //string SERVICE_ID = this.moudle=="M01"?e.Row.FromKey("SERVICE_ID").Text="应收服务":"应付服务";
- ECombox cboServiceId = (ECombox)e.Row.FindControl("cboServiceId");
- EChoose txtCustomName = (EChoose)e.Row.FindControl("txtCustomName");
- ECombox cboReceiveStandardId = (ECombox)e.Row.FindControl("cboReceiveStandardId");
- ETextBox txtReceivePrice = (ETextBox)e.Row.FindControl("txtReceivePrice");
- EChoose txtReceiveCurrId = (EChoose)e.Row.FindControl("txtReceiveCurrId");
- ETextBox txtReceiveMin = (ETextBox)e.Row.FindControl("txtReceiveMin");
- ETextBox txtReceiveMax = (ETextBox)e.Row.FindControl("txtReceiveMax");
- ECombox cboDecimalLength = (ECombox)e.Row.FindControl("cboDecimalLength");
- ECombox cboReceiveMantissaTypeId = (ECombox)e.Row.FindControl("cboReceiveMantissaTypeId");
- cboServiceId.Condition = "BIZ_FLAG=" + this.biztype;
- cboServiceId.InitItems();
- cboReceiveStandardId.InitItems();
- cboDecimalLength.InitItems();
- cboReceiveMantissaTypeId.InitItems();
- }
- }
- /// <summary>
- /// 新增
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- protected void btnAdd_Click(object sender, EventArgs e)
- {
- //默认结算方
- DataTable dt = this.gvData.DataTable(true);
- for (int i = 0; i <1; i++)
- {
- DataRow dr = dt.NewRow();
- //默认状态(草稿)
- dr["HEAD_GUID"] = this.key;
- dr["SERVICE_ID"] = this.biztype;
- dt.Rows.Add(dr);
- }
- this.gvData.EDataSource = dt;
- int rowNum = dt.Rows.Count;
- HtmlWindow.Onload("setFocus(" + rowNum + ")");
- }
- }
|