Beispiel #1
0
 private void add_BackGround(
 object sender,
 RunWorkerCompletedEventArgs e)
 {
     int reduce = int.Parse(textBox3.Text);
     int max = int.Parse(num);
     if (reduce > max)
     {
         textBox3.Text = num;
         MessageBox.Show("输入的数值太大,没有足够数量的货物");
     }
     else
     {
         InOutHandleNsTalk talk = new InOutHandleNsTalk();
         string idate = DateTime.Now.ToString("yyyyMMdd");
         string inum = textBox3.Text;
         Protocol pro = talk.Out_Goods(ClientInfo.session, gname, hname, inum, idate);
         if (pro.protoType == ProtoType.SUCCESS)
         {
             parent.basicInitInfo();
             this.Close();
         }
         else if (pro.protoType == ProtoType.OUT_OF_TIME)
         {
             MessageBox.Show("系统超时,请重新登录");
             this.Close();
         }
         else if (pro.protoType == ProtoType.ERROR)
         {
             MessageBox.Show("获取信息错误,请重新获取");
             this.Close();
         }
     }
 }
Beispiel #2
0
        private void add_BackGround(
        object sender,
        RunWorkerCompletedEventArgs e)
        {
            InOutHandleNsTalk talk = new InOutHandleNsTalk();
            string gname = this.textBox1.Text;
            string hname = this.comboBox1.Text;
            string inum = this.textBox2.Text;
            string idate = DateTime.Now.ToString("yyyyMMdd");
            if (!gname.Equals("") && !hname.Equals("")
                && !inum.Equals("") && int.Parse(inum)>0)
            {

                Protocol pro = talk.In_Goods(ClientInfo.session,gname,hname,inum,idate);
                if (pro.protoType == ProtoType.SUCCESS)
                {
                    this.basicInitInfo();
                }
                else if (pro.protoType == ProtoType.OUT_OF_TIME)
                {
                    MessageBox.Show("系统超时,请重新登录");
                    form.Close();
                    this.Close();
                }
                else if (pro.protoType == ProtoType.ERROR)
                {
                    MessageBox.Show("获取信息错误,请重新获取");
                    form.Close();
                    this.Close();
                }
            }
            else
            {
                MessageBox.Show("输入不合法,请检查输入");
            }
        }
Beispiel #3
0
        private void initInfo_BackGround(
         object sender,
         RunWorkerCompletedEventArgs e)
        {
            InOutHandleNsTalk talk = new InOutHandleNsTalk();
            Protocol pro = null;
            if (style == Log_Style.IN)
                pro = talk.Fetch_In_Goods(ClientInfo.session);
            else
                pro = talk.Fetch_Out_Goods(ClientInfo.session);
            if (pro.protoType == ProtoType.SUCCESS)
            {
                this.textBox1.Text = "";
                this.textBox2.Text = "";
                this.textBox3.Text = "";

                for (int i = 0; i < pro.data.Count; i++)
                    pro.data[i][5] = pro.data[i][5].Split(' ')[0];

                dataSource = pro.data;
                this.dataGridView1.DataSource = TableDataUtil.convertListListDataToDataTable(names, dataSource);
            }
            else if (pro.protoType == ProtoType.OUT_OF_TIME)
            {
                MessageBox.Show("系统超时,请重新登录");
                this.Close();
            }
            else if (pro.protoType == ProtoType.ERROR)
            {
                MessageBox.Show("获取信息错误,请重新获取");
                this.Close();
            }
        }
Beispiel #4
0
        private void initInfo_BackGround(
         object sender,
         RunWorkerCompletedEventArgs e)
        {
            InOutHandleNsTalk talk = new InOutHandleNsTalk();
            Protocol pro = talk.Get_In_Needed_Info(ClientInfo.session);
            if (pro.protoType == ProtoType.SUCCESS)
            {
                this.textBox1.Text = "";
                this.textBox2.Text = "";
                goodsList = pro.mutilData[0];
                depotList = pro.mutilData[1];
                countList = pro.mutilData[2];

                form = new I_Search_Form(this);
                this.AddOwnedForm(form);
                form.setDataSource(goodsList);

                List<string> depotDataSource = new List<string>();
                foreach (List<string> str in depotList)
                {
                    depotDataSource.Add(str[0]);
                }
                this.comboBox1.DataSource = depotDataSource;
                //G_Name,S_Name,H_Name,G_Addr,G_Price,C_Num
                List<String> names=new List<String>();
                names.Add("货物名称");
                names.Add("货物类型");
                names.Add("仓库名称");
                names.Add("货物地址");
                names.Add("货物价格");
                names.Add("货物存量");
                List<List<string>> subList=getSubSelectedCountList(textBox1.Text, comboBox1.Text);
                this.dataGridView1.DataSource = TableDataUtil.convertListListDataToDataTable(names, subList);
            }
            else if (pro.protoType == ProtoType.OUT_OF_TIME)
            {
                MessageBox.Show("系统超时,请重新登录");
                this.Close();
            }
            else if (pro.protoType == ProtoType.ERROR)
            {
                MessageBox.Show("获取信息错误,请重新获取");
                this.Close();
            }
        }
Beispiel #5
0
        private void initInfo_BackGround(
         object sender,
         RunWorkerCompletedEventArgs e)
        {
            InOutHandleNsTalk talk = new InOutHandleNsTalk();
            Protocol pro = talk.Get_In_Needed_Info(ClientInfo.session);
            if (pro.protoType == ProtoType.SUCCESS)
            {
                goodsList = pro.mutilData[0];
                depotList = pro.mutilData[1];
                countList = pro.mutilData[2];
                styleList = pro.mutilData[3];

                List<string> depotDataSource = new List<string>();
                depotDataSource.Add("");
                foreach (List<string> str in depotList)
                {
                    depotDataSource.Add(str[0]);
                }
                this.H_name_cb.DataSource = depotDataSource;

                List<string> styleDataSource = new List<string>();
                styleDataSource.Add("");
                foreach (List<string> str in styleList)
                {
                    styleDataSource.Add(str[1]);
                }
                this.G_style_cb.DataSource = styleDataSource;
                this.G_addr_tb.Text = "";
                this.G_Name_tb.Text = "";

                this.updateDataGrid();

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