Пример #1
0
        private void qhgdbutton_Click(object sender, EventArgs e)
        {
            MES_PD_SCRW model = new MES_PD_SCRW();

            model.SBBH = _MES_PD_SCRW_LIST.SBBH;

            SELECT_MES_PD_SCRW Smodel = ServicModel.PD_SCRW.SELECT(model, getToken());

            //if (Smodel.MES_PD_SCRW_LIST.Length <= 1)
            //{
            //    MessageBox.Show(_MES_PD_SCRW_LIST.SBH + "没有可切换的任务", "消息框");
            //    return;
            //}
            //else
            //{
            if (Smodel.MES_RETURN.TYPE.Equals("S"))
            {
                frmChange_GD form = new frmChange_GD(Smodel.MES_PD_SCRW_LIST, model.SBBH, RigthType);
                form.block = RefreshRW;
                show(form);
            }
            else
            {
                ShowMeg(Smodel.MES_RETURN.MESSAGE);
            }

            SMtextBox.Select();
            //}
        }
Пример #2
0
        private void getRwAndJLinfoByTm()
        {
            MES_PD_SCRW_SELECT_BY_TM model = new MES_PD_SCRW_SELECT_BY_TM();

            model.SBBH = SBHID;
            model.TM   = SMtextBox.Text.Trim().ToUpper();
            model.ZPRQ = Convert.ToDateTime(ServicModel.PUBLIC_FUNC.GET_TIME(getToken())).AddHours(-4).ToString("yyyy-MM-dd");
            SELECT_MES_PD_SCRW res = ServicModel.PD_SCRW.SELECT_BY_TM(model, getToken());

            if (res.MES_RETURN.TYPE.Equals("S"))
            {
                if (res.MES_PD_SCRW_LIST.Length == 1)
                {
                    RefreshRW(res.MES_PD_SCRW_LIST[0], SBHID);
                    SMtextBox.Text = model.TM;
                    getReportInfoByTm();

                    //BOMdataGridView.ClearSelection();
                }
                else if (res.MES_PD_SCRW_LIST.Length > 1)
                {
                    SMtextBox.Clear();
                    frmChange_GD form = new frmChange_GD(res.MES_PD_SCRW_LIST, model.SBBH, RigthType);
                    form.block = RefreshRW;
                    show(form);
                    //for (int i = 0; i < BOMdataGridView.Rows.Count; i++)
                    //{
                    //    BOMdataGridView.Rows[i].Cells["状态"].Style.BackColor = Color.Red;

                    //}
                    //BOMdataGridView.ClearSelection();
                    //Tmlist = new List<TMDataGrid>();
                    //LSdataGridView.DataSource = Tmlist;
                    //LSdataGridView.Columns["删除"].DisplayIndex = 4;

                    //SMtextBox.Select();
                    SMtextBox.Text = model.TM;
                    getReportInfoByTm();
                }
                else if (res.MES_PD_SCRW_LIST.Length == 0)
                {
                    //ShowMeg("找不到条码" + SMtextBox.Text.Trim() + "对应的任务信息");
                    ShowMeg(string.Format(q(Msg_Type.msgtmnorw), SMtextBox.Text.Trim()));
                }
                else
                {
                    //ShowMeg("数据异常,请联系管理员");
                    ShowMeg(q(Msg_Type.msgtmexcept));
                }
                SMtextBox.Select();
            }
            else
            {
                ShowMeg(res.MES_RETURN.MESSAGE);
                BomList = new ZBCFUN_GDJGXX_READ();
                BOMdataGridView.DataSource = new List <BomDataGrid>();
                SMtextBox.Clear();
                SMtextBox.Select();
            }
        }
Пример #3
0
        private void rwqhbutton_Click(object sender, EventArgs e)
        {
            //if (string.IsNullOrEmpty(scrqtextBox.Text.Trim()))
            //{
            //    ShowMeg("生产日期不能为空");
            //    return;
            //}
            //if (judge.IsDate(scrqtextBox.Text.Trim()) == false)
            //{
            //    ShowMeg("生产日期格式不正确");
            //    return;
            //}
            MES_PD_SCRW model = new MES_PD_SCRW();

            model.SBBH = _MES_PD_SCRW_LIST.SBBH;
            model.ZPRQ = dateTimePicker1.Text.Trim();
            SELECT_MES_PD_SCRW Smodel = ServicModel.PD_SCRW.SELECT(model, getToken());

            if (Smodel.MES_PD_SCRW_LIST.Length == 1)
            {
                //MessageBox.Show(_MES_PD_SCRW_LIST.SBH + "的当天任务派单只有一个", "消息框");
                ShowMeg(string.Format(q(Msg_Type.msgrwonlyone), _MES_PD_SCRW_LIST.SBH));
                SMtextBox.Select();
                return;
            }
            else
            {
                frmChange_GD form = new frmChange_GD(Smodel.MES_PD_SCRW_LIST, model.SBBH, RigthType);
                form.block = RefreshRW;
                show(form);
                //show(form);
            }
            SMtextBox.Select();
        }
Пример #4
0
        public void getTPMinfo(string tpm)
        {
            MES_PD_SCRW_GET_BY_TPM model = new MES_PD_SCRW_GET_BY_TPM();

            model.JLR    = Convert.ToInt32(getUserInfo("staffid"));
            model.TPM    = tpm;
            model.GC     = getGC("value");
            model.GZZXBH = getUserInfo("gzzxvalue");
            model.SBBH   = SBHID;
            SELECT_MES_PD_SCRW res = ServicModel.PD_SCRW.GET_RWBH_BY_TPM(model, getToken());

            if (res.MES_RETURN.TYPE.Equals("S"))
            {
                IsTMP = true;
                if (!string.IsNullOrEmpty(SMtextBox.Text.Trim()))
                {
                    Tpm = SMtextBox.Text.Trim();
                }
                configUI(res.MES_PD_SCRW_LIST[0]);
            }
            else
            {
                ShowMeg(res.MES_RETURN.MESSAGE);
            }
        }
Пример #5
0
        private void btn_Click(object sender, EventArgs e)
        {
            Button btn   = (Button)sender;
            int    index = Convert.ToInt32(btn.Tag) % 100; //任务清单 = 10   打印lot = 11

            int row    = Convert.ToInt32(btn.Tag) / 100;   //数组第几个元素
            int indexL = IndexList[row];

            if (indexL == -1)
            {
                indexL = 0;
            }
            MES_PD_SCRW_LIST model = Fjcclist[row].RwArr.MES_PD_SCRW_LIST[indexL];

            if (index == 11)
            {
                if (model.ISACTION == 0)
                {
                    ShowMeg(q(Msg_Type.titlewaitingfortl));//"投料还没完成请耐心等待"
                    return;
                }
                timer1.Stop();
                frmFJprint form = new frmFJprint(model);
                show(form);
                RefreshZn();
                //configUI(Sbhlist);
                timer1.Start();
                //configUI(Sbhlist);
                //this.Refresh();
            }
            else if (index == 10)
            {
                string      sbhh    = model.SBBH;
                string      sbh     = model.SBH;
                MES_PD_SCRW rwmodel = new MES_PD_SCRW();
                rwmodel.SBBH = sbhh;
                rwmodel.GC   = model.GC;//getGC("value");
                //model.GZZXBH = getUserInfo("gzzxvalue");
                rwmodel.ZPRQ = GetSystemDate(Date_Type.hour, -4, "yyyy-MM-dd");
                SELECT_MES_PD_SCRW res = ServicModel.PD_SCRW.SELECT(rwmodel, getToken());



                if (res.MES_RETURN.TYPE.Equals("S"))
                {
                    timer1.Stop();
                    frmSelectRWList_N form = new frmSelectRWList_N(res.MES_PD_SCRW_LIST, sbh);
                    show(form);
                    timer1.Start();
                }
                else
                {
                    //MessageBox.Show(res.MES_RETURN.MESSAGE, "消息框");
                    ShowMeg(res.MES_RETURN.MESSAGE);
                }
            }
        }
Пример #6
0
        public string GET_SCRW_BY_ROLE(string datastring)
        {
            int         STAFFID           = Convert.ToInt32(AppClass.GetSession("STAFFID"));
            string      token             = AppClass.GetSession("token").ToString();
            MES_PD_SCRW model_MES_PD_SCRW = Newtonsoft.Json.JsonConvert.DeserializeObject <MES_PD_SCRW>(datastring);

            model_MES_PD_SCRW.STAFFID = STAFFID;
            SELECT_MES_PD_SCRW rst_SELECT_MES_PD_SCRW = mesModels.PD_SCRW.SELECT_BY_ROLE(model_MES_PD_SCRW, token);

            return(Newtonsoft.Json.JsonConvert.SerializeObject(rst_SELECT_MES_PD_SCRW));
        }
Пример #7
0
        public string GET_RWBH_BYTPM(string datastring)
        {
            TokenINFO rst_TokenINFO = GET_TokenINFO();
            //int STAFFID = Convert.ToInt32(AppClass.GetSession("STAFFID"));
            //string token = AppClass.GetSession("token").ToString();
            MES_PD_SCRW_GET_BY_TPM model_MES_PD_SCRW_GET_BY_TPM = Newtonsoft.Json.JsonConvert.DeserializeObject <MES_PD_SCRW_GET_BY_TPM>(datastring);

            model_MES_PD_SCRW_GET_BY_TPM.JLR = rst_TokenINFO.STAFFID;
            SELECT_MES_PD_SCRW rst_SELECT_MES_PD_SCRW = mesmodels.PD_SCRW.GET_RWBH_BY_TPM(model_MES_PD_SCRW_GET_BY_TPM, rst_TokenINFO.Token);

            return(Newtonsoft.Json.JsonConvert.SerializeObject(rst_SELECT_MES_PD_SCRW));
        }
Пример #8
0
        private void frmFindSBH_Shown(object sender, EventArgs e)
        {
            string gzzx = Gzzx.Split('-')[0];

            if (gzzx.Equals("Z2002"))
            {
                string sbh = ini.IniReadValue(ini.Section_Machine, "fjsbh");
                if (!string.IsNullOrEmpty(sbh) && IsFJpipeline == true)
                {
                    MES_PD_SCRW model = new MES_PD_SCRW();
                    model.SBBH = sbh;
                    //DateTime dt = Convert.ToDateTime(ServicModel.PUBLIC_FUNC.GET_TIME(getToken())).AddHours(-4);
                    //model.ZPRQ = Convert.ToDateTime(ServicModel.PUBLIC_FUNC.GET_TIME(getToken())).AddHours(-4).ToString("yyyy-MM-dd");
                    model.ZPRQ = GetSystemDate(Date_Type.hour, -4, "yyyy-MM-dd");
                    //model.ZPRQ = DateTime.Now.ToString("yyyy-MM-dd");
                    SELECT_MES_PD_SCRW Smodel = ServicModel.PD_SCRW.SELECT(model, getToken());
                    if (Smodel.MES_RETURN.Equals("E"))
                    {
                        ShowMeg(Smodel.MES_RETURN.MESSAGE);
                    }
                    else
                    {
                        if (Smodel.MES_PD_SCRW_LIST.Length > 0)
                        {
                            frmFujiTL_N fjtlform = new frmFujiTL_N(Smodel.MES_PD_SCRW_LIST, Smodel.MES_PD_SCRW_LIST[0].SBH, sbh);
                            push(fjtlform, this);
                        }
                        else
                        {
                            ShowMeg(q(Msg_Type.msgnodata));    //"没有查询到数据"
                            return;
                        }

                        //this.Close();
                    }
                }
            }
            else
            {
                if (Sbhlist.Length == 1)
                {
                    foreach (Control ctl in panel1.Controls)
                    {
                        if (ctl is Button)
                        {
                            Button btn = (Button)ctl;
                            this.btn_Click(btn, new EventArgs());
                        }
                    }
                }
            }
        }
