| | |
| | | using DevExpress.XtraGrid.Views.Grid; |
| | | using DevExpress.XtraGrid.Views.Grid.ViewInfo; |
| | | using Gs.DevApp.Entity; |
| | | using Gs.DevApp.ToolBox; |
| | | using MES.Service.Modes; |
| | | using Newtonsoft.Json; |
| | | using Newtonsoft.Json.Linq; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Data; |
| | | using System.Drawing; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using System.Windows.Forms; |
| | | using DevExpress.XtraEditors; |
| | | using DevExpress.XtraEditors.Controls; |
| | | using DevExpress.XtraGrid.Views.Grid; |
| | | using Gs.DevApp.DevFrm.QC.Models; |
| | | using Gs.DevApp.Entity; |
| | | using Gs.DevApp.ToolBox; |
| | | using Newtonsoft.Json; |
| | | using Newtonsoft.Json.Linq; |
| | | |
| | | namespace Gs.DevApp.DevFrm |
| | | namespace Gs.DevApp.DevFrm.QC |
| | | { |
| | | public partial class Frm_MesSysLookups : DevExpress.XtraEditors.XtraForm |
| | | public partial class Frm_MesSysLookups : XtraForm |
| | | { |
| | | string _webServiceName = "MesSysLookupTypesManager/"; |
| | | List<FilterEntity> _filterList = new List<FilterEntity>(); |
| | | private readonly string _webServiceName = "MesSysLookupTypesManager/"; |
| | | private List<FilterEntity> _filterList = new List<FilterEntity>(); |
| | | |
| | | public Frm_MesSysLookups() |
| | | { |
| | | InitializeComponent(); |
| | | this.toolBarMenu1.btnAddClick += ToolBarMenu1_btnAddClick; |
| | | this.toolBarMenu1.btnEdtClick += ToolBarMenu1_btnEdtClick; |
| | | this.toolBarMenu1.btnSaveClick += ToolBarMenu1_btnSaveClick; |
| | | this.toolBarMenu1.btnLoadClick += ToolBarMenu1_btnLoadClick; |
| | | this.toolBarMenu1.btnDelClick += ToolBarMenu1_btnDelClick1; |
| | | this.toolBarMenu1.btnEscClick += ToolBarMenu1_btnEscClick; |
| | | this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick; |
| | | gcMain.MouseDoubleClick += GcMain_MouseDoubleClick; |
| | | getPageList(1, UtilityHelper.GetPageSize()); |
| | | toolBarMenu1.btnEdtClick += ToolBarMenu1_btnEdtClick; |
| | | toolBarMenu1.btnSaveClick += ToolBarMenu1_btnSaveClick; |
| | | toolBarMenu1.btnLoadClick += ToolBarMenu1_btnLoadClick; |
| | | toolBarMenu1.btnEscClick += ToolBarMenu1_btnEscClick; |
| | | toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick; |
| | | toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick; |
| | | this.toolBarMenu1.getXmlConfig(); |
| | | Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx( gvMx1); |
| | | Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1,picCheckBox, this, "checkStatus", "", (value) => |
| | | { |
| | | Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 0); |
| | | }); |
| | | Gs.DevApp.ToolBox.UtilityHelper.SetTabParameter(gridView1, xtraTabControl1, pageBar1, (value) => |
| | | { |
| | | getModel(value); |
| | | }, (value) => |
| | | { |
| | | getPageList(this.pageBar1.CurrentPage); |
| | | }, lbGuid); |
| | | getPageList(1); |
| | | pageBar1.PagerEvent += PageBar1_PagerEvent; |
| | | gridView1.CustomDrawRowIndicator += (s, e) => |
| | | { |
| | | if (e.Info.IsRowIndicator && e.RowHandle >= 0) |
| | | { |
| | | e.Info.DisplayText = (e.RowHandle + 1).ToString(); |
| | | } |
| | | }; |
| | | gridView1.CustomDrawEmptyForeground += (s, e) => |
| | | { |
| | | string str = "暂未查找到匹配的数据!"; |
| | | Font f = new Font("微软雅黑", 16); |
| | | Rectangle r = new Rectangle(gridView1.GridControl.Width / 2 - 100, e.Bounds.Top + 45, e.Bounds.Right - 5, e.Bounds.Height - 5); |
| | | e.Graphics.DrawString(str, f, Brushes.Gray, r); |
| | | }; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 双击事件 |
| | | /// </summary> |
| | | /// <param name="sender"></param> |
| | | /// <param name="e"></param> |
| | | private void GcMain_MouseDoubleClick(object sender, MouseEventArgs e) |
| | | { |
| | | string rowGuid = Gs.DevApp.ToolBox.UtilityHelper.GetCurrentDoubleRow(gridView1, e, "guid"); |
| | | if (!string.IsNullOrEmpty(rowGuid)) |
| | | getModel(rowGuid, false, 999); |
| | | } |
| | | /// <summary> |
| | | /// 分页事件 |
| | | /// 分页事件 |
| | | /// </summary> |
| | | /// <param name="curPage"></param> |
| | | /// <param name="pageSize"></param> |
| | | private void PageBar1_PagerEvent(int curPage, int pageSize) |
| | | { |
| | | getPageList(curPage, pageSize); |
| | | getPageList(curPage); |
| | | } |
| | | /// <summary> |
| | | /// 查询事件 |
| | | /// 反审核 |
| | | /// </summary> |
| | | /// <param name="sender"></param> |
| | | /// <param name="e"></param> |
| | | private void ToolBarMenu1_btnQueryClick(object sender, EventArgs e) |
| | | /// <exception cref="NotImplementedException"></exception> |
| | | private void ToolBarMenu1_btnFChkClick(object sender, EventArgs e) |
| | | { |
| | | Gs.DevApp.UserControl.ShowFilter frm = new Gs.DevApp.UserControl.ShowFilter(gridView1.Columns, _filterList); |
| | | frm.UpdateParent += Frm_UpdateParent; |
| | | frm.ShowDialog(); |
| | | } |
| | | /// <summary> |
| | | /// 查询回调 |
| | | /// </summary> |
| | | /// <param name="sender"></param> |
| | | /// <param name="e"></param> |
| | | private void Frm_UpdateParent(object sender, UpdateParentEventArgs e) |
| | | { |
| | | _filterList = e.FilterList; |
| | | getPageList(1, pageBar1.RowsCount); |
| | | _toolCk(0); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 取消事件 |
| | | /// 审核事件 |
| | | /// </summary> |
| | | /// <param name="sender"></param> |
| | | /// <param name="e"></param> |
| | | private void ToolBarMenu1_btnChkClick(object sender, EventArgs e) |
| | | { |
| | | _toolCk(1); |
| | | } |
| | | /// <summary> |
| | | /// 取消事件 |
| | | /// </summary> |
| | | /// <param name="sender"></param> |
| | | /// <param name="e"></param> |
| | | private void ToolBarMenu1_btnEscClick(object sender, EventArgs e) |
| | | { |
| | | UtilityHelper.JumpToTab(xtraTabControl1, 0); |
| | | Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 1); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 删除事件 |
| | | /// </summary> |
| | | /// <param name="sender"></param> |
| | | /// <param name="e"></param> |
| | | private void ToolBarMenu1_btnDelClick1(object sender, EventArgs e) |
| | | { |
| | | string rowGuid = "", rowName = ""; |
| | | // (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_billNo, gridView1); |
| | | if (string.IsNullOrEmpty(rowGuid)) |
| | | { |
| | | ToolBox.MsgHelper.Warning("请先选择你要操作的行!"); |
| | | return; |
| | | } |
| | | if (!MsgHelper.AskQuestion("你选择了【" + rowName + "】,确定删除吗?")) |
| | | return; |
| | | List<dynamic> lst = new List<dynamic>(); |
| | | lst.Add(rowGuid); |
| | | var _obj = lst; |
| | | try |
| | | { |
| | | string strJson = UtilityHelper.HttpPost("", _webServiceName + "DeleteModel", JsonConvert.SerializeObject(_obj)); |
| | | ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson); |
| | | if (_rtn.rtnCode > 0) |
| | | { |
| | | UtilityHelper.JumpToTab(xtraTabControl1, 0); |
| | | getPageList(1, UtilityHelper.GetPageSize()); |
| | | } |
| | | ToolBox.MsgHelper.Warning("提示:" + _rtn.rtnMsg); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | ToolBox.MsgHelper.Warning("提示:" + ex.Message); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 刷新事件 |
| | | /// 刷新事件 |
| | | /// </summary> |
| | | /// <param name="sender"></param> |
| | | /// <param name="e"></param> |
| | | private void ToolBarMenu1_btnLoadClick(object sender, EventArgs e) |
| | | { |
| | | UtilityHelper.JumpToTab(xtraTabControl1, 0); |
| | | getPageList(1, UtilityHelper.GetPageSize()); |
| | | if (xtraTabControl1.SelectedTabPageIndex == 1) |
| | | getModel(lbGuid.Text.Trim()); |
| | | else |
| | | { |
| | | //_filterList.Clear(); |
| | | //if (gridView1.ActiveFilter.Count > 0) |
| | | //{ |
| | | // gridView1.ColumnFilterChanged -= GridView1_ColumnFilterChanged; |
| | | // gridView1.ActiveFilter.Clear(); |
| | | // gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged; |
| | | //} |
| | | //getPageList(1); |
| | | getPageList(this.pageBar1.CurrentPage); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 修改事件 |
| | | /// 修改事件 |
| | | /// </summary> |
| | | /// <param name="sender"></param> |
| | | /// <param name="e"></param> |
| | | private void ToolBarMenu1_btnEdtClick(object sender, EventArgs e) |
| | | { |
| | | string rowGuid = "", rowName = ""; |
| | | // (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_billNo, gridView1); |
| | | (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, |
| | | lbGuid, txt_lookupTypeCode, gridView1); |
| | | if (string.IsNullOrEmpty(rowGuid)) |
| | | { |
| | | ToolBox.MsgHelper.Warning("请先选择你要操作的行!"); |
| | | MsgHelper.Warning("请先选择你要操作的行!"); |
| | | return; |
| | | } |
| | | getModel(rowGuid, true, 1); |
| | | Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 3); |
| | | if (xtraTabControl1.SelectedTabPageIndex == 1) |
| | | { |
| | | getModel(rowGuid); |
| | | } |
| | | else |
| | | { |
| | | var gvList = new List<GridView>(); |
| | | gvList.Add(gvMx1); |
| | | UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, true,gvList); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 新增事件 |
| | | /// </summary> |
| | | /// <param name="sender"></param> |
| | | /// <param name="e"></param> |
| | | private void ToolBarMenu1_btnAddClick(object sender, EventArgs e) |
| | | { |
| | | UtilityHelper.JumpToTab(xtraTabControl1, 1); |
| | | lbGuid.Text = ""; |
| | | List<DevExpress.XtraGrid.Views.Grid.GridView> gridViews = new List<DevExpress.XtraGrid.Views.Grid.GridView>(); |
| | | gridViews.Add(gvMx1); |
| | | UtilityHelper.CleanValueByControl(this.panel1.Controls, true, gridViews); |
| | | Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx1, gvMx1); |
| | | } |
| | | /// <summary> |
| | | /// 保存事件 |
| | | /// 保存事件 |
| | | /// </summary> |
| | | /// <param name="sender"></param> |
| | | /// <param name="e"></param> |
| | |
| | | toolBarMenu1.isSetBtn = false; |
| | | if (string.IsNullOrEmpty(txt_lookupTypeCode.Text.Trim())) |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.Warning("系统快码类型编码不能为空!"); |
| | | MsgHelper.Warning("系统快码类型编码不能为空!"); |
| | | txt_lookupTypeCode.Focus(); |
| | | return; |
| | | } |
| | | var _obj = new MesSysLookupTypes() |
| | | gvMx1.CloseEditor(); |
| | | gvMx1.PostEditor(); |
| | | gvMx1.UpdateCurrentRow(); |
| | | var lst = new List<MesSysLookups>(); |
| | | for (var i = 0; i < gvMx1.DataRowCount; i++) |
| | | { |
| | | Guid = (lbGuid.Text.Trim().Length > 0 ? Guid.Parse(lbGuid.Text.Trim()) : Guid.Empty), |
| | | var row = gvMx1.GetDataRow(i); |
| | | if (row != null) |
| | | lst.Add(new MesSysLookups |
| | | { |
| | | Guid = UtilityHelper.ToGuid(row["Guid"].ToString()), |
| | | LookupName = row["LookupName"].ToString(), |
| | | LookupValue = row["LookupValue"].ToString() |
| | | }); |
| | | } |
| | | |
| | | var _obj = new MesSysLookupTypes |
| | | { |
| | | Guid = UtilityHelper.ToGuid(lbGuid.Text.Trim()), |
| | | LookupTypeCode = txt_lookupTypeCode.Text, |
| | | LookupTypeName = txt_lookupTypeName.Text, |
| | | list = lst |
| | | }; |
| | | try |
| | | { |
| | | string strJson = UtilityHelper.HttpPost("", _webServiceName + "EditModel", JsonConvert.SerializeObject(_obj)); |
| | | ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson); |
| | | ToolBox.MsgHelper.Warning("提示:" + _rtn.rtnMsg); |
| | | var strJson = UtilityHelper.HttpPost("", |
| | | _webServiceName + "EditModel", |
| | | JsonConvert.SerializeObject(_obj)); |
| | | var _rtn = |
| | | UtilityHelper.ReturnToDynamic(strJson); |
| | | MsgHelper.Warning("提示:" + _rtn.rtnMsg); |
| | | if (_rtn.rtnCode > 0) |
| | | { |
| | | lbGuid.Text = _rtn.rtnData; |
| | | toolBarMenu1.isSetBtn = true; |
| | | UtilityHelper.ChangeEnableByControl(this.panel1.Controls, false); |
| | | var gridViews = new List<GridView>(); |
| | | gridViews.Add(gvMx1); |
| | | UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, false, |
| | | gridViews); |
| | | toolBarMenu1.currentAction = ""; |
| | | Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 6); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | ToolBox.MsgHelper.Warning("提示:" + ex.Message); |
| | | MsgHelper.Warning("提示:" + ex.Message); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | /// <param name="curPage">第几页</param> |
| | | /// <param name="pageSize">每页几条</param> |
| | | private void getPageList(int curPage, int pageSize) |
| | | private void getPageList(int curPage) |
| | | { |
| | | System.Text.StringBuilder _sbSqlWhere = new System.Text.StringBuilder(); |
| | | foreach (FilterEntity itm in _filterList) |
| | | { |
| | | _sbSqlWhere.Append(" and " + itm.fileId + itm.fileOper + "'" + itm.fileValue + "'"); |
| | | } |
| | | PageQueryModel pgq = new PageQueryModel(curPage, pageSize, "create_date", "asc", "", _sbSqlWhere.ToString()); |
| | | string json = JsonConvert.SerializeObject(pgq); |
| | | System.Text.StringBuilder _sbSqlWhere = new StringBuilder(UtilityHelper.GetSearchWhere(_filterList)); |
| | | _sbSqlWhere.Append("and LOOKUP_TYPE_CODE = 'QATOOLS'"); |
| | | var pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "create_date", "asc", "", _sbSqlWhere.ToString()); |
| | | var json = JsonConvert.SerializeObject(pgq); |
| | | try |
| | | { |
| | | string strReturn = UtilityHelper.HttpPost("", _webServiceName + "GetListPage", json); |
| | | ReturnModel<PageListModel> dd = UtilityHelper.ReturnToTablePage(strReturn); |
| | | DataTable dt = dd.rtnData.list; |
| | | gcMain.BindingContext = new BindingContext(); |
| | | gcMain.DataSource = dt; |
| | | gcMain.ForceInitialize(); |
| | | int dddd = dd.rtnData.pages;//总页 |
| | | pageBar1.TotalPages = dddd; |
| | | pageBar1.RecordCount = dd.rtnData.total;//记录总数 |
| | | pageBar1.CurrentPage = curPage;//当前页 |
| | | pageBar1.RowsCount = pageSize;//每页显示 |
| | | pageBar1.setTxt(); |
| | | var strReturn = UtilityHelper.HttpPost("", |
| | | _webServiceName + "GetListPage", json); |
| | | var dd = UtilityHelper.ReturnToTablePage(strReturn); |
| | | if (dd.rtnCode > 0) |
| | | { |
| | | DataTable dt = dd.rtnData.list; |
| | | gcMain1.BindingContext = new BindingContext(); |
| | | if (dt.Rows.Count > 0) |
| | | { |
| | | gcMain1.DataSource = dt; |
| | | gcMain1.ForceInitialize(); |
| | | gridView1.BestFitColumns(); |
| | | } |
| | | else |
| | | UtilityHelper.SetDefaultTable(gcMain1, gridView1); |
| | | pageBar1.TotalPages = dd.rtnData.pages;//总页 |
| | | pageBar1.CurrentPage = curPage;//当前页 |
| | | pageBar1.RecordCount = dd.rtnData.total;//总记录数 |
| | | } |
| | | else |
| | | { |
| | | ToolBox.MsgHelper.ShowError("提示:" + dd.rtnMsg); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | ToolBox.MsgHelper.Warning("提示:" + ex.Message); |
| | | MsgHelper.Warning("提示:" + ex.Message); |
| | | } |
| | | } |
| | | private void getModel(string strGuid, bool isEdit, int tabIdx) |
| | | |
| | | private void getModel(string strGuid) |
| | | { |
| | | bool isEdit = false; |
| | | if (toolBarMenu1.currentAction == "add") return; |
| | | if (toolBarMenu1.currentAction == "edit") isEdit = true; |
| | | if (string.IsNullOrEmpty(strGuid)) |
| | | { |
| | | ToolBox.MsgHelper.Warning("请先选择你要操作的行!"); |
| | | MsgHelper.Warning("请先选择你要操作的行!"); |
| | | return; |
| | | } |
| | | UtilityHelper.JumpToTab(xtraTabControl1, tabIdx); |
| | | var _obj = new |
| | | { |
| | | guid = strGuid,//主建 |
| | | guid = strGuid //主建 |
| | | }; |
| | | try |
| | | { |
| | | string strJson = UtilityHelper.HttpPost("", _webServiceName +"GetModel", JsonConvert.SerializeObject(_obj)); |
| | | ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson); |
| | | var strJson = UtilityHelper.HttpPost("", |
| | | _webServiceName + "GetModel", |
| | | JsonConvert.SerializeObject(_obj)); |
| | | var _rtn = |
| | | UtilityHelper.ReturnToDynamic(strJson); |
| | | if (_rtn.rtnCode > 0) |
| | | { |
| | | dynamic dy = _rtn.rtnData; |
| | | var dy = _rtn.rtnData; |
| | | lbGuid.Text = strGuid; |
| | | List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>(); |
| | | var gvList = new List<GridView>(); |
| | | gvList.Add(gvMx1); |
| | | UtilityHelper.SetValueByObj(this.panel1.Controls, dy, isEdit, gvList); |
| | | JObject _job = JObject.Parse(strJson); |
| | | JArray array = new JArray(); |
| | | foreach (var a in _job["rtnData"]["list"]) |
| | | { |
| | | array.Add(a); |
| | | } |
| | | DataTable dt = JsonConvert.DeserializeObject<DataTable>(array.ToString()); |
| | | UtilityHelper.SetValueByObj(this.layoutMx1.Controls, dy, isEdit, gvList); |
| | | var _job = JObject.Parse(strJson); |
| | | var array = new JArray(); |
| | | foreach (var a in _job["rtnData"]["list"]) array.Add(a); |
| | | |
| | | var dt = |
| | | JsonConvert.DeserializeObject<DataTable>( |
| | | array.ToString()); |
| | | if (dt.Rows.Count > 0) |
| | | { |
| | | gcMx1.BindingContext = new BindingContext(); |
| | |
| | | } |
| | | else |
| | | { |
| | | Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx1, gvMx1); |
| | | UtilityHelper.SetDefaultTable(gcMx1, |
| | | gvMx1); |
| | | } |
| | | } |
| | | else |
| | | ToolBox.MsgHelper.Warning("提示:" + _rtn.rtnMsg); |
| | | { |
| | | MsgHelper.Warning("提示:" + _rtn.rtnMsg); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | ToolBox.MsgHelper.Warning("提示:" + ex.Message); |
| | | MsgHelper.Warning("提示:" + ex.Message); |
| | | } |
| | | } |
| | | |
| | | private void repositoryItemButtonEdit1_ButtonClick(object sender, |
| | | ButtonPressedEventArgs e) |
| | | { |
| | | gvMx1.CloseEditor(); |
| | | gvMx1.PostEditor(); |
| | | gvMx1.UpdateCurrentRow(); |
| | | var rowhandle = gvMx1.FocusedRowHandle; |
| | | if (rowhandle < 0) |
| | | return; |
| | | if (e.Button.Index == 0) |
| | | { |
| | | var dr = gvMx1.GetDataRow(rowhandle); |
| | | var mxGuid = dr["guid"].ToString(); |
| | | if (!MsgHelper.AskQuestion("你选择了1条数据,确定删除吗?")) |
| | | return; |
| | | if (string.IsNullOrEmpty(mxGuid)) |
| | | { |
| | | gvMx1.DeleteRow(rowhandle); |
| | | return; |
| | | } |
| | | var strJson = ""; |
| | | var lst = new List<string>(); |
| | | lst.Add(mxGuid); |
| | | try |
| | | { |
| | | strJson = UtilityHelper.HttpPost("", |
| | | _webServiceName + "DeleteModelMx", |
| | | JsonConvert.SerializeObject(lst)); |
| | | var _rtn = |
| | | UtilityHelper.ReturnToDynamic(strJson); |
| | | if (_rtn.rtnCode > 0) getModel(lbGuid.Text); |
| | | |
| | | MsgHelper.Warning("提示:" + _rtn.rtnMsg); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MsgHelper.Warning("提示:" + ex.Message); |
| | | } |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// 工具条事件 |
| | | /// </summary> |
| | | /// <param name="inFieldValue"></param> |
| | | private void _toolCk(int _inFieldValue) |
| | | { |
| | | string strMsg = ""; |
| | | switch (_inFieldValue) |
| | | { |
| | | case 1: |
| | | strMsg = "审核"; |
| | | break; |
| | | case 0: |
| | | strMsg = "反审核"; |
| | | break; |
| | | }; |
| | | toolBarMenu1.guidKey = ""; |
| | | string rowGuid, rowName; |
| | | (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_lookupTypeName, gridView1, "lookupTypeName"); |
| | | if (string.IsNullOrEmpty(rowGuid)) |
| | | { |
| | | MsgHelper.Warning("请先选择你要操作的行!"); |
| | | return; |
| | | } |
| | | if (!MsgHelper.AskQuestion("你选择了【" + rowName + "】,确定" + strMsg + "吗?")) |
| | | return; |
| | | |
| | | var _obj = new |
| | | { |
| | | guid = rowGuid, |
| | | ckValue = _inFieldValue, |
| | | parameter = "MES_SYS_LOOKUP_TYPES,check_date,check_status,check_by" |
| | | }; |
| | | try |
| | | { |
| | | var strJson = UtilityHelper.HttpPost("", "General/GeneralCheck", |
| | | JsonConvert.SerializeObject(_obj)); |
| | | var _rtn = UtilityHelper.ReturnToDynamic(strJson); |
| | | MsgHelper.Warning(_rtn.rtnData.outMsg.ToString()); |
| | | if (_rtn.rtnCode > 0) |
| | | { |
| | | if (xtraTabControl1.SelectedTabPageIndex == 1) |
| | | getModel(lbGuid.Text.Trim()); |
| | | else |
| | | getPageList(this.pageBar1.CurrentPage); |
| | | UtilityHelper.SetCheckIco(gridView1, "checkStatus", "checkBy", "checkDate", picCheckBox, this, _inFieldValue.ToString()); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MsgHelper.Warning("提示:" + ex.Message); |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | } |