From b0cebba8ea5393c5de74f4b09078f7a4d3d3e8cf Mon Sep 17 00:00:00 2001 From: lu <99954486@qq.com> Date: 星期五, 13 十二月 2024 10:38:09 +0800 Subject: [PATCH] Merge branch 'master' of http://43.142.96.171:8080/r/~tjx/GsMesClient --- DevApp/Gs.DevApp/DevFrm/BasicData/Frm_MesWorkshop.cs | 547 ++++++++++++++++++++++++++++------------------------- 1 files changed, 289 insertions(+), 258 deletions(-) diff --git a/DevApp/Gs.DevApp/DevFrm/BasicData/Frm_MesWorkshop.cs b/DevApp/Gs.DevApp/DevFrm/BasicData/Frm_MesWorkshop.cs index 168372a..14dac7e 100644 --- a/DevApp/Gs.DevApp/DevFrm/BasicData/Frm_MesWorkshop.cs +++ b/DevApp/Gs.DevApp/DevFrm/BasicData/Frm_MesWorkshop.cs @@ -1,335 +1,197 @@ -using Gs.DevApp.Entity; -using Gs.DevApp.ToolBox; -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.Entity; +using Gs.DevApp.ToolBox; +using Gs.DevApp.UserControl; +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; namespace Gs.DevApp.DevFrm { - public partial class Frm_MesWorkshop : DevExpress.XtraEditors.XtraForm + public partial class Frm_MesWorkshop : XtraForm { - string _webServiceName = "MesWorkshopManager/"; - List<FilterEntity> _filterList = new List<FilterEntity>(); + private List<FilterEntity> _filterList = new List<FilterEntity>(); + private readonly string _webServiceName = "SysDepartmentManager/"; public Frm_MesWorkshop() { 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; - this.toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick; - this.toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick; + toolBarMenu1.btnEscClick += ToolBarMenu1_btnEscClick; + toolBarMenu1.btnEdtClick += ToolBarMenu1_btnEdtClick; + toolBarMenu1.btnSaveClick += ToolBarMenu1_btnSaveClick; + toolBarMenu1.btnLoadClick += ToolBarMenu1_btnLoadClick; + toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick; + toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick; + toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick; gcMain.MouseDoubleClick += GcMain_MouseDoubleClick; - getPageList(1, UtilityHelper.GetPageSize()); + Gs.DevApp.ToolBox.UtilityHelper.SetGridSear(gridView1, picCheckBox, this, "checkStatus", ""); + Gs.DevApp.ToolBox.UtilityHelper.SetGridSearMx(gvMx1); + 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); - }; + } + + private void GridView1_ColumnFilterChanged(object sender, EventArgs e) + { + _filterList = Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns); + Task.Delay(100); + getPageList(1); } /// <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"); + var rowGuid = + 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) { - Gs.DevApp.UserControl.ShowFilter frm = new Gs.DevApp.UserControl.ShowFilter(gridView1.Columns, _filterList); + gridView1.ColumnFilterChanged -= GridView1_ColumnFilterChanged; + gridView1.ActiveFilter.Clear(); + gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged; + var frm = new 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); - } - /// <summary> - /// 鍙嶅鏍� - /// </summary> - /// <param name="sender"></param> - /// <param name="e"></param> - /// <exception cref="NotImplementedException"></exception> - private void ToolBarMenu1_btnFChkClick(object sender, EventArgs e) - { - this.toolBarMenu1.guidKey = ""; - string rowGuid, rowName; - (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_name, gridView1); - this.toolBarMenu1.guidKey = rowGuid; - } - /// <summary> - /// 瀹℃牳浜嬩欢 - /// </summary> - /// <param name="sender"></param> - /// <param name="e"></param> - private void ToolBarMenu1_btnChkClick(object sender, EventArgs e) - { - this.toolBarMenu1.guidKey = ""; - string rowGuid, rowName; - (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_name, gridView1); - this.toolBarMenu1.guidKey = rowGuid; - } - /// <summary> - /// 鍙栨秷浜嬩欢 - /// </summary> - /// <param name="sender"></param> - /// <param name="e"></param> - private void ToolBarMenu1_btnEscClick(object sender, EventArgs e) - { - UtilityHelper.JumpToTab(xtraTabControl1, 0); + getPageList(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_name, gridView1); - if (string.IsNullOrEmpty(rowGuid)) - { - ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�"); - return; - } - if (!MsgHelper.AskQuestion("浣犻�夋嫨浜嗐��" + rowName + "銆戯紝纭畾鍒犻櫎鍚楋紵")) - return; - List<string> lst = new List<string>(); - 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()); - } - /// <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_name, gridView1); - if (string.IsNullOrEmpty(rowGuid)) + if (xtraTabControl1.SelectedTabPageIndex == 1) + getModel(lbGuid.Text.Trim(), false, 999); + else { - ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�"); - return; - } - getModel(rowGuid, true, 1); - } - /// <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> - private void ToolBarMenu1_btnSaveClick(object sender, EventArgs e) - { - toolBarMenu1.isSetBtn = false; - if (string.IsNullOrEmpty(txt_workshopNo.Text.Trim())) - { - Gs.DevApp.ToolBox.MsgHelper.Warning("缂栧彿涓嶈兘涓虹┖锛�"); - txt_workshopNo.Focus(); - return; - } - if (string.IsNullOrEmpty(txt_name.Text.Trim())) - { - Gs.DevApp.ToolBox.MsgHelper.Warning("鍚嶇О涓嶈兘涓虹┖锛�"); - txt_name.Focus(); - return; - } - gvMx1.CloseEditor(); - gvMx1.UpdateCurrentRow(); - List<dynamic> lst = new List<dynamic>(); - for (int i = 0; i < gvMx1.DataRowCount; i++) - { - DataRow row = gvMx1.GetDataRow(i); - if (row != null) + _filterList.Clear(); + if (gridView1.ActiveFilter.Count > 0) { - lst.Add(new - { - guid = row["guid"].ToString(), - lineNo = row["lineNo"].ToString(), - name = row["name"].ToString(), - remark = row["remark"].ToString(), - isStatus = row["isStatus"].ToString(), - }); + gridView1.ColumnFilterChanged -= GridView1_ColumnFilterChanged; + gridView1.ActiveFilter.Clear(); + gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged; } - } - var _obj = new - { - guid = lbGuid.Text.Trim(),//涓诲缓 - workshopNo = txt_workshopNo.Text.Trim(), - name = txt_name.Text.Trim(), - remark = txt_remark.Text.Trim(), - isStatus = txt_isStatus.Checked, - list = lst - }; - try - { - string strJson = UtilityHelper.HttpPost("", _webServiceName + "EditModel", JsonConvert.SerializeObject(_obj)); - ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson); - ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg); - if (_rtn.rtnCode > 0) - { - lbGuid.Text = _rtn.rtnData; - toolBarMenu1.isSetBtn = true; - List<DevExpress.XtraGrid.Views.Grid.GridView> gridViews = new List<DevExpress.XtraGrid.Views.Grid.GridView>(); - gridViews.Add(gvMx1); - UtilityHelper.ChangeEnableByControl(this.panel1.Controls, false, gridViews); - } - - } - catch (Exception ex) - { - ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message); + getPageList(1); } } /// <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); + var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList); + var pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "a.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; + gcMain.BindingContext = new BindingContext(); + gridView1.ColumnFilterChanged -= GridView1_ColumnFilterChanged; + if (dt.Rows.Count > 0) + { + gcMain.DataSource = dt; + gcMain.ForceInitialize(); + } + else + UtilityHelper.SetDefaultTable(gcMain, gridView1); + gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged; + 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) { 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> gridViews = new List<DevExpress.XtraGrid.Views.Grid.GridView>(); + var gridViews = new List<GridView>(); gridViews.Add(gvMx1); - UtilityHelper.SetValueByObj(this.panel1.Controls, dy, isEdit, gridViews); - JObject _job = JObject.Parse(strJson); - JArray array = new JArray(); + UtilityHelper.SetValueByObj(panel1.Controls, dy, isEdit, + gridViews); + var _job = JObject.Parse(strJson); + var array = new JArray(); var d = _job["rtnData"]["list"]; - foreach (var a in d) - { - array.Add(a); - } - DataTable dt = JsonConvert.DeserializeObject<DataTable>(array.ToString()); + foreach (var a in d) array.Add(a); + var dt = + JsonConvert.DeserializeObject<DataTable>( + array.ToString()); if (dt.Rows.Count > 0) { gcMx1.BindingContext = new BindingContext(); @@ -338,47 +200,216 @@ } 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, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) + /// <summary> + /// 鍙嶅鏍� + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> + /// <exception cref="NotImplementedException"></exception> + private void ToolBarMenu1_btnFChkClick(object sender, EventArgs e) { - int rowhandle = gvMx1.FocusedRowHandle; + _toolCk(0); + } + /// <summary> + /// 鍙栨秷浜嬩欢 + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> + private void ToolBarMenu1_btnEscClick(object sender, EventArgs e) + { + UtilityHelper.JumpToTab(xtraTabControl1, 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_btnEdtClick(object sender, EventArgs e) + { + string rowGuid = "", rowName = ""; + (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, + lbGuid, txt_departmentcode, gridView1); + if (string.IsNullOrEmpty(rowGuid)) + { + MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�"); + return; + } + getModel(rowGuid, true, 1); + } + + /// <summary> + /// 淇濆瓨浜嬩欢 + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> + private void ToolBarMenu1_btnSaveClick(object sender, EventArgs e) + { + toolBarMenu1.isSetBtn = false; + if (string.IsNullOrEmpty(txt_departmentcode.Text.Trim())) + { + MsgHelper.Warning("鍚嶇О涓嶈兘涓虹┖锛�"); + txt_departmentcode.Focus(); + return; + } + gvMx1.CloseEditor(); + gvMx1.UpdateCurrentRow(); + var lst = new List<dynamic>(); + for (var i = 0; i < gvMx1.DataRowCount; i++) + { + var row = gvMx1.GetDataRow(i); + if (row != null) + lst.Add(new + { + guid = UtilityHelper.ToGuid(row["guid"].ToString()), + lineNo = row["lineNo"].ToString(), + name = row["name"].ToString(), + remark = row["remark"].ToString(), + isStatus = row["isStatus"].ToString() + }); + } + + var _obj = new + { + guid = UtilityHelper.ToGuid(lbGuid.Text.Trim()), //涓诲缓 + list = lst + }; + try + { + 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; + var gridViews = new List<GridView>(); + gridViews.Add(gvMx1); + UtilityHelper.ChangeEnableByControl(panel1.Controls, false, + gridViews); + } + } + catch (Exception ex) + { + MsgHelper.Warning("鎻愮ず锛�" + ex.Message); + } + } + + private void repositoryItemButtonEdit1_ButtonClick(object sender, + ButtonPressedEventArgs e) + { + gvMx1.CloseEditor(); + gvMx1.UpdateCurrentRow(); + var rowhandle = gvMx1.FocusedRowHandle; if (rowhandle < 0) return; if (e.Button.Index == 0) { - DataRow dr = gvMx1.GetDataRow(rowhandle); - string mxGuid = dr["guid"].ToString(); + var dr = gvMx1.GetDataRow(rowhandle); + var mxGuid = dr["guid"].ToString(); if (!MsgHelper.AskQuestion("浣犻�夋嫨浜�1鏉℃暟鎹紝纭畾鍒犻櫎鍚楋紵")) return; - string strJson = ""; - List<string> lst = new List<string>(); + 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)); - ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson); - if (_rtn.rtnCode > 0) - { - getModel(lbGuid.Text, true, 1); - } - ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg); + strJson = UtilityHelper.HttpPost("", + _webServiceName + "DeleteModelMx", + JsonConvert.SerializeObject(lst)); + var _rtn = UtilityHelper.ReturnToDynamic(strJson); + if (_rtn.rtnCode > 0) getModel(lbGuid.Text, true, 1); + MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg); } catch (Exception ex) { - ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message); + 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_departmentname, gridView1, "departmentname"); + if (string.IsNullOrEmpty(rowGuid)) + { + MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�"); + return; + } + if (!MsgHelper.AskQuestion("浣犻�夋嫨浜嗐��" + rowName + "銆戯紝纭畾" + strMsg + "鍚楋紵")) + return; + + var _obj = new + { + guid = rowGuid, + ckValue = _inFieldValue, + parameter = "SYS_DEPARTMENT,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(), false, 999); + else + getPageList(1); + } + } + catch (Exception ex) + { + MsgHelper.Warning("鎻愮ず锛�" + ex.Message); + } + + } } } \ No newline at end of file -- Gitblit v1.9.3