Пример #9
0
        private void qhgdbutton_Click(object sender, EventArgs e)
        {
            //if (string.IsNullOrEmpty(scrqtextBox.Text.Trim()))
            //{
            //    ShowMeg("生产日期不能为空");
            //    return;
            //}
            //if (judge.IsDate(scrqtextBox.Text.Trim()) == false)
            //{
            //    ShowMeg("生产日期格式不正确");
            //    return;
            //}
            string      tm    = SMtextBox.Text.Trim().ToUpper();
            MES_PD_SCRW model = new MES_PD_SCRW();

            model.SBBH = _MES_PD_SCRW_LIST.SBBH;
            model.ZPRQ = dateTimePicker1.Text.Trim();
            SELECT_MES_PD_SCRW Smodel = ServicModel.PD_SCRW.SELECT(model, getToken());

            if (Smodel.MES_PD_SCRW_LIST.Length <= 1)
            {
                //MessageBox.Show(_MES_PD_SCRW_LIST.SBH + "没有可切换的任务", "消息框");
                ShowMeg(_MES_PD_SCRW_LIST.SBH + q(Msg_Type.msgnoreplacerw));
                return;
            }
            else
            {
                frmChange_GD form = new frmChange_GD(Smodel.MES_PD_SCRW_LIST, model.SBBH, RigthType);
                form.block = RefreshRW;
                show(form);

                //show(form);
            }
            //SMtextBox.Select();
            for (int i = 0; i < BOMdataGridView.Rows.Count; i++)
            {
                BOMdataGridView.Rows[i].Cells[q(Msg_Type.fieldstatus)].Style.BackColor = Color.Red;//"状态"
                //for (int j = 0; j < unRequireArr.Count; j++)
                //{
                //    if (i == unRequireArr[j])
                //    {
                //        BOMdataGridView.Rows[i].Cells["状态"].Style.BackColor = Color.White;
                //    }
                //}
            }
            BOMdataGridView.ClearSelection();
            //BOMdataGridView.Columns["状态"].DefaultCellStyle.BackColor = Color.Red;
            Tmlist = new List <TMDataGrid>();
            LSdataGridView.DataSource = Tmlist;
            LSdataGridView.Columns[q(Msg_Type.fielddelete)].DisplayIndex = 4;//"删除"
            SMtextBox.Select();
        }
Пример #10
0
        private void nextrwbutton_Click(object sender, EventArgs e)
        {
            MES_PD_SCRW model = new MES_PD_SCRW();

            model.SBBH = SBHID;
            //model.ZPRQ = DateTime.Now.ToString("yyyy-MM-dd");
            string currentDay = ServicModel.PUBLIC_FUNC.GET_TIME(getToken());
            string ksDate     = Convert.ToDateTime(currentDay).AddDays(1).ToString("yyyy-MM-dd");
            string jsDate     = Convert.ToDateTime(currentDay).AddDays(10).ToString("yyyy-MM-dd");

            model.ZPRQKS = ksDate;
            model.ZPRQJS = jsDate;

            SELECT_MES_PD_SCRW res = ServicModel.PD_SCRW.SELECT(model, getToken());

            if (res.MES_RETURN.TYPE.Equals("S"))
            {
                MES_PD_SCRW_LIST[] rwlist = res.MES_PD_SCRW_LIST;
                //(from o in nodes_right orderby o.RGROUPID, o.RIGHTNO select o).ToList();
                List <MES_PD_SCRW_LIST> nodes = (from o in rwlist.ToList() orderby o.ZPRQ select o).ToList();
                if (nodes.Count > 0)
                {
                    string neardate = nodes[0].ZPRQ;
                    List <MES_PD_SCRW_LIST> requirelist = new List <MES_PD_SCRW_LIST>();
                    for (int i = 0; i < nodes.Count; i++)
                    {
                        if (nodes[i].ZPRQ.Equals(neardate))
                        {
                            requirelist.Add(nodes[i]);
                        }
                    }
                    frmNearDateRW form = new frmNearDateRW(requirelist.ToArray());
                    show(form);
                }
                else
                {
                    ShowMeg(q(Msg_Type.msgzsnorw));//"暂时没有任务指派"
                }
            }
            else
            {
                ShowMeg(q(Msg_Type.msgzsnorw));//"暂时没有任务指派"
            }
            SMtextBox.Select();
        }
Пример #11
0
        private void button1_Click(object sender, EventArgs e)
        {
            MES_PD_SCRW model = new MES_PD_SCRW();

            model.SBBH = SBHID;
            //model.ZPRQ = DateTime.Now.ToString("yyyy-MM-dd");
            model.ZPRQ = GetSystemDate(Date_Type.hour, -4, "yyyy-MM-dd");//Convert.ToDateTime(ServicModel.PUBLIC_FUNC.GET_TIME(getToken())).ToString("yyyy-MM-dd");
            SELECT_MES_PD_SCRW res = ServicModel.PD_SCRW.SELECT(model, getToken());

            if (res.MES_RETURN.TYPE.Equals("S"))
            {
                ConfigData(res.MES_PD_SCRW_LIST);
            }
            else
            {
                ShowMeg(res.MES_RETURN.MESSAGE);
            }
        }
Пример #12
0
        private void radioButton3_Click(object sender, EventArgs e)
        {
            radioButton3.Checked = true;
            MES_PD_SCRW model = new MES_PD_SCRW();

            model.SBBH = SBHID;
            model.ZPRQ = Convert.ToDateTime(ServicModel.PUBLIC_FUNC.GET_TIME(getToken())).ToString("yyyy-MM-dd");
            SELECT_MES_PD_SCRW res = ServicModel.PD_SCRW.SELECT(model, getToken());

            if (res.MES_RETURN.TYPE.Equals("S"))
            {
                ConfigData(res.MES_PD_SCRW_LIST);
            }
            else
            {
                ShowMeg(res.MES_RETURN.MESSAGE);
            }
            //ShowList(radioType.finish);
        }
Пример #13
0
        public string GET_RWPD(string GDDH, string ZPRQ, string UNITSNAME, string GC, int BC, int SBFL)
        {
            string      token             = AppClass.GetSession("token").ToString();
            string      rst               = "";
            MES_PD_SCRW model_MES_PD_SCRW = new MES_PD_SCRW();

            model_MES_PD_SCRW.GDDH = GDDH;
            model_MES_PD_SCRW.ZPRQ = ZPRQ;
            model_MES_PD_SCRW.BC   = BC;
            model_MES_PD_SCRW.SBFL = SBFL;
            SELECT_MES_PD_SCRW rst_SELECT_MES_PD_SCRW = mesModels.PD_SCRW.SELECT_ZPQD(model_MES_PD_SCRW, token);

            for (int i = 0; i < rst_SELECT_MES_PD_SCRW.MES_PD_SCRW_LIST.Length; i++)
            {
                rst_SELECT_MES_PD_SCRW.MES_PD_SCRW_LIST[i].UNITSNAME = UNITSNAME;
            }
            rst = Newtonsoft.Json.JsonConvert.SerializeObject(rst_SELECT_MES_PD_SCRW);
            return(rst);
        }
Пример #14
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(GZZXcomboBox.Text))
            {
                MessageBox.Show("工作中心不能为空!!!", "消息框");
                return;
            }
            if (string.IsNullOrEmpty(SBcomboBox.Text))
            {
                MessageBox.Show("设备号不能为空!!!", "消息框");
                return;
            }
            MES_PD_SCRW model = new MES_PD_SCRW();

            model.SBBH = Convert.ToString(SBcomboBox.SelectedValue);
            SBHID      = model.SBBH;
            SELECT_MES_PD_SCRW Smodel = ServicModel.PD_SCRW.SELECT(model, getToken());

            if (Smodel.MES_RETURN.TYPE == "E")
            {
                MessageBox.Show(Smodel.MES_RETURN.MESSAGE, "消息框");
                return;
            }

            if (Smodel.MES_PD_SCRW_LIST.Length == 0)
            {
                MessageBox.Show("找不到工作中心是" + GZZXcomboBox.Text + "设备号是" + SBcomboBox.Text + "对应的派单任务!!!", "消息框");
                return;
            }
            else if (Smodel.MES_PD_SCRW_LIST.Length == 1)
            {
                frmTL2_1 form = new frmTL2_1(Smodel.MES_PD_SCRW_LIST[0], model.SBBH, RigthType);
                push(form, this);
            }
            else if (Smodel.MES_PD_SCRW_LIST.Length > 1)
            {
                frmChange_GD form = new frmChange_GD(Smodel.MES_PD_SCRW_LIST, model.SBBH, RigthType);
                show(form);
                this.Close();
            }
        }
Пример #15
0
        private void qhgdbutton_Click(object sender, EventArgs e)
        {
            //if (string.IsNullOrEmpty(scrqtextBox.Text.Trim()))
            //{
            //    ShowMeg("生产日期不能为空");
            //    return;
            //}
            //if (judge.IsDate(scrqtextBox.Text.Trim()) == false)
            //{
            //    ShowMeg("生产日期格式不正确");
            //    return;
            //}
            MES_PD_SCRW model = new MES_PD_SCRW();

            model.SBBH = _MES_PD_SCRW_LIST.SBBH;
            model.ZPRQ = dateTimePicker1.Text.Trim();
            SELECT_MES_PD_SCRW Smodel = ServicModel.PD_SCRW.SELECT(model, getToken());

            if (Smodel.MES_RETURN.TYPE.Equals("S"))
            {
                frmChange_GD form = new frmChange_GD(Smodel.MES_PD_SCRW_LIST, model.SBBH, Rigth_Type.zhuxiantl);
                form.block = RefreshRW;
                show(form);
            }
            else
            {
                ShowMeg(Smodel.MES_RETURN.MESSAGE);
            }
            //if (Smodel.MES_PD_SCRW_LIST.Length <= 1)
            //{
            //    MessageBox.Show(_MES_PD_SCRW_LIST.SBH + "没有可切换的任务", "消息框");
            //    return;
            //}
            //else
            //{


            //show(form);
            //}
            SMtextBox.Select();
        }
