bug
lu
7 天以前 d5e5d25e25799fb798648819fe18a5a429e30beb
DevApp/Gs.DevApp/DevFrm/PDA/Frm_UserBind.cs
@@ -24,6 +24,8 @@
            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1);
            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx2);
            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx3);
            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx4);
            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx5);
            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, null, null, "", "", (value) =>
            {
                Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 0);
@@ -38,9 +40,14 @@
            getPageList(1);
            pageBar1.PagerEvent += PageBar1_PagerEvent;
        }
        /// <summary>
        /// 从数据库进行搜索
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void GridView1_ColumnFilterChanged(object sender, EventArgs e)
        {
            Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns, gridView1);
            _filterList = Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns, gridView1);
            Task.Delay(100);
            getPageList(1);
        }
@@ -145,7 +152,7 @@
            }
            catch (Exception ex)
            {
                MsgHelper.Warning("提示:" + ex.Message);
                MsgHelper.ShowError("提示:" + ex.Message);
            }
        }
@@ -157,7 +164,7 @@
            if (toolBarMenu1.currentAction == "edit") isEdit = true;
            if (string.IsNullOrEmpty(strGuid))
            {
                MsgHelper.Warning("请先选择你要操作的行!");
                MsgHelper.ShowError("请先选择你要操作的行!");
                return;
            }
            var _obj = new
@@ -177,6 +184,8 @@
                    gvList.Add(gvMx1);
                    gvList.Add(gvMx2);
                    gvList.Add(gvMx3);
                    gvList.Add(gvMx4);
                    gvList.Add(gvMx5);
                    UtilityHelper.SetValueByObj(this.layoutMx1.Controls, dy, isEdit, gvList);
                    JObject _job = JObject.Parse(strJson);
                    JArray array = new JArray();
@@ -221,7 +230,7 @@
                        array3.Add(a);
                    }
                    DataTable dt3 = JsonConvert.DeserializeObject<DataTable>(array3.ToString());
                    if (dt2.Rows.Count > 0)
                    if (dt3.Rows.Count > 0)
                    {
                        gcMx3.BindingContext = new BindingContext();
                        gcMx3.DataSource = dt3;
@@ -233,15 +242,53 @@
                    {
                        Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx3, gvMx3);
                    }
                    JArray array4 = new JArray();
                    foreach (var a in _job["rtnData"]["list4"])
                    {
                        array4.Add(a);
                    }
                    DataTable dt4 = JsonConvert.DeserializeObject<DataTable>(array4.ToString());
                    if (dt4.Rows.Count > 0)
                    {
                        gcMx4.BindingContext = new BindingContext();
                        gcMx4.DataSource = dt4;
                        gcMx4.ForceInitialize();
                        gvMx4.BestFitColumns();
                        Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gvMx4);
                    }
                    else
                    {
                        Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx4, gvMx4);
                    }
                    JArray array5= new JArray();
                    foreach (var a in _job["rtnData"]["list5"])
                    {
                        array5.Add(a);
                    }
                    DataTable dt5 = JsonConvert.DeserializeObject<DataTable>(array5.ToString());
                    if (dt5.Rows.Count > 0)
                    {
                        gcMx5.BindingContext = new BindingContext();
                        gcMx5.DataSource = dt5;
                        gcMx5.ForceInitialize();
                        gvMx5.BestFitColumns();
                        Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gvMx5);
                    }
                    else
                    {
                        Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx5, gvMx5);
                    }
                }
                else
                {
                    MsgHelper.Warning("提示:" + _rtn.rtnMsg);
                    MsgHelper.ShowError("提示:" + _rtn.rtnMsg);
                }
            }
            catch (Exception ex)
            {
                MsgHelper.Warning("提示:" + ex.Message);
                MsgHelper.ShowError("提示:" + ex.Message);
            }
        }
@@ -295,7 +342,44 @@
                frm.ShowDialog();
            }
        }
        /// <summary>
        /// 过站时绑定线体
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void repositoryItemButtonEdit1_ButtonClick(object sender, ButtonPressedEventArgs e)
        {
            if (e.Button.Index == 0)
            {
                var rowhandle = gridView1.FocusedRowHandle;
                var dr = gridView1.GetDataRow(rowhandle);
                var userGuid = dr["guid"].ToString();
                var frm = new SelectLine(userGuid);
                frm.ShowDialog();
            }
        }
        /// <summary>
        /// 绑定组织
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void repositoryItemButtonEdit5_ButtonClick(object sender, ButtonPressedEventArgs e)
        {
            if (e.Button.Index == 0)
            {
                var rowhandle = gridView1.FocusedRowHandle;
                var dr = gridView1.GetDataRow(rowhandle);
                var userGuid = dr["guid"].ToString();
                var frm = new SelectZZ(userGuid);
                frm.ShowDialog();
            }
        }
        #region MyRegion
        #endregion
        #region 各种删除
        /// <summary>
        /// 删除pda
        /// </summary>
@@ -323,7 +407,30 @@
        {
            delBind(e, gvMx3);
        }
        /// <summary>
        /// 删除线体
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void repositoryItemButtonEdit6_ButtonClick(object sender, ButtonPressedEventArgs e)
        {
            delBind(e, gvMx4);
        }
        /// <summary>
        /// 删除组织
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void repositoryItemButtonEdit7_ButtonClick(object sender, ButtonPressedEventArgs e)
        {
            delBind(e, gvMx5);
        }
        /// <summary>
        /// 删除各种绑定
        /// </summary>
        /// <param name="e"></param>
        /// <param name="gv"></param>
        private void delBind(ButtonPressedEventArgs e, DevExpress.XtraGrid.Views.Grid.GridView gv)
        {
            var rowhandle = gv.FocusedRowHandle;
@@ -347,18 +454,22 @@
                    var _rtn = UtilityHelper.ReturnToDynamic(strJson);
                    if (_rtn.rtnCode > 0)
                    {
                        if (_rtn.rtnCode > 0)
                        {
                            getModel(lbGuid.Text.Trim());
                        }
                        MsgHelper.ShowInformation("提示:" + _rtn.rtnMsg);
                        getModel(lbGuid.Text.Trim());
                    }
                    MsgHelper.Warning("提示:" + _rtn.rtnMsg);
                    else
                        MsgHelper.ShowError("提示:" + _rtn.rtnMsg);
                }
                catch (Exception ex)
                {
                    MsgHelper.Warning("提示:" + ex.Message);
                    MsgHelper.ShowError("提示:" + ex.Message);
                }
            }
        }
        #endregion
    }
}