Пример #1
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();
        }
Пример #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 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();
            //}
        }
Пример #4
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();
        }
Пример #5
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();
            }
        }
Пример #6
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();
        }
Пример #7
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();
            }
        }
Пример #8
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();
         //}
     }
 }