Пример #16
0
        private void qhgdbutton_Click(object sender, EventArgs e)
        {
            MES_PD_SCRW model = new MES_PD_SCRW();

            model.SBBH = _MES_PD_SCRW_LIST.SBBH;

            SELECT_MES_PD_SCRW Smodel = ServicModel.PD_SCRW.SELECT(model, getToken());

            if (Smodel.MES_PD_SCRW_LIST.Length == 1)
            {
                //MessageBox.Show(_MES_PD_SCRW_LIST.SBH + "的当天任务派单只有一个", "消息框");
                ShowMeg(_MES_PD_SCRW_LIST.SBH + q(Msg_Type.msgdayrwonlyone));
                return;
            }
            else
            {
                frmChange_GD form = new frmChange_GD(Smodel.MES_PD_SCRW_LIST, model.SBBH, RigthType);
                show(form);
                this.Close();
            }
        }
Пример #17
0
        public string GET_SCRW_BYSBBH(string in_sm)
        {
            TokenINFO   rst_TokenINFO     = GET_TokenINFO();
            MES_PD_SCRW model_MES_PD_SCRW = new MES_PD_SCRW();

            model_MES_PD_SCRW.SBBH = in_sm;
            string ZPRQ = mesmodels.PUBLIC_FUNC.GET_TIME(rst_TokenINFO.Token);

            if (ZPRQ.Length > 10)
            {
                ZPRQ = ZPRQ.Substring(0, 10);
            }
            else
            {
                ZPRQ = DateTime.Now.ToString("yyyy-MM-dd");
            }
            model_MES_PD_SCRW.ZPRQ = ZPRQ;
            SELECT_MES_PD_SCRW rst_SELECT_MES_PD_SCRW = mesmodels.PD_SCRW.SELECT_LAST(model_MES_PD_SCRW, rst_TokenINFO.Token);

            return(Newtonsoft.Json.JsonConvert.SerializeObject(rst_SELECT_MES_PD_SCRW));
        }
Пример #18
0
        private void btn_Click(object sender, EventArgs e)
        {
            Button           btn   = (Button)sender;
            int              index = Convert.ToInt32(btn.Tag) % 10; //任务清单 = 1   打印lot = 2
            int              row   = Convert.ToInt32(btn.Tag) / 10; //数组第几个元素
            MES_PD_SCRW_LIST model = Fjcclist[row].RwArr.MES_PD_SCRW_LIST[IndexList[row]];

            if (index == 2)
            {
                if (model.ISACTION == 0)
                {
                    ShowMeg("投料还没完成请耐心等待");
                    return;
                }
                timer1.Stop();
                frmFJprint form = new frmFJprint(model);
                show(form);
                //configUI(Sbhlist);
                timer1.Start();
                //configUI(Sbhlist);
                //this.Refresh();
            }
            else if (index == 1)
            {
                string             sbhh = model.SBBH;
                string             sbh  = model.SBH;
                SELECT_MES_PD_SCRW res  = GetRWbySBBH(sbhh);
                if (res.MES_RETURN.TYPE.Equals("S"))
                {
                    timer1.Stop();
                    frmSelectRWList form = new frmSelectRWList(res.MES_PD_SCRW_LIST, sbh);
                    show(form);
                    timer1.Start();
                }
                else
                {
                    MessageBox.Show(res.MES_RETURN.MESSAGE, "消息框");
                }
            }
        }
Пример #19
0
 private void dateTimePicker1_CloseUp(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(dateTimePicker1.Text.Trim()))
     {
         //if (!Convert.ToDateTime(dateTimePicker1.Text.Trim()).ToString("yyyy-MM-dd").Equals(LastDate))
         //{
         MES_PD_SCRW model = new MES_PD_SCRW();
         model.SBBH = MES_PD_SCRW_LIST.SBBH;
         model.ZPRQ = dateTimePicker1.Text.Trim();
         SELECT_MES_PD_SCRW Smodel = ServicModel.PD_SCRW.SELECT(model, getToken());
         if (Smodel.MES_RETURN.TYPE.Equals("S"))
         {
             if (Smodel.MES_PD_SCRW_LIST.Length == 1)
             {
                 LastDate = dateTimePicker1.Text.Trim();
                 RefreshRW(Smodel.MES_PD_SCRW_LIST[0], model.SBBH);
             }
             else if (Smodel.MES_PD_SCRW_LIST.Length > 1)
             {
                 LastDate = dateTimePicker1.Text.Trim();
                 frmChange_GD form = new frmChange_GD(Smodel.MES_PD_SCRW_LIST, model.SBBH, RigthType);
                 form.block = RefreshRW;
                 show(form);
             }
             else
             {
                 //MessageBox.Show(_MES_PD_SCRW_LIST.SBH + "没有可切换的任务", "消息框");
                 ShowMeg(_MES_PD_SCRW_LIST.SBH + q(Msg_Type.msgnoreplacerw));
                 return;
             }
         }
         else
         {
             ShowMeg(Smodel.MES_RETURN.MESSAGE);
         }
         SMtextBox.Select();
         //}
     }
 }
Пример #20
0
        private void button1_Click(object sender, EventArgs e)
        {
            //ConfigData(res.MES_PD_SCRW_LIST, Sbh);
            //jldataGridView.ClearSelection();
            ////jldataGridView.Rows[Index].Selected = true;
            //jldataGridView.CurrentCell = jldataGridView.Rows[Index].Cells[0];
            //jldataGridView.ClearSelection();
            MES_PD_SCRW model = new MES_PD_SCRW();

            model.SBBH = SBHID;
            model.ZPRQ = DateTime.Now.ToString("yyyy-MM-dd");
            SELECT_MES_PD_SCRW res = ServicModel.PD_SCRW.SELECT(model, getToken());

            if (res.MES_RETURN.TYPE.Equals("S"))
            {
                ConfigData(res.MES_PD_SCRW_LIST);
            }
            else
            {
                ShowMeg(res.MES_RETURN.MESSAGE);
            }
        }
Пример #21
0
        public void getGDinfo(string gd)
        {
            MES_PD_SCRW_GET_BY_ERPNO model = new MES_PD_SCRW_GET_BY_ERPNO();

            model.JLR    = Convert.ToInt32(getUserInfo("staffid"));
            model.ERPNO  = gd;
            model.GC     = getGC("value");
            model.GZZXBH = getUserInfo("gzzxvalue");
            model.SBBH   = SBHID;

            SELECT_MES_PD_SCRW res = ServicModel.PD_SCRW.GET_RWBH_BY_ERPNO(model, getToken());

            if (res.MES_RETURN.TYPE.Equals("S"))
            {
                IsGD = true;
                configUI(res.MES_PD_SCRW_LIST[0]);
            }
            else
            {
                ShowMeg(res.MES_RETURN.MESSAGE);
            }
        }
Пример #22
0
        public frmBBprint(MES_TM_TMINFO_INSERT_GL model, Print_Type ptype, Rigth_Type rtype, MES_PD_SCRW_LIST list)
        {
            InitializeComponent();
            RigthType = rtype;
            PrintType = ptype;
            MES_PD_SCRW scrwmodel = new MES_PD_SCRW();

            scrwmodel.RWBH = list.RWBH;
            SELECT_MES_PD_SCRW res = ServicModel.PD_SCRW.SELECT(scrwmodel, getToken());

            if (res.MES_PD_SCRW_LIST.Length == 0)
            {
                ShowMeg(q(Msg_Type.msgrwdempty));
                return;
            }
            list = res.MES_PD_SCRW_LIST[0];
            if (list == null)
            {
                ShowMeg(q(Msg_Type.msgrwdempty));
                return;
            }

            MES_TM_TMINFO_INSERT_GL = model;
            wlxxtextBox.Text        = list.WLH + "/" + list.WLMS;

            if (!string.IsNullOrEmpty(list.XSNOBILL))
            {
                if (!string.IsNullOrEmpty(list.PC))
                {
                    wlsxtextBox.Text = list.XSNOBILL + "-" + list.XSNOBILLMX + "/" + list.PC;
                }
                else
                {
                    wlsxtextBox.Text = list.XSNOBILL + "-" + list.XSNOBILLMX;
                }
            }
            else
            {
                if (!string.IsNullOrEmpty(list.PC))
                {
                    wlsxtextBox.Text = list.PC;
                }
            }
            dcxhtextBox.Text = list.DCXHNAME;
            dcdjtextBox.Text = list.DCDJNAME;
            mbsltextBox.Text = Convert.ToString(list.MPSL);
            bbpmtextBox.Text = list.RQM;

            //if (judge.IsNumber(list.XSNOBILL) == false && !string.IsNullOrEmpty(list.XSNOBILL))
            //{
            //    bzrichTextBox.Text = list.XSNOBILL + "-" + list.XSNOBILLMX;
            //}



            cpztcomboBox.DataSource    = GetDictionaryMX(9);
            cpztcomboBox.DisplayMember = "MXNAME";
            cpztcomboBox.ValueMember   = "ID";
            zhtextBox.Text             = Convert.ToString(ServicModel.PD_SCRW.SELECT_TH_BY_GDDH_SBBH(list.RWBH, getToken()).TH);
            List <MES_SY_TYPEMXLIST> sbcdlist   = GetDictionaryMX(15).ToList();
            MES_SY_TYPEMXLIST        choicllist = new MES_SY_TYPEMXLIST();

            choicllist.ID     = 0;
            choicllist.MXNAME = q(Msg_Type.titlechoice);
            sbcdlist.Insert(0, choicllist);
            sbcdcomboBox.DataSource    = sbcdlist;
            sbcdcomboBox.DisplayMember = "MXNAME";
            sbcdcomboBox.ValueMember   = "ID";
            List <MES_SY_TYPEMXLIST> hdgxlist = GetDictionaryMX(19).ToList();

            hdgxlist.Insert(0, choicllist);
            hdgxcomboBox.DisplayMember = "MXNAME";
            hdgxcomboBox.ValueMember   = "ID";
            hdgxcomboBox.DataSource    = hdgxlist;
            hdgxcomboBox.SelectedValue = list.XDGX;
        }
