private void G_Menu_Add_BackgroundWorkder( object sender, RunWorkerCompletedEventArgs e) { G_Add_Form form = new G_Add_Form(); StyleHandleNsTalk talk = new StyleHandleNsTalk(); Protocol pro = talk.Get_All_Style(ClientInfo.session); if (pro.protoType == ProtoType.SUCCESS) { List<string> dataSource = new List<string>(); List<List<string>> data = pro.data; foreach (List<string> list in data) { dataSource.Add(list[1]); } form.G_Style_tb.DataSource = dataSource; this.AddOwnedForm(form); form.Show(); } 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("获取信息错误,请重新获取"); } }
private void U_Register_BackgroundWorker( object sender, RunWorkerCompletedEventArgs e) { UserHandleNsTalk talk = new UserHandleNsTalk(); Protocol pro = talk.Fetch_Authority_Lists(ClientInfo.session); if (pro.protoType == ProtoType.SUCCESS) { U_Register_Form rf = new U_Register_Form(); this.AddOwnedForm(rf); List<string> source = new List<string>(); foreach (List<string> ls in pro.data) { source.Add(ls[0]); } rf.L_Name_Box.DataSource = source; rf.Show(); } 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("获取信息错误,请重新获取"); } }
private void U_Modify_BackgroundWorker( object sender, RunWorkerCompletedEventArgs e) { UserHandleNsTalk talk = new UserHandleNsTalk(); Protocol pro = talk.Get_All_User_Info(ClientInfo.session); if (pro.protoType == ProtoType.SUCCESS) { OpenUShowForm(pro, true); } 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("获取信息错误,请重新获取"); } }
private void Show_Style_Frame(bool flag) { StyleHandleNsTalk talk = new StyleHandleNsTalk(); Protocol pro = talk.Get_All_Style(ClientInfo.session); if (pro.protoType == ProtoType.SUCCESS) { S_Show_Form show_frame = new S_Show_Form(flag); this.AddOwnedForm(show_frame); show_frame.Show(); List<string> names= new List<string>(); names.Add("ID"); names.Add("货物种类"); show_frame.dataGridView1.DataSource = TableDataUtil.convertListListDataToDataTable(names, pro.data); if (flag) { foreach (DataGridViewRow row in show_frame.dataGridView1.Rows) { row.ContextMenuStrip = show_frame.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("获取信息错误,请重新获取"); } }
private void Show_Goods_Frame(bool flag) { G_Show_Form form = new G_Show_Form(flag); GoodsHandleNsTalk talk = new GoodsHandleNsTalk(); this.AddOwnedForm(form); form.Show(); Protocol pro = talk.Get_All_User_Info(ClientInfo.session); if (pro.protoType == ProtoType.SUCCESS) { List<string> names = new List<string>(); names.Add("货物名称"); names.Add("货物产地"); names.Add("货物价格"); names.Add("货物类型"); form.dataGridView1.DataSource = TableDataUtil.convertListListDataToDataTable(names, pro.data); if (flag) { 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("获取信息错误,请重新获取"); } }
private void Register_Click(object sender, EventArgs e) { LoginForm lg = new LoginForm(); lg.Show(); this.Hide(); }