Beispiel #1
0
 public void Update_View()
 {
     DepotHandleNsTalk talk = new DepotHandleNsTalk();
     Protocol pro = talk.Get_All_Depot(ClientInfo.session);
     if (pro.protoType == ProtoType.SUCCESS)
     {
         List<string> names = new List<string>();
         names.Add("ID");
         names.Add("仓库名称");
         this.dataGridView1.DataSource = TableDataUtil.convertListListDataToDataTable(names, pro.data);
         if (isCanEdit)
         {
             foreach (DataGridViewRow row in this.dataGridView1.Rows)
             {
                 row.ContextMenuStrip = this.contextMenuStrip1;
             }
         }
     }
 }
Beispiel #2
0
        private void Show_Depot_Frame(bool isCanEdit)
        {
            D_Show_Form form = new D_Show_Form(isCanEdit);
            DepotHandleNsTalk talk = new DepotHandleNsTalk();
            this.AddOwnedForm(form);
            form.Show();
            Protocol pro = talk.Get_All_Depot(ClientInfo.session);
            if (pro.protoType == ProtoType.SUCCESS)
            {
                List<string> names = new List<string>();
                names.Add("ID");
                names.Add("仓库名称");
                form.dataGridView1.DataSource = TableDataUtil.convertListListDataToDataTable(names, pro.data);
                if (isCanEdit)
                {
                    foreach (DataGridViewRow row in form.dataGridView1.Rows)
                    {
                        row.ContextMenuStrip = form.contextMenuStrip1;
                    }
                }

            }
            else if (pro.protoType == ProtoType.OUT_OF_TIME)
            {
                MessageBox.Show("系统超时,请重新登录");
                LoginForm lg = new LoginForm();
                lg.Show();
                this.Hide();
            }
            else if (pro.protoType == ProtoType.ERROR)
            {
                MessageBox.Show("获取信息错误,请重新获取");
            }
        }