Пример #23
0
        private void qrtlbutton_Click(object sender, EventArgs e)
        {
            //if (string.IsNullOrEmpty(czrtextBox.Text.Trim()))
            //{
            //    MessageBox.Show("操作人不能为空", "消息框");
            //    SMtextBox.Select();
            //    return;
            //}
            if (string.IsNullOrEmpty(tlsjtextBox.Text.Trim()))
            {
                MessageBox.Show("投料时间不能为空", "消息框");
                return;
            }
            if (judge.IsDate(tlsjtextBox.Text.Trim()) == false && tlsjtextBox.Text.Length == 16)
            {
                MessageBox.Show("投料时间的格式不正确", "消息框");
                return;
            }
            MES_PD_SCRW model = new MES_PD_SCRW();

            model.GC     = Rwlist[Index].GC;
            model.RWBH   = Rwlist[Index].RWBH;
            model.TLSJ   = tlsjtextBox.Text.Trim();
            model.GZZXBH = Rwlist[Index].GZZXBH;
            model.MAC    = DeviceInfo.GetNetCardMAC().Substring(0, 17);
            //model.JLR = Convert.ToInt32(getUserInfo("staffid"));
            SELECT_MES_PD_SCRW res = ServicModel.PD_SCRW.UPDATE_FJTL(model, getToken());

            if (res.MES_RETURN.TYPE.Equals("S"))
            {
                int index = -1;
                for (int i = 0; i < res.MES_PD_SCRW_LIST.Length; i++)
                {
                    if (res.MES_PD_SCRW_LIST[i].ISACTION == 0)
                    {
                        index = i;
                    }
                }
                if (index == -1)
                {
                    //if (MessageBox.Show("设备号" + Sbh + "的派单任务已经全部完成", "消息框", MessageBoxButtons.OK) == DialogResult.OK)
                    //{
                    ShowMeg("设备号" + Sbh + "任务完成", 1500);
                    ConfigData(res.MES_PD_SCRW_LIST, Sbh);
                    jldataGridView.ClearSelection();
                    //}
                }
                else
                {
                    ShowMeg("完成投料", 1500);
                    //if (MessageBox.Show("完成投料", "消息框", MessageBoxButtons.OK) == DialogResult.OK)
                    //{
                    ConfigData(res.MES_PD_SCRW_LIST, Sbh);
                    jldataGridView.ClearSelection();
                    //jldataGridView.Rows[Index].Selected = true;
                    jldataGridView.CurrentCell = jldataGridView.Rows[Index].Cells[0];
                    jldataGridView.ClearSelection();
                    //}
                    tlsjtextBox.Clear();
                    tlsjtextBox.BackColor = Color.FromArgb(234, 241, 246);
                }
            }
            else
            {
                MessageBox.Show(res.MES_RETURN.MESSAGE, "消息框");
                return;
            }
        }
Пример #24
0
        public void RefreshZn()
        {
            Fjcclist.Clear();
            IndexList.Clear();
            for (int i = 0; i < Sbhlist.Length; i++)
            {
                FJCClist    list    = new FJCClist();
                MES_PD_SCRW pd_scrw = new MES_PD_SCRW();
                pd_scrw.SBBH = Sbhlist[i].SBBH;
                pd_scrw.GC   = getGC("value");
                //pd_scrw.GZZXBH = getUserInfo("gzzxvalue");
                pd_scrw.ZPRQ = Convert.ToDateTime(ServicModel.PUBLIC_FUNC.GET_TIME(getToken())).AddHours(-4).ToString("yyyy-MM-dd");
                SELECT_MES_PD_SCRW Smodel = ServicModel.PD_SCRW.SELECT(pd_scrw, getToken());
                if (Smodel.MES_RETURN.TYPE.Equals("S"))
                {
                    list.RwArr = Smodel;
                }
                else
                {
                    list.RwArr = new SELECT_MES_PD_SCRW();
                }
                list.SbStruct = Sbhlist[i];
                Fjcclist.Add(list);
            }
            for (int i = 0; i < Fjcclist.Count; i++)
            {
                if (Fjcclist[i].RwArr.MES_PD_SCRW_LIST == null)
                {
                    IndexList.Add(-2);
                    continue;
                }
                else
                {
                    if (Fjcclist[i].RwArr.MES_PD_SCRW_LIST.Length == Fjcclist[i].RwArr.MES_PD_SCRW_LIST.Count(p => p.ISACTION == 2))
                    {
                        IndexList.Add(-1);
                        continue;
                    }
                    ;
                    int action1Index = Fjcclist[i].RwArr.MES_PD_SCRW_LIST.ToList().FindIndex(p => p.ISACTION == 1);
                    if (action1Index >= 0)
                    {
                        IndexList.Add(action1Index);
                        continue;
                    }
                    int action0Index = Fjcclist[i].RwArr.MES_PD_SCRW_LIST.ToList().FindIndex(p => p.ISACTION == 0);
                    if (action0Index >= 0)
                    {
                        IndexList.Add(action0Index);
                        continue;
                    }
                }
            }
            int panelCount = 0;

            foreach (Control p1 in totalpanel.Controls)
            {
                if (p1 is Panel)
                {
                    foreach (Control item in p1.Controls)
                    {
                        if (Fjcclist[panelCount].RwArr.MES_PD_SCRW_LIST == null)
                        {
                            p1.BackColor = Color.FromArgb(252, 228, 214);
                            if (Convert.ToInt32(item.Tag) == 1 + panelCount * 100)
                            {
                                //item.Visible = false;
                                item.Visible = true;
                            }
                            else if (Convert.ToInt32(item.Tag) == 2 + panelCount * 100)
                            {
                                item.Visible = false;
                            }
                            else if (Convert.ToInt32(item.Tag) == 3 + panelCount * 100)
                            {
                                item.Visible = false;
                            }
                            else if (Convert.ToInt32(item.Tag) == 4 + panelCount * 100)
                            {
                                item.Visible = false;
                            }
                            else if (Convert.ToInt32(item.Tag) == 5 + panelCount * 100)
                            {
                                item.Visible = false;
                            }
                            else if (Convert.ToInt32(item.Tag) == 6 + panelCount * 100)
                            {
                                item.Visible = false;
                            }
                            else if (Convert.ToInt32(item.Tag) == 7 + panelCount * 100)
                            {
                                item.Visible = false;
                            }
                            else if (Convert.ToInt32(item.Tag) == 8 + panelCount * 100)
                            {
                                item.Visible = true;
                            }
                            else if (Convert.ToInt32(item.Tag) == 9 + panelCount * 100)
                            {
                                item.Visible = false;
                            }
                            else if (Convert.ToInt32(item.Tag) == 10 + panelCount * 100)
                            {
                                item.Visible = false;
                            }
                            else if (Convert.ToInt32(item.Tag) == 11 + panelCount * 100)
                            {
                                item.Visible = false;
                            }

                            break;
                        }
                        else
                        {
                            if (Fjcclist[panelCount].RwArr.MES_PD_SCRW_LIST.Length == Fjcclist[panelCount].RwArr.MES_PD_SCRW_LIST.Count(p => p.ISACTION == 2))
                            {
                                p1.BackColor = Color.FromArgb(252, 228, 214);
                                if (Convert.ToInt32(item.Tag) == 1 + panelCount * 100)
                                {
                                    item.Visible = true;
                                }
                                else if (Convert.ToInt32(item.Tag) == 2 + panelCount * 100)
                                {
                                    item.Visible = false;
                                }
                                else if (Convert.ToInt32(item.Tag) == 3 + panelCount * 100)
                                {
                                    item.Visible = false;
                                }
                                else if (Convert.ToInt32(item.Tag) == 4 + panelCount * 100)
                                {
                                    item.Visible = false;
                                }
                                else if (Convert.ToInt32(item.Tag) == 5 + panelCount * 100)
                                {
                                    item.Visible = false;
                                }
                                else if (Convert.ToInt32(item.Tag) == 6 + panelCount * 100)
                                {
                                    item.Visible = false;
                                }
                                else if (Convert.ToInt32(item.Tag) == 7 + panelCount * 100)
                                {
                                    item.Visible = false;
                                }
                                else if (Convert.ToInt32(item.Tag) == 8 + panelCount * 100)
                                {
                                    item.Visible = false;
                                }
                                else if (Convert.ToInt32(item.Tag) == 9 + panelCount * 100)
                                {
                                    item.Visible = true;
                                }
                                else if (Convert.ToInt32(item.Tag) == 10 + panelCount * 100)
                                {
                                    item.Visible = true;
                                }
                                else if (Convert.ToInt32(item.Tag) == 11 + panelCount * 100)
                                {
                                    item.Visible = false;
                                }

                                continue;
                            }
                            ;
                            int action1Index = Fjcclist[panelCount].RwArr.MES_PD_SCRW_LIST.ToList().FindIndex(p => p.ISACTION == 1);
                            if (action1Index >= 0)
                            {
                                p1.BackColor = Color.FromArgb(146, 208, 80);
                                MES_PD_SCRW_LIST[] data = Fjcclist[panelCount].RwArr.MES_PD_SCRW_LIST;
                                if (Convert.ToInt32(item.Tag) == 1 + panelCount * 100)
                                {
                                    item.Visible = true;
                                }
                                else if (Convert.ToInt32(item.Tag) == 2 + panelCount * 100)
                                {
                                    Label lb = (Label)item;
                                    lb.Visible = true;
                                    lb.Text    = q(Msg_Type.titleth) + data[action1Index].TH.ToString();//"桶号:"
                                }
                                else if (Convert.ToInt32(item.Tag) == 3 + panelCount * 100)
                                {
                                    Label lb = (Label)item;
                                    lb.Visible = true;
                                    lb.Text    = q(Msg_Type.titlepf) + data[action1Index].PFDH;//"配方:"
                                }
                                else if (Convert.ToInt32(item.Tag) == 4 + panelCount * 100)
                                {
                                    Label lb = (Label)item;
                                    lb.Visible = true;
                                    lb.Text    = q(Msg_Type.titlepldh) + data[action1Index].PLDH;//"配料单号:"
                                }
                                else if (Convert.ToInt32(item.Tag) == 5 + panelCount * 100)
                                {
                                    Label lb = (Label)item;
                                    lb.Visible = true;
                                    lb.Text    = q(Msg_Type.titlexfcd) + data[action1Index].XFCDNAME;//"锌粉产地:"
                                }
                                else if (Convert.ToInt32(item.Tag) == 6 + panelCount * 100)
                                {
                                    Label lb = (Label)item;
                                    lb.Visible = true;
                                    lb.Text    = q(Msg_Type.titlexfcd) + data[action1Index].XFPC;//"锌粉批号:"
                                }
                                else if (Convert.ToInt32(item.Tag) == 7 + panelCount * 100)
                                {
                                    Label lb = (Label)item;
                                    lb.Visible   = true;
                                    lb.Text      = q(Msg_Type.titlezt) + q(Msg_Type.fieldytl);//"状态:已投料";
                                    lb.ForeColor = Color.Black;
                                }
                                else if (Convert.ToInt32(item.Tag) == 8 + panelCount * 100)
                                {
                                    item.Visible = false;
                                }
                                else if (Convert.ToInt32(item.Tag) == 9 + panelCount * 100)
                                {
                                    item.Visible = false;
                                }
                                else if (Convert.ToInt32(item.Tag) == 10 + panelCount * 100)
                                {
                                    Button btn = (Button)item;
                                    btn.Enabled = true;
                                    btn.Visible = true;
                                }
                                else if (Convert.ToInt32(item.Tag) == 11 + panelCount * 100)
                                {
                                    Button btn = (Button)item;
                                    btn.Enabled = true;
                                    btn.Visible = true;
                                }
                                continue;
                            }
                            int action0Index = Fjcclist[panelCount].RwArr.MES_PD_SCRW_LIST.ToList().FindIndex(p => p.ISACTION == 0);
                            if (action0Index >= 0)
                            {
                                p1.BackColor = Color.FromArgb(252, 228, 214);
                                MES_PD_SCRW_LIST[] data = Fjcclist[panelCount].RwArr.MES_PD_SCRW_LIST;

                                if (Convert.ToInt32(item.Tag) == 1 + panelCount * 100)
                                {
                                    item.Visible = true;
                                }
                                else if (Convert.ToInt32(item.Tag) == 2 + panelCount * 100)
                                {
                                    Label lb = (Label)item;
                                    lb.Visible = true;
                                    lb.Text    = q(Msg_Type.titleth) + data[action0Index].TH.ToString();//"桶号:"
                                }
                                else if (Convert.ToInt32(item.Tag) == 3 + panelCount * 100)
                                {
                                    Label lb = (Label)item;
                                    lb.Visible = true;
                                    lb.Text    = q(Msg_Type.titlepf) + data[action0Index].PFDH;//"配方:"
                                }
                                else if (Convert.ToInt32(item.Tag) == 4 + panelCount * 100)
                                {
                                    Label lb = (Label)item;
                                    lb.Visible = true;
                                    lb.Text    = q(Msg_Type.titlepldh) + data[action0Index].PLDH;//"配料单号:"
                                }
                                else if (Convert.ToInt32(item.Tag) == 5 + panelCount * 100)
                                {
                                    Label lb = (Label)item;
                                    lb.Visible = true;
                                    lb.Text    = q(Msg_Type.titlexfcd) + data[action0Index].XFCDNAME;//"锌粉产地:"
                                }
                                else if (Convert.ToInt32(item.Tag) == 6 + panelCount * 100)
                                {
                                    Label lb = (Label)item;
                                    lb.Visible = true;
                                    lb.Text    = q(Msg_Type.titlexfph) + data[action0Index].XFPC;//"锌粉批号:"
                                }
                                else if (Convert.ToInt32(item.Tag) == 7 + panelCount * 100)
                                {
                                    Label lb = (Label)item;
                                    lb.Visible   = true;
                                    lb.Text      = q(Msg_Type.titlezt) + q(Msg_Type.fieldnotl);//"状态:未投料";
                                    lb.ForeColor = Color.Red;
                                }
                                else if (Convert.ToInt32(item.Tag) == 8 + panelCount * 100)
                                {
                                    item.Visible = false;
                                }
                                else if (Convert.ToInt32(item.Tag) == 9 + panelCount * 100)
                                {
                                    item.Visible = false;
                                }
                                else if (Convert.ToInt32(item.Tag) == 10 + panelCount * 100)
                                {
                                    item.Visible = true;
                                }
                                else if (Convert.ToInt32(item.Tag) == 11 + panelCount * 100)
                                {
                                    Button btn = (Button)item;
                                    btn.Visible = true;
                                    btn.Enabled = false;
                                }
                                continue;
                            }
                        }
                    }

                    panelCount++;
                }
            }
        }
