wbc
9 天以前 94c437fea114e923bc5f9fb9c7145dd43e9b78e8
DevApp/Gs.DevApp/DevFrm/WOM/Frm_MesScrksqDj.cs
@@ -23,10 +23,16 @@
            toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick;
            toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick;
            toolBarMenu1.btnLogClick += ToolBarMenu1_btnLogClick;
            toolBarMenu1.btnChbgClick += ToolBarMenu1_btnChbgClick;
            //toolBarMenu1.btnChbgClick += ToolBarMenu1_btnChbgClick;
            this.toolBarMenu1.getXmlConfig();
            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx2);
            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1);
            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, null, null, null, "", (value) =>
            {
                Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 0);
            }, tips, true, (strGuid) => {
                getModelList(strGuid);
            });
            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, this, "checkStatus", "", (value) =>
            {
                Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 0);
@@ -109,10 +115,10 @@
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ToolBarMenu1_btnChbgClick(object sender, EventArgs e)
        {
            _toolChbg(1);
        }
        //private void ToolBarMenu1_btnChbgClick(object sender, EventArgs e)
        //{
        //    _toolChbg(1);
        //}
        /// <summary>
        ///     反审核
@@ -265,6 +271,71 @@
            }
        }
        private void getModelList(string strGuid)
        {
            gcMxL1.DataSource = null;
            gcMxL2.DataSource = null;
            var _obj = new
            {
                guid = strGuid,//主建
            };
            try
            {
                string strJson = UtilityHelper.HttpPost("", _webServiceName + "GetModel", JsonConvert.SerializeObject(_obj));
                ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson);
                if (_rtn.rtnCode > 0)
                {
                    dynamic dy = _rtn.rtnData;
                    JArray array1 = new JArray();
                    foreach (var a in dy["list"])
                    {
                        array1.Add(a);
                    }
                    DataTable dt1 = JsonConvert.DeserializeObject<DataTable>(array1.ToString());
                    if (dt1.Rows.Count > 0)
                    {
                        gcMxL1.BindingContext = new BindingContext();
                        gcMxL1.DataSource = dt1;
                        gcMxL1.ForceInitialize();
                        gvMxL1.BestFitColumns();
                        Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gvMxL1);
                    }
                    else
                    {
                        Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMxL1, gvMxL1);
                    }
                    JArray array2 = new JArray();
                    foreach (var a in dy["list2"])
                    {
                        array2.Add(a);
                    }
                    DataTable dt2 = JsonConvert.DeserializeObject<DataTable>(array2.ToString());
                    if (dt2.Rows.Count > 0)
                    {
                        gcMxL2.BindingContext = new BindingContext();
                        gcMxL2.DataSource = dt2;
                        gcMxL2.ForceInitialize();
                        gvMxL2.BestFitColumns();
                        Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gvMxL2);
                    }
                    else
                    {
                        Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMxL2, gvMxL2);
                    }
                }
                else
                    ToolBox.MsgHelper.Warning("提示:" + _rtn.rtnMsg);
            }
            catch (Exception ex)
            {
                ToolBox.MsgHelper.Warning("提示:" + ex.Message);
            }
        }
        /// <summary>
        /// 
        /// </summary>
@@ -311,51 +382,51 @@
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="inFieldValue"></param>
        private void _toolChbg(int _inFieldValue)
        {
            toolBarMenu1.guidKey = "";
            string rowGuid, rowName;
            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
                lbGuid, txt_billNo, gridView1, "billNo");
            toolBarMenu1.guidKey = rowGuid;
            if (string.IsNullOrEmpty(rowGuid))
            {
                MsgHelper.Warning("请先选择你要操作的行!");
                return;
            }
            if (!MsgHelper.AskQuestion("你选择了【" + rowName + "】,确定操作吗?"))
                return;
            var _obj = new
            {
                guid = rowGuid,
                billNo= rowName,
                inFieldValue = _inFieldValue
            };
            try
            {
                var strJson = UtilityHelper.HttpPost("", _webServiceName + "EditModelChbg", JsonConvert.SerializeObject(_obj));
                var _rtn = UtilityHelper.ReturnToDynamic(strJson);
                MsgHelper.Warning(_rtn.rtnData.outMsg.ToString());
                if (_rtn.rtnCode > 0 && _rtn.rtnData.outSum * 1 > 0)
                {
                    if (xtraTabControl1.SelectedTabPageIndex == 1)
                    {
                        getModel(lbGuid.Text.Trim());
                    }
                    int rowHandle = gridView1.LocateByValue(1, gridView1.Columns["guid"], rowGuid);
                    gridView1.FocusedRowHandle = rowHandle;
                    //UtilityHelper.SetCheckIco(gridView1, "checkStatus", "checkUser", "checkDate", picCheckBox, this, _inFieldValue.ToString());
                }
            }
                catch (Exception ex)
            {
                MsgHelper.Warning("提示:" + ex.Message);
            }
        }
        ///// <summary>
        /////
        ///// </summary>
        ///// <param name="inFieldValue"></param>
        //private void _toolChbg(int _inFieldValue)
        //{
        //    toolBarMenu1.guidKey = "";
        //    string rowGuid, rowName;
        //    (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
        //        lbGuid, txt_billNo, gridView1, "billNo");
        //    toolBarMenu1.guidKey = rowGuid;
        //    if (string.IsNullOrEmpty(rowGuid))
        //    {
        //        MsgHelper.Warning("请先选择你要操作的行!");
        //        return;
        //    }
        //    if (!MsgHelper.AskQuestion("你选择了【" + rowName + "】,确定操作吗?"))
        //        return;
        //    var _obj = new
        //    {
        //        guid = rowGuid,
        //        billNo= rowName,
        //        inFieldValue = _inFieldValue
        //    };
        //    try
        //    {
        //        var strJson = UtilityHelper.HttpPost("", _webServiceName + "EditModelChbg", JsonConvert.SerializeObject(_obj));
        //        var _rtn = UtilityHelper.ReturnToDynamic(strJson);
        //        MsgHelper.Warning(_rtn.rtnData.outMsg.ToString());
        //        if (_rtn.rtnCode > 0 && _rtn.rtnData.outSum * 1 > 0)
        //        {
        //            if (xtraTabControl1.SelectedTabPageIndex == 1)
        //            {
        //                getModel(lbGuid.Text.Trim());
        //            }
        //            int rowHandle = gridView1.LocateByValue(1, gridView1.Columns["guid"], rowGuid);
        //            gridView1.FocusedRowHandle = rowHandle;
        //            //UtilityHelper.SetCheckIco(gridView1, "checkStatus", "checkUser", "checkDate", picCheckBox, this, _inFieldValue.ToString());
        //        }
        //    }
        //        catch (Exception ex)
        //    {
        //        MsgHelper.Warning("提示:" + ex.Message);
        //    }
        //}
    }
}