| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- using com.hnshituo.pur.vo;
- using Infragistics.Win.UltraWinEditors;
- using CoreFS.CA06;using Pur.Entity;
- using Core.Mes.Client.Comm.Control;
- using Pur.require_plan;
- using Pur.Pop_upWindow;
- using Pur.Entity;
- namespace Pur.Balance
- {
- public partial class FrmPurCicpPrice : FrmPmsBase
- {
- public FrmPurCicpPrice()
- {
- InitializeComponent();
- }
- private void FrmPurCicpPrice_Load(object sender, EventArgs e)
- {
- clearEdtArea();
- QureyCicpPriceM();
- }
- #region toolbar工具栏
- //toolbar工具栏加载
- public override void ToolBar_Click(object sender, string ToolBarKey)
- {
- switch (ToolBarKey)
- {
- case "Query"://查询基价标准主表数据
- QureyCicpPriceM();
- //GetQueryPhysicWH();
- break;
- case "Add"://增加基价标准主表
- AddCicpPriceM();
- break;
- case "Update"://修改基价标准主表
- EditCicpPriceM();
- break;
- case "Delete"://删除基价标准主表
- DeleteCicpPriceM();
- break;
- case "AddCicpPriceC": //新增基价标准明细表
- AddCicpPriceC();
- break;
- case "UpdateCicpPriceC"://修改基价标准明细表
- EditCicpPriceC();
- break;
- case "DeleteCicpPriceC"://删除基价标准明细表
- DeleteCicpPriceC();
- break;
- case "Close"://关闭窗口
- this.Close();
- break;
- }
- }
- #endregion
- #region toolbar事件
- /// <summary>
- /// 删除一条明细
- /// </summary>
- private void DeleteCicpPriceC()
- {
- try
- {
- //判断是否获取到焦点
- if (ultraGrid2.ActiveRow != null)
- {
- string oldstrid = ultraGrid2.ActiveRow.Cells["id"].Value.ToString().Trim();
- string oldstrstandid = ultraGrid2.ActiveRow.Cells["standId"].Value.ToString().Trim();
- string oldchemcode = ultraGrid2.ActiveRow.Cells["chemCode"].Value.ToString().Trim(); ;
- //提示是否需要修改
- if (MessageBox.Show("将修改明细表ID为[" + oldstrid + "]的信息?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
- {
- //构建实体类
- BalanceCicpriceC pc = new BalanceCicpriceC();
- pc.Validflag = "0";
- pc.Id = oldstrid;
- pc.ChemCode = oldchemcode;
- pc.DeleteName = CoreFS.SA06.CoreUserInfo.UserInfo.GetUserName();
- pc.DeleteTime = DateTime.Now;
- pc.DeleteUserid = CoreFS.SA06.CoreUserInfo.UserInfo.GetUserID();
- //调用服务接口
- CoreResult re = this.execute<CoreResult>("com.hnshituo.pur.balance.service.BalanceCicpriceCService", "doUpdateCicpPriceC", new object[] { pc });
- if (re.Resultcode == 0)
- {
- //DataTable tempData = (DataTable)re.Resultdata;
- //GridHelper.CopyDataToDatatable(ref re.Resultdata, ref dataTable1, true);
- MessageBox.Show("删除成功", "提示");
- QureyCicpPriceM();
- BalanceClassCommon.doActiveSelRow(ultraGrid1, "id", oldstrstandid);
- }
- else
- {
- MessageBox.Show("操作失败:" + re.Resultmsg, "提示");
- return;
- }
- }
- }
- else
- {
- MessageBox.Show("操作失败:请选择需修改的成分计价标准行", "提示");
- return;
- }
- }
- catch (Exception ex)
- {
- MessageBox.Show("操作失败:" + ex.Message, "提示");
- }
- }
- private void EditCicpPriceC()
- {
- try
- {
- //判断是否获取到焦点
- if (ultraGrid2.ActiveRow != null)
- {
- string strid = ultraGrid2.ActiveRow.Cells["id"].Value.ToString().Trim();
- string strstandid = ultraGrid2.ActiveRow.Cells["standId"].Value.ToString().Trim();
- //获取编辑框信息
- // string strid = edtIdC.Text.ToString().Trim();
- string strchemCode = edtChemCode.Text.ToString().Trim();
- string strremark = edtRemarkC.Text.ToString().Trim();
- double dbaddSubtValue = (double)edtAddSubtValue.Value;
- //构建实体类
- BalanceCicpriceC pc = new BalanceCicpriceC();
- //校验编辑框信息
- if (edtup.Checked)
- {
- if (edtmaxVal.Value == null || edtMaxSign.Value==null)
- {
- MessageBox.Show("上限符号和上限值不能为空","提升");
- edtmaxVal.Focus();
- return;
- }
- else
- {
- pc.MaxVal = (double)edtmaxVal.Value;
- pc.MaxSign = edtMaxSign.Text;
- }
- }
- if (edtdown.Checked)
- {
- if(edtMinVal.Value==null||edtMinSign.Value==null)
- {
- MessageBox.Show("下限符号和下限值不能为空","提升");
- edtMinVal.Focus();
- return;
- }
- else
- {
- pc.MinVal = (double)edtMinVal.Value;
- pc.MinSign = edtMinSign.Text;
- }
- }
- if (edtup.Checked && edtdown.Checked)
- {
- double ii = (double)edtMinVal.Value;
- double jj = (double)edtmaxVal.Value;
- if (ii > jj)
- {
- MessageBox.Show("上限不能小于下限", "提示");
- edtmaxVal.Focus();
- return;
- }
- }
- if (string.IsNullOrEmpty(strid))
- {
- MessageBox.Show("操作失败:ID不能为空", "提示");
- edtId.Focus();
- return;
- }
- if (string.IsNullOrEmpty(strstandid))
- {
- MessageBox.Show("操作失败:标准号为空", "提示");
- edtStandId.Focus();
- return;
- }
- if (string.IsNullOrEmpty(strchemCode))
- {
- MessageBox.Show("操作失败:元素编号为空", "提示");
- edtChemCode.Focus();
- return;
- }
- if (edtAddSubtValue.Value == null || edtAddSubtValue.Value.ToString()=="")
- {
- MessageBox.Show("操作失败:请输入加减额度", "提示");
- edtAddSubtValue.Focus();
- return;
- }
- //提示是否需要修改
- if (MessageBox.Show("将修改明细表ID为[" + strid + "]的信息?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
- {
- pc.Id = strid;
- pc.StandId=strstandid;
- pc.Remark = strremark;
- pc.Validflag = "1";
- pc.ChemCode = strchemCode;
- pc.AddSubtValue = dbaddSubtValue;
- pc.UpdateName = CoreFS.SA06.CoreUserInfo.UserInfo.GetUserName();
- pc.UpdateTime = DateTime.Now;
- pc.UpdateUserid = CoreFS.SA06.CoreUserInfo.UserInfo.GetUserID();
- //调用服务接口
- CoreResult re = this.execute<CoreResult>("com.hnshituo.pur.balance.service.BalanceCicpriceCService", "doUpdateCicpPriceC", new object[] { pc });
- if (re.Resultcode == 0)
- {
- //DataTable tempData = (DataTable)re.Resultdata;
- //GridHelper.CopyDataToDatatable(ref re.Resultdata, ref dataTable1, true);
- MessageBox.Show("修改成功", "提示");
- QureyCicpPriceM();
- BalanceClassCommon.doActiveSelRow(ultraGrid1, "id", strstandid);
- BalanceClassCommon.doActiveSelRow(ultraGrid2, "id", strid);
- }
- else
- {
- MessageBox.Show("操作失败:" + re.Resultmsg, "提示");
- return;
- }
- }
- }
- else
- {
- MessageBox.Show("操作失败:请选择需修改的基价标准明细行", "提示");
- return;
- }
- }
- catch (Exception ex)
- {
- MessageBox.Show("操作失败:" + ex.Message, "提示");
- }
- }
- private void AddCicpPriceC()
- {
- try
- {
- //判断是否获取到焦点
- if (ultraGrid1.ActiveRow != null)
- {
- string strstandid = ultraGrid1.ActiveRow.Cells["id"].Value.ToString().Trim();
- //获取编辑框信息
- string strchemCode = edtChemCode.Text.ToString().Trim();
- string strchemname=edtChemName.Text.ToString().Trim();
- string strremark = edtRemarkC.Text.ToString().Trim();
- double dbaddSubtValue = (double)edtAddSubtValue.Value;
- //构建实体类
- BalanceCicpriceC pc = new BalanceCicpriceC();
- //校验编辑框信息
- if (edtup.Checked)
- {
- if (edtmaxVal.Value == null || edtMaxSign.Value==null)
- {
- MessageBox.Show("上限符号和上限值不能为空","提升");
- edtmaxVal.Focus();
- return;
- }
- else
- {
- pc.MaxVal = (double)edtmaxVal.Value;
- pc.MaxSign = edtMaxSign.Text;
- }
- }
- if (edtdown.Checked)
- {
- if(edtMinVal.Value==null||edtMinSign.Value==null)
- {
- MessageBox.Show("下限符号和下限值不能为空","提升");
- edtMinVal.Focus();
- return;
- }
- else
- {
- pc.MinVal = (double)edtMinVal.Value;
- pc.MinSign = edtMinSign.Text;
- }
- }
- if (edtup.Checked && edtdown.Checked)
- {
- if ((double)edtMinVal.Value > (double)edtmaxVal.Value)
- {
- MessageBox.Show("上限不能小于下限", "提示");
- edtmaxVal.Focus();
- return;
- }
- }
- if (string.IsNullOrEmpty(strstandid))
- {
- MessageBox.Show("操作失败:标准号为空", "提示");
- edtStandId.Focus();
- return;
- }
- if (string.IsNullOrEmpty(strchemCode))
- {
- MessageBox.Show("操作失败:元素编号为空", "提示");
- edtChemCode.Focus();
- return;
- }
- if (edtAddSubtValue.Value == null || edtAddSubtValue.Value.ToString()=="")
- {
- MessageBox.Show("操作失败:请输入加减额度", "提示");
- edtAddSubtValue.Focus();
- return;
- }
- //提示是否需要修改
- if (MessageBox.Show("将新增元素为[" + strchemname + "]的一条明细信息?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
- {
- pc.StandId = strstandid;
- pc.Remark = strremark;
- pc.Validflag = "1";
- pc.ChemCode = strchemCode;
- pc.AddSubtValue = dbaddSubtValue;
- pc.CreateName = CoreFS.SA06.CoreUserInfo.UserInfo.GetUserName();
- pc.CreateTime = DateTime.Now;
- pc.CreateUserid = CoreFS.SA06.CoreUserInfo.UserInfo.GetUserID();
- //调用服务接口
- CoreResult re = this.execute<CoreResult>("com.hnshituo.pur.balance.service.BalanceCicpriceCService", "doAddCicpPriceC", new object[] { pc });
- if (re.Resultcode == 0)
- {
- //DataTable tempData = (DataTable)re.Resultdata;
- //GridHelper.CopyDataToDatatable(ref re.Resultdata, ref dataTable1, true);
- MessageBox.Show("新增成功", "提示");
- QureyCicpPriceM();
- BalanceClassCommon.doActiveSelRow(ultraGrid1, "id", strstandid);
- BalanceClassCommon.doActiveSelRow(ultraGrid2, "chemCode", strchemCode);
- }
- else
- {
- MessageBox.Show("操作失败:" + re.Resultmsg, "提示");
- return;
- }
- }
- }
- else
- {
- MessageBox.Show("操作失败:请选择需新增的基价标准行", "提示");
- return;
- }
- }
- catch (Exception ex)
- {
- MessageBox.Show("操作失败:" + ex.Message, "提示");
- }
- }
- /// <summary>
- /// 删除一条成分计价标准主表行信息
- /// </summary>
- private void DeleteCicpPriceM()
- {
- try
- {
- //判断是否获取到焦点
- if (ultraGrid1.ActiveRow != null)
- {
- string strId = ultraGrid1.ActiveRow.Cells["Id"].Value.ToString().Trim();
- string strname = ultraGrid1.ActiveRow.Cells["name"].Value.ToString().Trim();
- string stritemcode = ultraGrid1.ActiveRow.Cells["itemCode"].Value.ToString().Trim();
- //提示是否需要修改
- if (MessageBox.Show("将删除名称为[" + strname + "]的成分计价标准信息?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
- {
- //构建实体类
- BalanceCicpriceM pm = new BalanceCicpriceM();
- pm.Validflag = "0";
- pm.Id = strId;
- pm.ItemCode = stritemcode;
- pm.DeleteName = CoreFS.SA06.CoreUserInfo.UserInfo.GetUserName();
- pm.DeleteTime = DateTime.Now;
- pm.DeleteUserid = CoreFS.SA06.CoreUserInfo.UserInfo.GetUserID();
- //调用服务接口
- CoreResult re = this.execute<CoreResult>("com.hnshituo.pur.balance.service.BalanceCicpriceMService", "doUpdateCicpPriceM", new object[] { pm });
- if (re.Resultcode == 0)
- {
- //DataTable tempData = (DataTable)re.Resultdata;
- //GridHelper.CopyDataToDatatable(ref re.Resultdata, ref dataTable1, true);
- MessageBox.Show("删除成功", "提示");
- QureyCicpPriceM();
- }
- else
- {
- MessageBox.Show("操作失败:" + re.Resultmsg, "提示");
- return;
- }
- }
- }
- else
- {
- MessageBox.Show("操作失败:请选择需删除的成分计价标准行", "提示");
- return;
- }
- }
- catch (Exception ex)
- {
- MessageBox.Show("操作失败:" + ex.Message, "提示");
- }
- }
- /// <summary>
- /// 编辑成分计价标准行信息
- /// </summary>
- private void EditCicpPriceM()
- {
- try
- {
- //判断是否获取到焦点
- if (ultraGrid1.ActiveRow != null)
- {
- string oldstrid = ultraGrid1.ActiveRow.Cells["id"].Value.ToString().Trim();
- string oldstrname = ultraGrid1.ActiveRow.Cells["name"].Value.ToString().Trim();
- //获取编辑框信息
- string strname = edtName.Text.ToString().Trim();
- string stritemCode = edtItemCode.Text.ToString().Trim();
- string strremark = edtRemark.Text.ToString().Trim();
- string stritemattrId = edtItemAttrId.Text.ToString().Trim();
- //校验编辑框信息
- if (string.IsNullOrEmpty(oldstrid))
- {
- MessageBox.Show("操作失败:ID不能为空", "提示");
- edtId.Focus();
- return;
- }
- if (string.IsNullOrEmpty(strname))
- {
- MessageBox.Show("操作失败:名称不能为空", "提示");
- edtName.Focus();
- return;
- }
- if (string.IsNullOrEmpty(stritemCode))
- {
- MessageBox.Show("操作失败:请选择物料", "提示");
- edtItemCode.Focus();
- return;
- }
- //提示是否需要修改
- if (MessageBox.Show("将修改名称为[" + oldstrname + "]的成分计价标准信息?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
- {
- //构建实体类
- BalanceCicpriceM pm = new BalanceCicpriceM();
- pm.Id = oldstrid;
- pm.Name = strname;
- pm.ItemCode = stritemCode;
- pm.ItemAttrId = stritemattrId;
- pm.Remark = strremark;
- pm.Validflag = "1";
- pm.UpdateName = CoreFS.SA06.CoreUserInfo.UserInfo.GetUserName();
- pm.UpdateTime = DateTime.Now;
- pm.UpdateUserid = CoreFS.SA06.CoreUserInfo.UserInfo.GetUserID();
- //调用服务接口
- CoreResult re = this.execute<CoreResult>("com.hnshituo.pur.balance.service.BalanceCicpriceMService", "doUpdateCicpPriceM", new object[] { pm });
- if (re.Resultcode == 0)
- {
- //DataTable tempData = (DataTable)re.Resultdata;
- //GridHelper.CopyDataToDatatable(ref re.Resultdata, ref dataTable1, true);
- MessageBox.Show("修改成功", "提示");
- QureyCicpPriceM();
- BalanceClassCommon.doActiveSelRow(ultraGrid1, "id", oldstrid);
- }
- else
- {
- MessageBox.Show("操作失败:" + re.Resultmsg, "提示");
- return;
- }
- }
- }
- else
- {
- MessageBox.Show("操作失败:请选择需修改的成分计价标准行", "提示");
- return;
- }
- }
- catch (Exception ex)
- {
- MessageBox.Show("操作失败" + ex.Message, "提示");
- }
- }
- /// <summary>
- /// 新增一条基价标准主表行信息
- /// </summary>
- private void AddCicpPriceM()
- {
- try
- {
- //获取编辑框信息
- string strname = edtName.Text.ToString().Trim();
- string stritemCode = edtItemCode.Text.ToString().Trim();
- string strremark = edtRemark.Text.ToString().Trim();
- string stritemattrId = edtItemAttrId.Text.ToString().Trim();
- //校验编辑框信息
- if (string.IsNullOrEmpty(strname))
- {
- MessageBox.Show("操作失败:名称不能为空", "提示");
- edtName.Focus();
- return;
- }
- if (string.IsNullOrEmpty(stritemCode))
- {
- MessageBox.Show("操作失败:请选择物料", "提示");
- edtItemCode.Focus();
- return;
- }
- //构建实体类
- BalanceCicpriceM pm = new BalanceCicpriceM();
- pm.Name = strname;
- pm.ItemCode = stritemCode;
- pm.ItemAttrId=stritemattrId;
- pm.Remark = strremark;
- pm.Validflag = "1";
- pm.CreateName = CoreFS.SA06.CoreUserInfo.UserInfo.GetUserName();
- pm.CreateTime = DateTime.Now;
- pm.CreateUserid = CoreFS.SA06.CoreUserInfo.UserInfo.GetUserID();
- //调用服务接口
- CoreResult re = this.execute<CoreResult>("com.hnshituo.pur.balance.service.BalanceCicpriceMService", "doAddCicpPriceM", new object[] { pm });
- if (re.Resultcode == 0)
- {
- //DataTable tempData = (DataTable)re.Resultdata;
- //GridHelper.CopyDataToDatatable(ref re.Resultdata, ref dataTable1, true);
- MessageBox.Show("新增成功", "提示");
- QureyCicpPriceM();
- BalanceClassCommon.doActiveSelRow(ultraGrid1, "name", strname);
- }
- else
- {
- MessageBox.Show("操作失败:" + re.Resultmsg, "提示");
- return;
- }
- }
- catch (Exception ex)
- {
- MessageBox.Show("操作失败:" + ex.Message, "提示");
- }
- }
- /// <summary>
- /// 查询主表数据
- /// </summary>
- private void QureyCicpPriceM()
- {
- try
- {
- //获取查询框数据
- string strid = QId.Text.ToString().Trim();
- string strname = Qname.Text.ToString().Trim();
- //构建查询实体类
- BalanceCicpriceM pm = new BalanceCicpriceM();
- pm.Id = strid;
- pm.ItemName = strname;
- //调用服务器查询API进行查询
- DataTable re = this.execute<DataTable>("com.hnshituo.pur.balance.service.BalanceCicpriceMService", "doQureyCicpPriceM", new object[] { pm });
- GridHelper.CopyDataToDatatable(ref re, ref dataTable1, true);
-
- }
- catch (Exception ex)
- {
- MessageBox.Show("操作失败:" + ex.Message, "提示");
- }
- }
- #endregion
- #region 页面点击事件
- private void ultraGrid1_AfterRowActivate(object sender, EventArgs e)
- {
- try
- {
- //加载数据到编辑区
- string strid = ultraGrid1.ActiveRow.Cells["id"].Value.ToString().Trim();
- string strname = ultraGrid1.ActiveRow.Cells["name"].Value.ToString().Trim();
- string stritemCode = ultraGrid1.ActiveRow.Cells["itemCode"].Value.ToString().Trim();
- string stritemName = ultraGrid1.ActiveRow.Cells["itemName"].Value.ToString().Trim();
- string strremark = ultraGrid1.ActiveRow.Cells["remark"].Value.ToString().Trim();
- string stritemAttr = ultraGrid1.ActiveRow.Cells["itemAttr"].Value.ToString().Trim();
- string stritemAttrId = ultraGrid1.ActiveRow.Cells["itemAttrId"].Value.ToString().Trim();
- edtId.Text = strid;
- edtName.Text = strname;
- edtItemCode.Text = stritemCode;
- edtItemName.Text = stritemName;
- edtRemark.Text = strremark;
- edtItemAttr.Text = stritemAttr;
- edtItemAttrId.Text = stritemAttrId;
- //获取页面点击行的ID
- if (string.IsNullOrEmpty(strid))
- {
- MessageBox.Show("操作失败:获取的ID为空", "提示");
- }
- //构建实体类
- BalanceCicpriceC pc = new BalanceCicpriceC();
- pc.StandId = strid;
- pc.Validflag = "1";
- //调用服务器查询API进行查询
- DataTable re = this.execute<DataTable>("com.hnshituo.pur.balance.service.BalanceCicpriceCService", "doQureyCicpPriceC", new object[] { pc });
- GridHelper.CopyDataToDatatable(ref re, ref dataTable2, true);
- }
- catch (Exception ex)
- {
- MessageBox.Show("操作失败:" + ex.Message, "提示");
- }
- }
- private void ultraGrid2_AfterRowActivate(object sender, EventArgs e)
- {
- try
- {
- //加载数据到编辑区
- string strid = ultraGrid2.ActiveRow.Cells["id"].Value.ToString().Trim();
- string strremark = ultraGrid2.ActiveRow.Cells["remark"].Value.ToString().Trim();
- string strstandId = ultraGrid2.ActiveRow.Cells["standId"].Value.ToString().Trim();
- string strmaxsign = ultraGrid2.ActiveRow.Cells["maxSign"].Value.ToString().Trim();
- string strminsign = ultraGrid2.ActiveRow.Cells["minSign"].Value.ToString().Trim();
- if (ultraGrid2.ActiveRow.Cells["minVal"].Value == null)
- {
- edtMinVal.Value = null;
- }
- else
- {
- edtMinVal.Value =ultraGrid2.ActiveRow.Cells["minVal"].Value;
- }
- if(ultraGrid2.ActiveRow.Cells["maxVal"].Value == null)
- {
- edtmaxVal.Value = null;
- }
- else
- {
- edtmaxVal.Value = ultraGrid2.ActiveRow.Cells["maxVal"].Value;
- }
- if(ultraGrid2.ActiveRow.Cells["addSubtValue"].Value!=null)
- {
- edtAddSubtValue.Value=ultraGrid2.ActiveRow.Cells["addSubtValue"].Value;
- }
- else{
- MessageBox.Show("数据异常:明细表ID为"+strid+"的加减额度为空","提示");
- return;
- }
- string strchemCode = ultraGrid2.ActiveRow.Cells["chemCode"].Value.ToString().Trim();
- string strchemName = ultraGrid2.ActiveRow.Cells["chemName"].Value.ToString().Trim();
- edtIdC.Text = strid;
- edtRemarkC.Text = strremark;
- edtStandId.Text = strstandId;
- edtMaxSign.Text = strmaxsign;
- edtMinSign.Text = strminsign;
- edtChemCode.Text = strchemCode;
- edtChemName.Text = strchemName;
- //上限和下限是否可以判断
- if (strmaxsign == "" || strmaxsign == null)
- {
- edtup.Checked = false;
- }
- else
- {
- edtup.Checked = true;
- }
- if (strminsign == "" || strminsign == null)
- {
- edtdown.Checked = false;
- }
- else
- {
- edtdown.Checked = true;
- }
- }
- catch (Exception ex)
- {
- MessageBox.Show("操作失败:" + ex.Message, "提示");
- }
- }
-
- private void clearEdtArea()
- {
- foreach (Control ctr in ultraExpandableGroupBox1.Controls)
- {
- if (ctr is Label)
- { continue; }
- if (ctr is UltraCheckEditor)
- {
- UltraCheckEditor ultcmb = (UltraCheckEditor)ctr;
- ultcmb.Checked = false;
- }
- if (ctr is UltraComboEditor)
- {
- UltraComboEditor ultcmb = (UltraComboEditor)ctr;
- ultcmb.Text = "";
- ultcmb.Enabled = false;
- }
- if (ctr is CheckBox)
- {
- CheckBox cb = (CheckBox)ctr;
- cb.Checked = false;
-
- }
- ctr.Text = null;
- edtmaxVal.Enabled = false;
- edtMaxSign.Enabled = false;
- edtmaxVal.Value = null;
- edtMaxSign.Text = "";
- edtMinVal.Enabled = false;
- edtMinSign.Enabled = false;
- edtMinVal.Value = null;
- edtMinSign.Text = "";
- }
- }
- private void edtup_CheckedChanged(object sender, EventArgs e)
- {
- if (edtup.Checked)
- {
- edtmaxVal.Enabled = true;
- edtMaxSign.Enabled = true;
- }
- else
- {
- edtmaxVal.Enabled = false;
- edtMaxSign.Enabled = false;
- edtmaxVal.Value = null;
- edtMaxSign.Text = "";
- }
- }
- private void edtdown_CheckedChanged(object sender, EventArgs e)
- {
- if (edtdown.Checked)
- {
- edtMinVal.Enabled = true;
- edtMinSign.Enabled = true;
- }
- else
- {
- edtMinVal.Enabled = false;
- edtMinSign.Enabled = false;
- edtMinVal.Value = null;
- edtMinSign.Text = "";
- }
- }
- private void edtItemName_EditorButtonClick(object sender, EditorButtonEventArgs e)
- {
- FrmPurPlanMat matfrm = new FrmPurPlanMat(this.ob);
- matfrm.ShowDialog();
- string strmatcode = matfrm.getItemCode();
- string strmatname = matfrm.getItemName();
- string stritemAttr = matfrm.ItemAttr;
- string stritemAttrId = matfrm.ItemAttrId;
- edtItemCode.Text = strmatcode;
- edtItemName.Text = strmatname;
- edtItemAttr.Text = stritemAttr;
- edtItemAttrId.Text = stritemAttrId;
- }
- private void edtChemName_EditorButtonClick(object sender, EditorButtonEventArgs e)
- {
- FrmPop_upChem chemfrm = new FrmPop_upChem(this.ob);
- chemfrm.ShowDialog();
- string strchemcode = chemfrm.ChemCode;
- string strchemname = chemfrm.ChemName;
- edtChemCode.Text = strchemcode;
- edtChemName.Text = strchemname;
- }
- private void ultraGrid1_AfterCellActivate(object sender, EventArgs e)
- {
- ultraTabControl1.SelectedTab = ultraTabControl1.Tabs[0];
- }
- private void ultraGrid2_AfterCellActivate(object sender, EventArgs e)
- {
- ultraTabControl1.SelectedTab = ultraTabControl1.Tabs[1];
- }
- #endregion
- }
- }
|