Пример #25
0
        public void SCANSBBH()
        {
            MES_SY_GZZX_SBH model = new MES_SY_GZZX_SBH();

            model.SBBH = smtextBox.Text.Trim();
            MES_SY_GZZX_SBH[] sbhREs = ServicModel.SY_GZZX_SBH.SELECT(model, getToken());
            if (sbhREs.Length == 1)
            {
                MES_SY_GZZX_SBH res = sbhREs[0];
                ini.IniWriteValue(ini.Section_UserInfo, "gzzxvalue", res.GZZXBH);
                ini.IniWriteValue(ini.Section_UserInfo, "gzzxtext", res.GZZXMS);
                ini.IniWriteValue(ini.Section_GC, "value", res.GC);
                MES_SY_GC gcmodel = new MES_SY_GC();
                gcmodel.GC = res.GC;
                MES_SY_GC[] gcres = ServicModel.SY_GC.read(gcmodel, getToken());
                if (gcres.Length == 1)
                {
                    ini.IniWriteValue(ini.Section_GC, "text", gcres[0].GCMS);

                    MES_PD_SCRW rwmodel = new MES_PD_SCRW();
                    rwmodel.SBBH = smtextBox.Text.Trim();;


                    //DateTime currentTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm");
                    //DateTime dt = DateTime.Now;
                    //dt = dt.AddHours(-4);
                    //string a = ServicModel.PUBLIC_FUNC.GET_TIME(getToken());
                    DateTime sy_dt = Convert.ToDateTime(ServicModel.PUBLIC_FUNC.GET_TIME(getToken())).AddHours(-4);
                    //sy_dt = sy_dt.AddHours(-4);
                    //string currentTime = dt.ToString("yyyy-MM-dd");
                    rwmodel.ZPRQ = sy_dt.ToString("yyyy-MM-dd");

                    SELECT_MES_PD_SCRW Smodel = ServicModel.PD_SCRW.SELECT_LAST(rwmodel, getToken());
                    if (Smodel.MES_RETURN.TYPE == "E")
                    {
                        ShowMeg(Smodel.MES_RETURN.MESSAGE);
                    }
                    else
                    {
                        MES_SY_GZZX_WLLB wllbModel = new MES_SY_GZZX_WLLB();
                        wllbModel.WLLBID = Smodel.MES_PD_SCRW_LIST[0].WLLB;
                        wllbModel.GC     = Smodel.MES_PD_SCRW_LIST[0].GC;
                        wllbModel.GZZXBH = Smodel.MES_PD_SCRW_LIST[0].GZZXBH;
                        MES_SY_GZZX_WLLB_SELECT wllbRes = ServicModel.SY_GZZX_WLLB.SELECT(wllbModel, getToken());
                        if (wllbRes.MES_RETURN.TYPE.Equals("S"))
                        {
                            if (wllbRes.MES_SY_GZZX_WLLB != null && wllbRes.MES_SY_GZZX_WLLB.Length == 1)
                            {
                                if (block != null)
                                {
                                    block(Smodel.MES_PD_SCRW_LIST[0], wllbRes.MES_SY_GZZX_WLLB[0].RIGHTID, "", "", 0, this, smtextBox.Text.Trim().ToUpper());
                                    //this.Close();
                                }
                            }
                            else
                            {
                                //ShowMeg("扫描设备号获取任务单权限异常,请联系管理员");
                                ShowMeg(q(Msg_Type.msgrwdroleexcept));
                            }
                        }
                        else
                        {
                            ShowMeg(wllbRes.MES_RETURN.MESSAGE);
                        }
                    }
                }
                else
                {
                    //ShowMeg("扫描的条码得到的不是唯一的工厂名字");
                    ShowMeg(q(Msg_Type.msgtmnoonly));
                }
            }
            else
            {
                //ShowMeg("扫描的条码不是正确设备号");
                ShowMeg(q(Msg_Type.msgscantmnosbh));
            }
        }
Пример #26
0
        public void ChangeRW()
        {
            MES_PD_SCRW model = new MES_PD_SCRW();

            model.RWBH    = smtextBox.Text.Trim().ToUpper();
            model.STAFFID = Convert.ToInt32(getUserInfo("staffid"));
            //model.ZPRQ = DateTime.Now.ToString("yyyy-MM-dd");
            SELECT_MES_PD_SCRW res = ServicModel.PD_SCRW.SELECT_BY_ROLE(model, getToken());

            if (res.MES_RETURN.TYPE.Equals("S"))
            {
                if (res.MES_PD_SCRW_LIST.Length == 1)
                {
                    if (res.MES_PD_SCRW_LIST[0].WLLBNAME.Equals("成品"))
                    {
                        //ShowMeg("成品请扫描<生产入库标识>");
                        ShowMeg(q(Msg_Type.msgcpscanrkbs));
                        return;
                    }
                    MES_SY_GZZX_WLLB wllbModel = new MES_SY_GZZX_WLLB();
                    wllbModel.WLLBID = res.MES_PD_SCRW_LIST[0].WLLB;
                    wllbModel.GC     = res.MES_PD_SCRW_LIST[0].GC;
                    wllbModel.GZZXBH = res.MES_PD_SCRW_LIST[0].GZZXBH;


                    //ini.IniWriteValue(ini.Section_GC, "text", Convert.ToString(gccomboBox.Text.Trim()));
                    MES_SY_GC gc_model = new MES_SY_GC();
                    gc_model.GC = res.MES_PD_SCRW_LIST[0].GC;
                    MES_SY_GC[] gc_res = ServicModel.SY_GC.read(gc_model, getToken());
                    ini.IniWriteValue(ini.Section_UserInfo, "gzzxvalue", res.MES_PD_SCRW_LIST[0].GZZXBH);
                    ini.IniWriteValue(ini.Section_UserInfo, "gzzxtext", res.MES_PD_SCRW_LIST[0].GZZXNAME);
                    ini.IniWriteValue(ini.Section_GC, "value", res.MES_PD_SCRW_LIST[0].GC);
                    ini.IniWriteValue(ini.Section_GC, "text", gc_res[0].GCMS);
                    MES_SY_GZZX_WLLB_SELECT wllbRes = ServicModel.SY_GZZX_WLLB.SELECT(wllbModel, getToken());
                    if (wllbRes.MES_RETURN.TYPE.Equals("S"))
                    {
                        if (wllbRes.MES_SY_GZZX_WLLB != null && wllbRes.MES_SY_GZZX_WLLB.Length == 1)
                        {
                            if (block != null)
                            {
                                block(res.MES_PD_SCRW_LIST[0], wllbRes.MES_SY_GZZX_WLLB[0].RIGHTID, "", "", 0, this, smtextBox.Text.Trim().ToUpper());
                                //this.Close();
                            }
                        }
                        else
                        {
                            //ShowMeg("获取任务单权限异常,请联系管理员");
                            ShowMeg(q(Msg_Type.msgrwdroleexcept));
                        }
                    }
                    else
                    {
                        ShowMeg(wllbRes.MES_RETURN.MESSAGE);
                    }
                }
                else
                {
                    //ShowMeg("获得任务单异常,请联系管理员");
                    ShowMeg(q(Msg_Type.msgrwdroleexcept));
                }
            }
            else
            {
                ShowMeg(res.MES_RETURN.MESSAGE);
            }
        }
Пример #27
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(tlsjtextBox.Text.Trim()))
            {
                ShowMeg(q(Msg_Type.msgtlsjnoempty));//"投料时间不能为空"
                return;
            }
            if (judge.IsDate(tlsjtextBox.Text.Trim()) == false)
            {
                ShowMeg(q(Msg_Type.msgtlsjformat));//"投料时间必须是日期格式"
                return;
            }
            if (string.IsNullOrEmpty(ccsjtextBox.Text.Trim()))
            {
                ShowMeg(q(Msg_Type.msgccsjnoempty));//"产出时间不能为空"
                return;
            }
            if (judge.IsDate(ccsjtextBox.Text.Trim()) == false)
            {
                ShowMeg(q(Msg_Type.msgccsjformat));//"产出时间必须是日期格式"
                return;
            }
            if (string.IsNullOrEmpty(Convert.ToString(cpztcomboBox.SelectedValue)))
            {
                ShowMeg(q(Msg_Type.msgcpztnoempty));//"产品状态不能为空并且是选择的"
                return;
            }
            if (string.IsNullOrEmpty(sbztextBox.Text.Trim()))
            {
                ShowMeg(q(Msg_Type.msgsbznoempty));//"视比重信息不能为空"
                return;
            }
            if (string.IsNullOrEmpty(Convert.ToString(slcomboBox.SelectedValue)))
            {
                ShowMeg(q(Msg_Type.msgslnoempey));//"数量不能为空并且是选择的"
                return;
            }
            if (string.IsNullOrEmpty(czrtextBox.Text.Trim()))
            {
                ShowMeg(q(Msg_Type.msgczrnotempty));//"操作人员不能为空"
                return;
            }

            if (string.IsNullOrEmpty(zsnumericUpDown.Value.ToString()))
            {
                if (Convert.ToInt32(zsnumericUpDown.Value) == 0)
                {
                    ShowMeg(q(Msg_Type.msgprintnoempty));//"打印份数必须大于0"

                    return;
                }
                ShowMeg(q(Msg_Type.msgprintnoempty));//"打印份数不能为空"
                return;
            }


            //public SELECT_MES_PD_SCRW UPDATE_FJCC(MES_PD_SCRW model, string ptoken)
            MES_PD_SCRW model = new MES_PD_SCRW();

            model.GC     = MES_PD_SCRW_LIST.GC;
            model.RWBH   = MES_PD_SCRW_LIST.RWBH;
            model.CCSJ   = ccsjtextBox.Text.Trim();
            model.TLSJ   = tlsjtextBox.Text.Trim();
            model.SBBH   = MES_PD_SCRW_LIST.SBBH;
            model.GZZXBH = MES_PD_SCRW_LIST.GZZXBH;
            //model.TMCOUNT = Convert.ToInt32(zsnumericUpDown.Value);
            model.TMCOUNT = 1;
            model.REMARK  = bzrichTextBox.Text.Trim();
            model.CPZT    = Convert.ToInt32(cpztcomboBox.SelectedValue);
            model.SBZ     = sbztextBox.Text;
            model.JLR     = Convert.ToInt32(getUserInfo("staffid"));
            model.SIZE    = Convert.ToInt32(slcomboBox.SelectedValue);
            //model.CZRGH = czrtextBox.Text.Trim();
            //model.CZRGH = MES_SY_CZR_BYGH.GH;
            model.TMSX = (int)Print_Type.fujilot;
            model.TMLB = 1;
            model.MAC  = DeviceInfo.GetNetCardMAC().Substring(0, 17);
            SELECT_MES_PD_SCRW res = ServicModel.PD_SCRW.UPDATE_FJCC(model, getToken());

            if (res.MES_RETURN.TYPE.Equals("S"))
            {
                string tm = res.TMINFO.SELECT_MES_TM_TMINFO_PRINT[0].MES_TM_TMINFO_LIST.TM;
                Sonluk.UI.Model.MES.TM_TMINFOService.SELECT_MES_TM_TMINFO_PRINT tmList = ServicModel.TM_TMINFO.SELECT_BYID_CHILD(model.GC, tm, getToken());
                if (tmList.MES_RETURN.TYPE.Equals("S"))
                {
                    List <Sonluk.UI.Model.MES.TM_TMINFOService.SELECT_MES_TM_TMINFO_PRINT> tmArr = new List <UI.Model.MES.TM_TMINFOService.SELECT_MES_TM_TMINFO_PRINT>();
                    tmArr.Add(tmList);

                    PrintInfo(Convert.ToInt32(zsnumericUpDown.Value), res.TMINFO.SELECT_MES_TM_TMINFO_PRINT[0].MES_TM_TMINFO_LIST.SIZENAME, "", tmArr.ToArray(), RigthType, Print_Type.fujilot);
                    this.Close();
                }
                else
                {
                    ShowMeg(tmList.MES_RETURN.MESSAGE);
                    return;
                }
            }
            else
            {
                ShowMeg(res.MES_RETURN.MESSAGE);
            }
        }
Пример #28
0
        public void ChangeRW()
        {
            MES_PD_SCRW model = new MES_PD_SCRW();

            model.RWBH = SMtextBox.Text.Trim().ToUpper();
            model.GC   = getGC("value");
            model.SBBH = SBHID;
            SELECT_MES_PD_SCRW res = ServicModel.PD_SCRW.SELECT(model, getToken());

            if (res.MES_RETURN.TYPE.Equals("S"))
            {
                MES_PD_SCRW_LIST list = res.MES_PD_SCRW_LIST[0];
                Tmlist = new List <TMDataGrid>();
                LSdataGridView.DataSource = Tmlist;
                LSdataGridView.Columns[q(Msg_Type.fielddelete)].DisplayIndex = 4;//"删除"
                this._MES_PD_SCRW_LIST = list;
                MES_TM_CZR rymodel = new MES_TM_CZR();
                rymodel.GC   = list.GC;
                rymodel.RWBH = list.RWBH;
                rymodel.CZLB = 1;
                _czrList     = ServicModel.TM_CZR.SELECT_CZR_NOW(rymodel, getToken());
                _bomList     = ServicModel.PD_GD.SAP_GET_GDJGXX(list.RWBH, dateTimePicker1.Text.Trim(), list.GC, getToken());
                unRequireArr = new List <int>();
                MES_SY_TYPEMX bcmodel = new MES_SY_TYPEMX();
                bcmodel.GC     = Convert.ToString(getGC("value"));
                bcmodel.TYPEID = 5;
                List <MES_SY_TYPEMXLIST> bcArr  = new List <MES_SY_TYPEMXLIST>();
                MES_SY_TYPEMXLIST[]      bclist = ServicModel.SY_TYPEMX.SELECT(bcmodel, getToken());
                gzzxtextBox.Text = list.GZZXBH + "-" + list.GZZXNAME;
                czrytextBox.Text = _czrList.CZR;
                gctextBox.Text   = list.GC;
                sbhtextBox.Text  = list.SBH;
                pctextBox.Text   = list.PC;
                bcArr            = bclist.ToList();
                MES_SY_TYPEMXLIST bcmodel1 = new MES_SY_TYPEMXLIST();
                bcmodel1.ID     = 0;
                bcmodel1.MXNAME = q(Msg_Type.titlechoice);//"==请选择==";
                bcArr.Insert(0, bcmodel1);
                bccomboBox.DisplayMember = "MXNAME";
                bccomboBox.ValueMember   = "ID";
                bccomboBox.DataSource    = bcArr;
                bccomboBox.SelectedValue = list.BC;
                MESlabel.Text            = q(Msg_Type.titlemesgd) + list.GDDH;                 //"MES工单:"
                GDHlabel.Text            = q(Msg_Type.titlegd) + list.ERPNO;                   //"工单号:"
                WLXXlabel.Text           = q(Msg_Type.titlewlxx) + list.WLH + "/" + list.WLMS; //"物料信息:"
                WLLBlabel1.Text          = q(Msg_Type.titlewllb) + list.WLLBNAME;              //"物料类别:"
                rwdlabel.Text            = q(Msg_Type.titlerwd) + list.RWBH;                   //"任务单:"
                if (_bomList.MES_RETURN.TYPE.Equals("S"))
                {
                    BOMdataGridView.DataSource = getBomList(_bomList);
                }
                else
                {
                    ShowMeg(_bomList.MES_RETURN.MESSAGE);
                    BOMdataGridView.DataSource = new List <BomDataGrid>();
                }
                //scrqtextBox.Text = DateTime.Now.ToString("yyyy-MM-dd");
                LSdataGridView.ReadOnly = true;
                BOMdataGridView.Columns[q(Msg_Type.fieldstatus)].DefaultCellStyle.BackColor = Color.Red;//"状态"
                for (int i = 0; i < unRequireArr.Count; i++)
                {
                    BOMdataGridView.Rows[unRequireArr[i]].Cells[q(Msg_Type.fieldstatus)].Style.BackColor = Color.White;//"状态"
                }
                //SELECT_MES_TM_TMINFO_BYTM r = ServicModel.TM_TMINFO.SELECT_TL_LAST(MES_PD_SCRW_LIST.RWBH, getToken());
                //if (r.MES_RETURN.TYPE.Equals("S"))
                //{
                //    getTMList(r, 0);
                //}
                Tmlist = new List <TMDataGrid>();
                LSdataGridView.DataSource = new List <TMDataGrid>();
                LSdataGridView.ClearSelection();
                LSdataGridView.Columns[q(Msg_Type.fielddelete)].DisplayIndex = 4;//"删除"
                BOMdataGridView.ClearSelection();
                if (RigthType == Rigth_Type.mfqqingxi)
                {
                    GDHlabel.Visible   = false;
                    WLXXlabel.Location = GDHlabel.Location;
                }
            }
            else
            {
                //MessageBox.Show(SMtextBox.Text + res.MES_RETURN.MESSAGE, "消息框");
                ShowMeg(SMtextBox.Text + res.MES_RETURN.MESSAGE);
            }
            SMtextBox.Clear();
            SMtextBox.Select();
        }
Пример #29
0
        public void configUI(MES_SY_GZZX_SBH[] model)
        {
            totalpanel.Controls.Clear();
            Fjcclist         = new List <FJCClist>();
            IndexList        = new List <int>();
            Sbhlist          = model;
            gctextBox.Text   = getGC("text");
            gzzxtextBox.Text = getUserInfo("gzzxtext");
            rqtextBox.Text   = GetSystemDate(Date_Type.hour, -4, "yyyy-MM-dd");
            for (int i = 0; i < Sbhlist.Length; i++)
            {
                FJCClist    list    = new FJCClist();
                MES_PD_SCRW pd_scrw = new MES_PD_SCRW();
                pd_scrw.SBBH = Sbhlist[i].SBBH;
                pd_scrw.GC   = getGC("value");
                //pd_scrw.GZZXBH = getUserInfo("gzzxvalue");
                pd_scrw.ZPRQ = rqtextBox.Text;
                SELECT_MES_PD_SCRW Smodel = ServicModel.PD_SCRW.SELECT(pd_scrw, getToken());
                if (Smodel.MES_RETURN.TYPE.Equals("S"))
                {
                    list.RwArr = Smodel;
                }
                else
                {
                    list.RwArr = new SELECT_MES_PD_SCRW();
                }
                list.SbStruct = Sbhlist[i];
                Fjcclist.Add(list);
            }
            for (int i = 0; i < Fjcclist.Count; i++)
            {
                Panel p1 = new Panel();
                p1.Location = new Point(i % 3 * (400), i / 3 * (rect.Height * 4 / 10) - 20 * (i / 3));
                p1.Size     = new Size(400, rect.Height * 4 / 10 - 20);
                if (Fjcclist[i].RwArr.MES_PD_SCRW_LIST == null)
                {
                    Label sbh_lb = new Label();
                    Label lb     = new Label();
                    factory.configLabel(sbh_lb, new Size(60, 35), new Point(10, 10), new Font(q(Msg_Type.fonttype), 29), Fjcclist[i].SbStruct.SBMS);
                    factory.configLabel(lb, new Size(300, 35), new Point(20, 120), new Font(q(Msg_Type.fonttype), 20), q(Msg_Type.msgsbnorwd));//"设备没有派单任务"
                    p1.Controls.Add(lb);
                    p1.Controls.Add(sbh_lb);
                    p1.BorderStyle = BorderStyle.FixedSingle;
                    p1.BackColor   = Color.FromArgb(252, 228, 214);
                    totalpanel.Controls.Add(p1);
                }
                else
                {
                    int  flag   = 0;
                    int  finish = 0;
                    bool isRw   = false;
                    for (int j = 0; j < Fjcclist[i].RwArr.MES_PD_SCRW_LIST.Length; j++)
                    {
                        if (Fjcclist[i].RwArr.MES_PD_SCRW_LIST[j].ISACTION == 1)
                        {
                            flag = j;
                            isRw = true;
                            break;
                        }
                        else if (Fjcclist[i].RwArr.MES_PD_SCRW_LIST[j].ISACTION == 2)
                        {
                            finish++;
                        }
                    }
                    if (isRw == false)
                    {
                        for (int j = 0; j < Fjcclist[i].RwArr.MES_PD_SCRW_LIST.Length; j++)
                        {
                            if (Fjcclist[i].RwArr.MES_PD_SCRW_LIST[j].ISACTION == 0)
                            {
                                flag = j;
                                break;
                            }
                        }
                    }
                    IndexList.Add(flag);
                    MES_PD_SCRW_LIST data   = Fjcclist[i].RwArr.MES_PD_SCRW_LIST[flag];
                    Label            sbh_lb = new Label();
                    sbh_lb.Tag = i * 10 + 3;
                    p1.Controls.Add(sbh_lb);
                    factory.configLabel(sbh_lb, new Size(60, 35), new Point(10, 10), new Font(q(Msg_Type.fonttype), 29), data.SBH.ToString());
                    Button qd_btn = new Button();
                    qd_btn.FlatStyle = FlatStyle.Popup;
                    qd_btn.Click    += new System.EventHandler(this.btn_Click);
                    int magrin    = p1.Size.Height / 9;
                    int magrin1   = p1.Size.Height / 15;
                    int btnheight = 0;
                    if (p1.Size.Height > 225)
                    {
                        btnheight = p1.Size.Height - 50 - 30;
                    }
                    else
                    {
                        btnheight = p1.Size.Height - 50 - 10;
                    }

                    factory.configButton(qd_btn, new Size(130, 50), new Point(20, btnheight), q(Msg_Type.fieldrwqd), i * 10 + 1);//"任务清单"
                    p1.Controls.Add(qd_btn);
                    p1.BackColor = Color.FromArgb(252, 228, 214);
                    if (Fjcclist[i].RwArr.MES_PD_SCRW_LIST.Length == finish)
                    {
                        Label lb = new Label();
                        factory.configLabel(lb, new Size(300, 35), new Point(20, 120), new Font(q(Msg_Type.fonttype), 20), q(Msg_Type.fieldtodayrwfinish));//"今天的任务已经完成"
                        p1.Controls.Add(lb);
                    }
                    else
                    {
                        Label th_lb = new Label();
                        Label pf_lb = new Label();
                        Label pl_lb = new Label();
                        Label cd_lb = new Label();
                        Label zf_lb = new Label();
                        Label zt_lb = new Label();
                        th_lb.Tag = i * 10 + 4;
                        pf_lb.Tag = i * 10 + 5;
                        pl_lb.Tag = i * 10 + 6;
                        cd_lb.Tag = i * 10 + 7;
                        zf_lb.Tag = i * 10 + 8;


                        Button lot_btn = new Button();

                        if (data.ISACTION == 0)
                        {
                            lot_btn.Enabled = false;
                        }

                        //ShowMeg(p1.Size.Height.ToString());
                        factory.configLabel(th_lb, new Size(400, 20), new Point(70, magrin1), q(Msg_Type.titleth) + data.TH);                      //"桶号:"
                        factory.configLabel(pf_lb, new Size(400, 20), new Point(70, magrin1 + magrin * 1), q(Msg_Type.titlepfdh) + data.PFDH);     //"配方单号:"
                        factory.configLabel(pl_lb, new Size(400, 20), new Point(70, magrin1 + magrin * 2), q(Msg_Type.titlepldh) + data.PLDH);     //"配料单号:"
                        factory.configLabel(cd_lb, new Size(400, 20), new Point(70, magrin1 + magrin * 3), q(Msg_Type.titlexfcd) + data.XFCDNAME); //"锌粉产地:"
                        factory.configLabel(zf_lb, new Size(400, 20), new Point(70, magrin1 + magrin * 4), q(Msg_Type.titlexfph) + data.XFPC);     //"锌粉批号:"
                        string zt = "";

                        if (data.ISACTION == 0)
                        {
                            zt = q(Msg_Type.fieldnotl);//"未投料";
                            zt_lb.ForeColor = Color.Red;
                        }
                        else if (data.ISACTION == 1)
                        {
                            zt           = q(Msg_Type.fieldytl);//"已投料";
                            p1.BackColor = Color.FromArgb(146, 208, 80);
                        }
                        else if (data.ISACTION == 2)
                        {
                            zt = q(Msg_Type.fieldycc);                                                                                  //"已产出";
                        }
                        factory.configLabel(zt_lb, new Size(400, 20), new Point(70, magrin1 + magrin * 5), q(Msg_Type.fieldtlzt) + zt); //"投料状态:"

                        lot_btn.FlatStyle = FlatStyle.Popup;                                                                            //10 + 31 * 5 + 40

                        //factory.configButton(lot_btn, new Size(130, 50), new Point(170, 10 + 31 * 5 + 40), "打印LOT表", i * 10 + 2);
                        factory.configButton(lot_btn, new Size(130, 50), new Point(170, btnheight), q(Msg_Type.fielddylot), i * 10 + 2);//"打印LOT表"
                        lot_btn.Click += new System.EventHandler(this.btn_Click);
                        p1.Controls.Add(zt_lb);

                        p1.Controls.Add(th_lb);
                        p1.Controls.Add(pf_lb);
                        p1.Controls.Add(pl_lb);
                        p1.Controls.Add(cd_lb);
                        p1.Controls.Add(zf_lb);

                        p1.Controls.Add(lot_btn);
                    }
                    p1.BorderStyle = BorderStyle.FixedSingle;
                    p1.Tag         = 100 + i;
                    totalpanel.Controls.Add(p1);
                }
            }
            //for (int i = 0; i < Sbhlist.Length; i++)
            //{
            //    FJCClist list = new FJCClist();
            //    MES_PD_SCRW pd_scrw = new MES_PD_SCRW();
            //    pd_scrw.SBBH = Sbhlist[i].SBBH;
            //    pd_scrw.GC = getGC("value");
            //    pd_scrw.GZZXBH = getUserInfo("gzzxvalue");
            //    SELECT_MES_PD_SCRW Smodel = ServicModel.PD_SCRW.SELECT(pd_scrw, getToken());
            //    if (Smodel.MES_RETURN.TYPE.Equals("S"))
            //    {
            //        list.SbStruct = Sbhlist[i];
            //        list.RwArr = Smodel;
            //        Fjcclist.Add(list);
            //    }
            //}
            //for (int i = 0; i < Fjcclist.Count; i++)
            //{
            //    int flag = 0;
            //    int length = 0;
            //    for (int j = 0; j < Fjcclist[i].RwArr.MES_PD_SCRW_LIST.Length; j++)
            //    {
            //        if (Fjcclist[i].RwArr.MES_PD_SCRW_LIST[j].ISACTION == 1)
            //        {
            //            flag = j;

            //            break;
            //        }
            //        if (Fjcclist[i].RwArr.MES_PD_SCRW_LIST[j].ISACTION == 0)
            //        {
            //            length++;
            //        }

            //    }
            //    if (flag == 0)
            //    {
            //        if (length < Fjcclist[i].RwArr.MES_PD_SCRW_LIST.Length && length != 0)
            //        {
            //            for (int j = 0; j < Fjcclist[i].RwArr.MES_PD_SCRW_LIST.Length; j++)
            //            {
            //                if (Fjcclist[i].RwArr.MES_PD_SCRW_LIST[j].ISACTION == 2)
            //                {
            //                    flag = j;

            //                }

            //            }
            //            if (Fjcclist[i].RwArr.MES_PD_SCRW_LIST.Length - 1 == flag)
            //            {
            //                flag = Fjcclist[i].RwArr.MES_PD_SCRW_LIST.Length - 1;
            //            }
            //            else
            //            {
            //                flag += 1;
            //            }

            //        }
            //        else
            //        {
            //            flag = 0;
            //        }
            //    }
            //    IndexList.Add(flag);
            //    Panel p1 = new Panel();
            //    p1.Location = new Point(i % 3 * (totalpanel.Bounds.Width / 3), i / 3 * 350);
            //    p1.Size = new Size(totalpanel.Bounds.Width / 3, 350);
            //    Label sbh_lb = new Label();
            //    Label th_lb = new Label();
            //    Label pf_lb = new Label();
            //    Label pl_lb = new Label();
            //    Label cd_lb = new Label();
            //    Label zf_lb = new Label();
            //    Label zt_lb = new Label();
            //    sbh_lb.Tag = i * 10 + 3;
            //    th_lb.Tag = i * 10 + 4;
            //    pf_lb.Tag = i * 10 + 5;
            //    pl_lb.Tag = i * 10 + 6;
            //    cd_lb.Tag = i * 10 + 7;
            //    zf_lb.Tag = i * 10 + 8;

            //    Button qd_btn = new Button();
            //    Button lot_btn = new Button();
            //    MES_PD_SCRW_LIST data = Fjcclist[i].RwArr.MES_PD_SCRW_LIST[flag];
            //    //if (data.ISACTION == 0)
            //    //{
            //    //    lot_btn.Enabled = false;
            //    //}
            //    factory.configLabel(sbh_lb, new Size(100, 35), new Point(30, 30), new Font(q(Msg_Type.fonttype), 29), data.SBH.ToString());
            //    factory.configLabel(th_lb, new Size(400, 20), new Point(100, 70), "桶号:" + data.TH);
            //    factory.configLabel(pf_lb, new Size(400, 20), new Point(100, 70 + 31), "配方单号:" + data.PFDH);
            //    factory.configLabel(pl_lb, new Size(400, 20), new Point(100, 70 + 31 * 2), "配料单号:" + data.PLDH);
            //    factory.configLabel(cd_lb, new Size(400, 20), new Point(100, 70 + 31 * 3), "锌粉产地:" + data.XFCDNAME);
            //    factory.configLabel(zf_lb, new Size(400, 20), new Point(100, 70 + 31 * 4), "锌粉批号:" + data.XFPC);
            //    string zt = "";
            //    p1.BackColor = Color.FromArgb(252, 228, 214);
            //    if (data.ISACTION == 0)
            //    {
            //        zt = "未投料";
            //        zt_lb.ForeColor = Color.Red;

            //    }
            //    else if (data.ISACTION == 1)
            //    {
            //        zt = "已投料";
            //        p1.BackColor = Color.FromArgb(146, 208, 80);
            //    }
            //    else if (data.ISACTION == 2)
            //    {
            //        zt = "已产出";

            //    }
            //    factory.configLabel(zt_lb, new Size(400, 20), new Point(100, 70 + 31 * 5), "投料状态:" + zt);
            //    qd_btn.FlatStyle = FlatStyle.Popup;
            //    lot_btn.FlatStyle = FlatStyle.Popup;
            //    factory.configButton(qd_btn, new Size(130, 50), new Point(100, 70 + 31 * 5 + 40), "任务清单", i * 10 + 1);
            //    factory.configButton(lot_btn, new Size(130, 50), new Point(270, 70 + 31 * 5 + 40), "打印LOT表", i * 10 + 2);
            //    qd_btn.Click += new System.EventHandler(this.btn_Click);
            //    lot_btn.Click += new System.EventHandler(this.btn_Click);
            //    //if (i % 4 == 0 || i % 4 == 3)
            //    //{
            //    //    p1.BackColor = Color.FromArgb(146, 208, 80);
            //    //}
            //    //else
            //    //{

            //        p1.BorderStyle = BorderStyle.FixedSingle;
            //    //}
            //    p1.Tag = 100 + i;
            //    p1.Controls.Add(zt_lb);
            //    p1.Controls.Add(sbh_lb);
            //    p1.Controls.Add(th_lb);
            //    p1.Controls.Add(pf_lb);
            //    p1.Controls.Add(pl_lb);
            //    p1.Controls.Add(cd_lb);
            //    p1.Controls.Add(zf_lb);
            //    p1.Controls.Add(qd_btn);
            //    p1.Controls.Add(lot_btn);
            //    totalpanel.Controls.Add(p1);
            //}
        }
Пример #30
0
        public void configUI_N(MES_SY_GZZX_SBH[] model)
        {
            totalpanel.Controls.Clear();
            Fjcclist         = new List <FJCClist>();
            IndexList        = new List <int>();
            Sbhlist          = model;
            gctextBox.Text   = getGC("text");
            gzzxtextBox.Text = getUserInfo("gzzxtext");
            rqtextBox.Text   = GetSystemDate(Date_Type.hour, -4, "yyyy-MM-dd");//Convert.ToDateTime(ServicModel.PUBLIC_FUNC.GET_TIME(getToken())).AddHours(-4).ToString("yyyy-MM-dd");
            for (int i = 0; i < Sbhlist.Length; i++)
            {
                FJCClist    list    = new FJCClist();
                MES_PD_SCRW pd_scrw = new MES_PD_SCRW();
                pd_scrw.SBBH = Sbhlist[i].SBBH;
                pd_scrw.GC   = getGC("value");
                //pd_scrw.GZZXBH = getUserInfo("gzzxvalue");
                pd_scrw.ZPRQ = rqtextBox.Text;
                SELECT_MES_PD_SCRW Smodel = ServicModel.PD_SCRW.SELECT(pd_scrw, getToken());
                if (Smodel.MES_RETURN.TYPE.Equals("S"))
                {
                    list.RwArr = Smodel;
                }
                else
                {
                    list.RwArr = new SELECT_MES_PD_SCRW();
                }
                list.SbStruct = Sbhlist[i];
                Fjcclist.Add(list);
            }
            for (int i = 0; i < Fjcclist.Count; i++)
            {
                Panel p1 = new Panel();
                p1.Location = new Point(i % 3 * (400), i / 3 * (rect.Height * 4 / 10) - 20 * (i / 3));
                p1.Size     = new Size(400, rect.Height * 4 / 10 - 20);

                int magrin    = p1.Size.Height / 9;
                int magrin1   = p1.Size.Height / 15;
                int btnheight = 0;
                if (p1.Size.Height > 225)
                {
                    btnheight = p1.Size.Height - 50 - 30;
                }
                else
                {
                    btnheight = p1.Size.Height - 50 - 10;
                }


                Label lb_sbh = new Label();
                lb_sbh.Tag = 1 + i * 100;
                Label lb_th = new Label();
                lb_th.Tag = 2 + i * 100;
                Label lb_pfdh = new Label();
                lb_pfdh.Tag = 3 + i * 100;
                Label lb_pldh = new Label();
                lb_pldh.Tag = 4 + i * 100;
                Label lb_xfcd = new Label();
                lb_xfcd.Tag = 5 + i * 100;
                Label lb_xfph = new Label();
                lb_xfph.Tag = 6 + i * 100;
                Label lb_tlzt = new Label();
                lb_tlzt.Tag = 7 + i * 100;
                Label lb_rwNone = new Label();
                lb_rwNone.Tag = 8 + i * 100;
                Label lb_rwFinish = new Label();
                lb_rwFinish.Tag = 9 + i * 100;
                Button btn_rwqd = new Button();
                //btn_rwqd.Tag = 10 + i * 100;
                Button btn_dylot = new Button();
                //btn_dylot.Tag = 11 + i * 100;
                factory.configLabel(lb_sbh, new Size(60, 40), new Point(10, magrin1), new Font(q(Msg_Type.fonttype), 29), Fjcclist[i].SbStruct.SBMS);
                factory.configLabel(lb_th, new Size(400, 30), new Point(70, magrin1 + magrin * 1 + 10), new Font(q(Msg_Type.fonttype), 22), q(Msg_Type.titleth));   //"桶号:"
                factory.configLabel(lb_pfdh, new Size(400, 30), new Point(70, magrin1 + magrin * 1 + 60), new Font(q(Msg_Type.fonttype), 22), q(Msg_Type.titlepf)); //"配方:"
                //factory.configLabel(lb_pldh, new Size(400, 20), new Point(70, magrin1 + magrin * 2), "配料单号:");
                //factory.configLabel(lb_xfcd, new Size(400, 20), new Point(70, magrin1 + magrin * 3), "锌粉产地:");
                //factory.configLabel(lb_xfph, new Size(400, 20), new Point(70, magrin1 + magrin * 4), "锌粉批号:");
                factory.configLabel(lb_tlzt, new Size(400, 30), new Point(70, magrin1 + magrin * 1 + 110), new Font(q(Msg_Type.fonttype), 22), q(Msg_Type.titlezt)); //"状态:"
                factory.configLabel(lb_rwNone, new Size(300, 35), new Point(20, 120), new Font(q(Msg_Type.fonttype), 20), q(Msg_Type.msgsbnorwd));                   //"设备没有派单任务"
                factory.configLabel(lb_rwFinish, new Size(300, 35), new Point(20, 120), new Font(q(Msg_Type.fonttype), 20), q(Msg_Type.fieldtodayrwfinish));         //"今天的任务已经完成"
                factory.configButton(btn_rwqd, new Size(130, 50), new Point(20, btnheight), q(Msg_Type.fieldrwqd), 10 + i * 100);                                    //"任务清单"
                btn_rwqd.Click    += new System.EventHandler(this.btn_Click);
                btn_rwqd.FlatStyle = FlatStyle.Popup;
                factory.configButton(btn_dylot, new Size(130, 50), new Point(170, btnheight), q(Msg_Type.fielddylot), 11 + i * 100);//"打印LOT表"
                btn_dylot.Click    += new System.EventHandler(this.btn_Click);
                btn_dylot.FlatStyle = FlatStyle.Popup;
                p1.Controls.Add(lb_sbh);
                p1.Controls.Add(lb_th);
                p1.Controls.Add(lb_pfdh);
                //p1.Controls.Add(lb_pldh);
                //p1.Controls.Add(lb_xfcd);
                //p1.Controls.Add(lb_xfph);
                p1.Controls.Add(lb_tlzt);
                p1.Controls.Add(lb_rwNone);
                p1.Controls.Add(lb_rwFinish);
                p1.Controls.Add(btn_rwqd);
                p1.Controls.Add(btn_dylot);
                p1.Tag         = 1000 + i;
                p1.BackColor   = Color.FromArgb(252, 228, 214);
                p1.BorderStyle = BorderStyle.FixedSingle;
                totalpanel.Controls.Add(p1);
                if (Fjcclist[i].RwArr.MES_PD_SCRW_LIST == null)
                {
                    lb_th.Visible       = false;
                    lb_pfdh.Visible     = false;
                    lb_pldh.Visible     = false;
                    lb_xfcd.Visible     = false;
                    lb_xfph.Visible     = false;
                    lb_tlzt.Visible     = false;
                    lb_rwFinish.Visible = false;
                    btn_dylot.Visible   = false;
                    btn_rwqd.Visible    = false;
                    IndexList.Add(-2);
                }
                else
                {
                    if (Fjcclist[i].RwArr.MES_PD_SCRW_LIST.Length == Fjcclist[i].RwArr.MES_PD_SCRW_LIST.Count(p => p.ISACTION == 2))
                    {
                        lb_th.Visible     = false;
                        lb_pfdh.Visible   = false;
                        lb_pldh.Visible   = false;
                        lb_xfcd.Visible   = false;
                        lb_xfph.Visible   = false;
                        lb_tlzt.Visible   = false;
                        lb_rwNone.Visible = false;
                        btn_dylot.Visible = false;
                        IndexList.Add(-1);
                        continue;
                    }
                    ;
                    int action1Index = Fjcclist[i].RwArr.MES_PD_SCRW_LIST.ToList().FindIndex(p => p.ISACTION == 1);
                    if (action1Index >= 0)
                    {
                        p1.BackColor = Color.FromArgb(146, 208, 80);
                        MES_PD_SCRW_LIST[] data = Fjcclist[i].RwArr.MES_PD_SCRW_LIST;
                        lb_rwNone.Visible   = false;
                        lb_rwFinish.Visible = false;
                        lb_th.Text          = lb_th.Text + data[action1Index].TH.ToString();
                        lb_pfdh.Text        = lb_pfdh.Text + data[action1Index].PFDH;
                        lb_pldh.Text        = lb_pldh.Text + data[action1Index].PLDH;
                        lb_xfcd.Text        = lb_xfcd.Text + data[action1Index].XFCDNAME;
                        lb_xfph.Text        = lb_xfph.Text + data[action1Index].XFPC;
                        lb_tlzt.Text        = lb_tlzt.Text + q(Msg_Type.fieldytl);//"已投料"
                        IndexList.Add(action1Index);
                        continue;
                    }
                    int action0Index = Fjcclist[i].RwArr.MES_PD_SCRW_LIST.ToList().FindIndex(p => p.ISACTION == 0);
                    if (action0Index >= 0)
                    {
                        MES_PD_SCRW_LIST[] data = Fjcclist[i].RwArr.MES_PD_SCRW_LIST;
                        lb_rwNone.Visible   = false;
                        lb_rwFinish.Visible = false;
                        btn_dylot.Enabled   = false;
                        lb_th.Text          = lb_th.Text + data[action0Index].TH.ToString();
                        lb_pfdh.Text        = lb_pfdh.Text + data[action0Index].PFDH;
                        lb_pldh.Text        = lb_pldh.Text + data[action0Index].PLDH;
                        lb_xfcd.Text        = lb_xfcd.Text + data[action0Index].XFCDNAME;
                        lb_xfph.Text        = lb_xfph.Text + data[action0Index].XFPC;
                        lb_tlzt.Text        = lb_tlzt.Text + q(Msg_Type.fieldnotl);//"未投料"
                        lb_tlzt.ForeColor   = Color.Red;
                        IndexList.Add(action0Index);
                        continue;
                    }
                }
            }
        }