예제 #1
0
        private void gzzxcomboBox_SelectedValueChanged(object sender, EventArgs e)
        {
            ComboBox cb  = (ComboBox)sender;
            object   obj = cb.SelectedValue;

            if (obj is string)
            {
                MES_SY_GZZX_SBH model = new MES_SY_GZZX_SBH();
                model.GZZXBH = Convert.ToString(gzzxcomboBox.SelectedValue);
                model.GC     = Convert.ToString(gccomboBox.SelectedValue);
                //model.WLLB = Gzzxlb;
                //model.WLLBNAME = Wllb;

                MES_SY_GZZX_SBH[]      list    = ServicModel.SY_GZZX_SBH.SELECT(model, getToken());
                List <MES_SY_GZZX_SBH> sbhlist = list.ToList();
                MES_SY_GZZX_SBH        model1  = new MES_SY_GZZX_SBH();
                model1.SBBH = "0";
                model1.SBMS = q(Msg_Type.titlechoice);//"==请选择==";
                sbhlist.Insert(0, model1);

                sbhcomboBox.DataSource    = sbhlist;
                sbhcomboBox.ValueMember   = "SBBH";
                sbhcomboBox.DisplayMember = "SBMS";
                if (sbhlist.Count == 2)
                {
                    sbhcomboBox.SelectedValue = sbhlist[1].SBBH;
                }
            }
        }
예제 #2
0
        public ActionResult TM_DELETE()
        {
            AppClass.SetSession("location", 158);
            string        token               = AppClass.GetSession("token").ToString();
            int           STAFFID             = Convert.ToInt32(AppClass.GetSession("STAFFID"));
            MODEL_MES_ALL model_MODEL_MES_ALL = new MODEL_MES_ALL();
            MES_SY_GC     model_MES_SY_GC     = new MES_SY_GC();

            model_MES_SY_GC.STAFFID = STAFFID;
            MES_SY_GC[] MES_SY_GC_list = mesModels.SY_GC.SELECT_BY_ROLE(model_MES_SY_GC, token);
            model_MODEL_MES_ALL.MES_SY_GC = MES_SY_GC_list;
            model_MODEL_MES_ALL.GCCOUNT   = MES_SY_GC_list.Length;
            model_MODEL_MES_ALL.GZZXCOUNT = 0;
            if (model_MODEL_MES_ALL.GCCOUNT == 1)
            {
                MES_SY_GZZX model_MES_SY_GZZX = new MES_SY_GZZX();
                model_MES_SY_GZZX.GC      = MES_SY_GC_list[0].GC;
                model_MES_SY_GZZX.STAFFID = STAFFID;
                MES_SY_GZZX[] rst_MES_SY_GZZX = mesModels.SY_GZZX.SELECT_BY_ROLE(model_MES_SY_GZZX, token);
                model_MODEL_MES_ALL.MES_SY_GZZX = rst_MES_SY_GZZX;
                model_MODEL_MES_ALL.GZZXCOUNT   = rst_MES_SY_GZZX.Length;
            }
            model_MODEL_MES_ALL.SBHCOUNT = 0;
            if (model_MODEL_MES_ALL.GZZXCOUNT == 1)
            {
                MES_SY_GZZX_SBH model_MES_SY_GZZX_SBH = new MES_SY_GZZX_SBH();
                model_MES_SY_GZZX_SBH.GC     = model_MODEL_MES_ALL.MES_SY_GC[0].GC;
                model_MES_SY_GZZX_SBH.GZZXBH = model_MODEL_MES_ALL.MES_SY_GZZX[0].GZZXBH;
                MES_SY_GZZX_SBH[] rst_MES_SY_GZZX_SBH = mesModels.SY_GZZX_SBH.SELECT(model_MES_SY_GZZX_SBH, token);
                model_MODEL_MES_ALL.MES_SY_GZZX_SBH = rst_MES_SY_GZZX_SBH;
                model_MODEL_MES_ALL.SBHCOUNT        = rst_MES_SY_GZZX_SBH.Length;
            }
            ViewData.Model = model_MODEL_MES_ALL;
            return(View());
        }
예제 #3
0
        public string SBList(string GC, string GZZXBH)
        {
            MES_SY_GZZX_SBH model = new MES_SY_GZZX_SBH();

            model.GC     = GC;
            model.GZZXBH = GZZXBH;
            return(AppClass.EasyCall <MES_SY_GZZX_SBH, MES_SY_GZZX_SBH[]>(model, mesModels.SY_GZZX_SBH.SELECT));
        }
예제 #4
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(gzzxcomboBox.Text))
            {
                //MessageBox.Show("工作中心不能为空!!!", "消息框");
                ShowMeg(q(Msg_Type.msggzzxnoempty));
                return;
            }
            if (string.IsNullOrEmpty(gccomboBox.Text))
            {
                //MessageBox.Show("工厂不能为空!!!", "消息框");
                ShowMeg(q(Msg_Type.msggcnoempty));
                return;
            }

            MES_SY_GZZX_SBH model = new MES_SY_GZZX_SBH();

            if (RigthType != Rigth_Type.zhujizhengjitl)
            {
                model.GZZXBH = Convert.ToString(gzzxcomboBox.SelectedValue);
            }
            model.GC       = Convert.ToString(gccomboBox.SelectedValue);
            model.WLLBNAME = Wllb;
            MES_SY_GZZX_SBH[] list = ServicModel.SY_GZZX_SBH.SELECT(model, getToken());
            if (list.Length == 0)
            {
                //MessageBox.Show("没有找到工厂是" + gccomboBox.Text + "工作中心是" + gzzxcomboBox.Text + "对应的设备号");
                ShowMeg(string.Format(q(Msg_Type.msgnosbh), gccomboBox.Text, gzzxcomboBox.Text));
                return;
            }
            else
            {
                if (gzzxcomboBox.Visible)
                {
                    ini.IniWriteValue(ini.Section_UserInfo, "gzzxvalue", Convert.ToString(gzzxcomboBox.SelectedValue));
                    ini.IniWriteValue(ini.Section_UserInfo, "gzzxtext", gzzxcomboBox.Text.Trim());
                }

                ini.IniWriteValue(ini.Section_GC, "value", Convert.ToString(gccomboBox.SelectedValue));
                ini.IniWriteValue(ini.Section_GC, "text", Convert.ToString(gccomboBox.Text.Trim()));
                //frmFindSBH form = new frmFindSBH(list, gzzxcomboBox.Text);
                //push(form);
                if (getSBHinfo != null)
                {
                    if (gzzxcomboBox.Visible)
                    {
                        getSBHinfo(list, Convert.ToString(gzzxcomboBox.SelectedValue), this, RigthType);
                    }
                    else
                    {
                        getSBHinfo(list, "", this, RigthType);
                    }

                    //this.Close();
                }
            }
        }
예제 #5
0
        public string GET_GZZX_SBH_BYSBNO(string in_sm)
        {
            TokenINFO rst_TokenINFO = GET_TokenINFO();
            //string token = AppClass.GetSession("token").ToString();
            MES_SY_GZZX_SBH model_MES_SY_GZZX_SBH = new MES_SY_GZZX_SBH();

            model_MES_SY_GZZX_SBH.SBNO = in_sm;
            MES_SY_GZZX_SBH[] rst_MES_SY_GZZX_SBH = mesmodels.SY_GZZX_SBH.SELECT(model_MES_SY_GZZX_SBH, rst_TokenINFO.Token);
            return(Newtonsoft.Json.JsonConvert.SerializeObject(rst_MES_SY_GZZX_SBH));
        }
예제 #6
0
        public MES_RETURN_UI UPDATE(MES_SY_GZZX_SBH model, string ptoken)
        {
            MES_RETURN    mr   = client.UPDATE(model, ptoken);
            MES_RETURN_UI mrui = new MES_RETURN_UI();

            mrui.TYPE    = mr.TYPE;
            mrui.MESSAGE = mr.MESSAGE;
            return(mrui);
            //return client.UPDATE(model, ptoken);
        }
예제 #7
0
        private void gzzxcomboBox_SelectedValueChanged(object sender, EventArgs e)
        {
            ComboBox cb  = (ComboBox)sender;
            object   obj = cb.SelectedValue;

            if (obj is string)
            {
                MES_SY_GZZX_SBH model = new MES_SY_GZZX_SBH();
                model.GZZXBH = Convert.ToString(gzzxcomboBox.SelectedValue);
                model.GC     = Convert.ToString(MES_SY_MATERIAL_LIST.GC);
                //model.WLLB = Gzzxlb;
                //model.WLLBNAME = Wllb;

                MES_SY_GZZX_SBH[]      list    = ServicModel.SY_GZZX_SBH.SELECT(model, getToken());
                List <MES_SY_GZZX_SBH> sbhlist = list.ToList();
                MES_SY_GZZX_SBH        model1  = new MES_SY_GZZX_SBH();
                model1.SBBH = "0";
                model1.SBMS = q(Msg_Type.titlechoice);//"==请选择==";
                sbhlist.Insert(0, model1);
                sbhcomboBox3.DataSource    = sbhlist;
                sbhcomboBox3.ValueMember   = "SBBH";
                sbhcomboBox3.DisplayMember = "SBMS";
                if (sbhlist.Count == 2)
                {
                    sbhcomboBox3.SelectedValue = sbhlist[1].SBBH;
                }

                if (!Convert.ToString(gzzxcomboBox.SelectedValue).Equals("0"))
                {
                    MES_SY_MATERIAL_BZCOUNT bzInfo = new MES_SY_MATERIAL_BZCOUNT();
                    bzInfo.GC     = MES_SY_MATERIAL_LIST.GC;
                    bzInfo.WLH    = MES_SY_MATERIAL_LIST.WLH;
                    bzInfo.GZZXBH = Convert.ToString(gzzxcomboBox.SelectedValue);
                    MES_SY_MATERIAL_BZCOUNT_SELECT res = ServicModel.SY_MATERIAL_BZCOUNT.SELECT(bzInfo, getToken());
                    if (res.MES_RETURN.TYPE.Equals("S"))
                    {
                        if (res.MES_SY_MATERIAL_BZCOUNT.Length == 1)
                        {
                            bstextBox.Text   = res.MES_SY_MATERIAL_BZCOUNT[0].BZBS.ToString();
                            mbsltextBox.Text = res.MES_SY_MATERIAL_BZCOUNT[0].BZCOUNT.ToString();
                        }
                        else
                        {
                            bstextBox.Clear();
                            mbsltextBox.Clear();
                        }
                    }
                    else
                    {
                        ShowMeg(res.MES_RETURN.MESSAGE);
                    }
                }
            }
        }
예제 #8
0
        public frmZX_SBH()
        {
            InitializeComponent();

            MES_SY_GZZX_SBH model = new MES_SY_GZZX_SBH();

            model.GC       = getGC("value");
            model.STAFFID  = Convert.ToInt16(getUserInfo("staffid"));
            model.WLLBNAME = "素电";
            MES_SY_GZZX_SBH[] list = ServicModel.SY_GZZX_SBH.SELECT_BY_STAFFID(model, getToken());
        }
예제 #9
0
        public string GET_SBH(string GC, string GZZXBH)
        {
            string          token = AppClass.GetSession("token").ToString();
            string          rst   = "";
            MES_SY_GZZX_SBH model_MES_SY_GZZX_SBH = new MES_SY_GZZX_SBH();

            model_MES_SY_GZZX_SBH.GC     = GC;
            model_MES_SY_GZZX_SBH.GZZXBH = GZZXBH;
            MES_SY_GZZX_SBH[] rst_MES_SY_GZZX_SBH = mesModels.SY_GZZX_SBH.SELECT(model_MES_SY_GZZX_SBH, token);
            rst = Newtonsoft.Json.JsonConvert.SerializeObject(rst_MES_SY_GZZX_SBH);
            return(rst);
        }
예제 #10
0
        private void qhsbhbutton_Click(object sender, EventArgs e)
        {
            MES_SY_GZZX_SBH model = new MES_SY_GZZX_SBH();

            model.GZZXBH   = MES_PD_SCRW_LIST.GZZXBH;
            model.GC       = MES_PD_SCRW_LIST.GC;
            model.WLLBNAME = GetWLLBName(RigthType);
            MES_SY_GZZX_SBH[] list = ServicModel.SY_GZZX_SBH.SELECT(model, getToken());
            frmFindSBH        form = new frmFindSBH(list, MES_PD_SCRW_LIST.GZZXNAME, RigthType, true);

            push(form, this);
        }
예제 #11
0
        private void button1_Click(object sender, EventArgs e)
        {
            MES_SY_GZZX_SBH model = new MES_SY_GZZX_SBH();

            //model.GZZXBH = Convert.ToString(getUserInfo("gzzxvalue"));
            model.GC       = getGC("value");
            model.WLLBNAME = GetWLLBName(RigthType);
            MES_SY_GZZX_SBH[] list = ServicModel.SY_GZZX_SBH.SELECT(model, getToken());
            frmFindSBH        form = new frmFindSBH(list, getUserInfo("gzzxtext"), RigthType, true);

            push(form, this);
        }
예제 #12
0
        private void qhsbhbutton_Click(object sender, EventArgs e)
        {
            MES_SY_GZZX_SBH model = new MES_SY_GZZX_SBH();

            model.GZZXBH   = Convert.ToString(getUserInfo("gzzxvalue"));
            model.GC       = getGC("value");
            model.WLLBNAME = GetWLLBName(RigthType);
            MES_SY_GZZX_SBH[] list = ServicModel.SY_GZZX_SBH.SELECT(model, getToken());
            string            ms   = "";

            if (list.Length > 0)
            {
                ms = list[0].GZZXBH + "-" + list[0].GZZXMS;
            }
            frmFindSBH form = new frmFindSBH(list, ms, RigthType, true);

            push(form, this);
        }
예제 #13
0
        private void GZZXcomboBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            ComboBox        cb    = (ComboBox)sender;
            object          obj   = cb.SelectedValue;
            MES_SY_GZZX_SBH model = new MES_SY_GZZX_SBH();

            if (obj is string)
            {
                model.GZZXBH             = Convert.ToString(obj);
                SBcomboBox.SelectedValue = "";
                SBcomboBox.SelectedText  = "";
            }
            model.GC = getGC("value");
            MES_SY_GZZX_SBH[] list = ServicModel.SY_GZZX_SBH.SELECT(model, getToken());
            SBcomboBox.DataSource    = list;
            SBcomboBox.ValueMember   = "ID";
            SBcomboBox.DisplayMember = "SBMS";
        }
예제 #14
0
 private void sbhbutton_Click(object sender, EventArgs e)
 {
     if (RigthType == Rigth_Type.zhujizhengjitl)
     {
         MES_SY_GZZX_SBH model = new MES_SY_GZZX_SBH();
         model.GC       = getGC("value");
         model.STAFFID  = Convert.ToInt16(getUserInfo("staffid"));
         model.WLLBNAME = "素电";
         MES_SY_GZZX_SBH[] list = ServicModel.SY_GZZX_SBH.SELECT_BY_STAFFID(model, getToken());
         frmFindSBH        form = new frmFindSBH(list, q(Msg_Type.choiceCX), RigthType, true);//"选择产线"
         push(form, this);
     }
     else
     {
         MES_SY_GZZX_SBH model = new MES_SY_GZZX_SBH();
         model.GZZXBH = MES_PD_SCRW_LIST.GZZXBH;
         model.GC     = MES_PD_SCRW_LIST.GC;
         //model.WLLB = Gzzxlb;
         model.WLLBNAME = "素电";
         MES_SY_GZZX_SBH[] list = ServicModel.SY_GZZX_SBH.SELECT(model, getToken());
         frmFindSBH        form = new frmFindSBH(list, MES_PD_SCRW_LIST.GZZXBH + "-" + MES_PD_SCRW_LIST.GZZXNAME, RigthType, true);
         push(form, this);
     }
 }
예제 #15
0
 public MES_SY_GZZX_SBH_SELECT SELECT_BY_FSBBH(MES_SY_GZZX_SBH model, string ptoken)
 {
     model.LB = 1;
     return(client.SELECT_LB(model, ptoken));
 }
예제 #16
0
 public MES_SY_GZZX_SBH[] SELECT_BY_STAFFID(MES_SY_GZZX_SBH model, string ptoken)
 {
     return(client.SELECT_BY_STAFFID(model, ptoken));
 }
예제 #17
0
 public MES_SY_GZZX_SBH[] SELECT_ALL(MES_SY_GZZX_SBH model, string ptoken)
 {
     model.ISACTION = 0;
     return(client.SELECT(model, ptoken));
 }
예제 #18
0
 public MES_SY_GZZX_SBH_SELECT SELECT_LB(MES_SY_GZZX_SBH model, string ptoken)
 {
     return(client.SELECT_LB(model, ptoken));
 }
예제 #19
0
        /// <summary>
        /// 动态按钮点击事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btn_Click(object sender, EventArgs e)
        {
            Button     btn  = (Button)sender;
            int        tag  = Convert.ToInt32(btn.Tag);
            Rigth_Type type = (Rigth_Type)tag;

            if (type == Rigth_Type.wlrkdy)
            {
                frmWLKC_N form = new frmWLKC_N(type);
                push(form, this);
            }
            else if (type == Rigth_Type.zhujizhengjitl)
            {
                MES_SY_GC gcmodel = new MES_SY_GC();
                gcmodel.STAFFID = Convert.ToInt32(getUserInfo("staffid"));
                MES_SY_GC[] gcList = ServicModel.SY_GC.SELECT_BY_ROLE(gcmodel, getToken());
                if (gcList.Length > 1)
                {
                    showGZZX(btn.Text, type);
                }
                else if (gcList.Length == 1)
                {
                    MES_SY_GZZX_SBH model = new MES_SY_GZZX_SBH();
                    model.GC       = gcList[0].GC;
                    model.STAFFID  = Convert.ToInt16(getUserInfo("staffid"));
                    model.WLLBNAME = "素电";
                    MES_SY_GZZX_SBH[] list = ServicModel.SY_GZZX_SBH.SELECT_BY_STAFFID(model, getToken());
                    frmFindSBH        form = new frmFindSBH(list, q(Msg_Type.choiceCX), type, true);
                    push(form, this);
                }
                else
                {
                    ShowMeg(q(Msg_Type.accountnotgcrole));
                }
            }
            else if (type == Rigth_Type.tmbd)
            {
                frmTM_bd form = new frmTM_bd();
                push(form, this);
            }
            else if (type == Rigth_Type.tmbdLimit)
            {
                frmTM_bdLimit form = new frmTM_bdLimit();
                push(form, this);
            }
            else if (type == Rigth_Type.sgsm)
            {
                frmSGSM form = new frmSGSM();
                push(form, this);
            }
            else if (type == Rigth_Type.tbprint)
            {
                frmPrintTM form = new frmPrintTM();
                show(form);
            }
            else if (type == Rigth_Type.tmInfoUpdate)
            {
                frmTM_INFO_UPDATE form = new frmTM_INFO_UPDATE();
                show(form);
            }
            else if (type == Rigth_Type.configSetting)
            {
                frmConfigView form = new frmConfigView();
                push(form, this);
            }
            else if (type == Rigth_Type.rwdsm)
            {
                frmRWDSCAN form = new frmRWDSCAN();
                form.block = RWDSCAN;
                show(form);
            }
            else if (type == Rigth_Type.sudianfangong)
            {
                int[]        arr  = { 7 };
                frmSGSM_Puls form = new frmSGSM_Puls(arr);
                push(form, this);
            }
            else if (type == Rigth_Type.zhengjicc)
            {
                showGZZX(btn.Text, type);
            }
            else if (type == Rigth_Type.fujicc)
            {
                showGZZX(btn.Text, type);
            }
            else if (type == Rigth_Type.fujitl)
            {
                showGZZX(btn.Text, type);
            }
            else if (type == Rigth_Type.zswllotdy)
            {
                frmZSLotprint form = new frmZSLotprint();
                //show(form);
                int ScreenWidth  = Screen.PrimaryScreen.WorkingArea.Width;
                int ScreenHeight = Screen.PrimaryScreen.WorkingArea.Height;
                //计算窗体显示的坐标值,可以根据需要微调几个像素

                form.StartPosition = FormStartPosition.CenterScreen;

                //this.Visible = false;

                form.Show();
            }
            else
            {
                MES_SY_GC gcmodel = new MES_SY_GC();
                gcmodel.STAFFID = Convert.ToInt32(getUserInfo("staffid"));
                MES_SY_GC[] gcList = ServicModel.SY_GC.SELECT_BY_ROLE(gcmodel, getToken());
                if (gcList.Length == 1)
                {
                    MES_SY_GZZX gzzxmodel = new MES_SY_GZZX();
                    gzzxmodel.GC      = gcList[0].GC;
                    gzzxmodel.STAFFID = Convert.ToInt32(getUserInfo("staffid"));
                    //gzzxmodel.WLLB = Gzzxlb;
                    gzzxmodel.WLLBNAME = GetwllbRightTypeString(type);
                    MES_SY_GZZX[] list = ServicModel.SY_GZZX.SELECT_BY_ROLE(gzzxmodel, getToken());
                    if (list.Length == 1)
                    {
                        MES_SY_GZZX_SBH model = new MES_SY_GZZX_SBH();

                        model.GZZXBH = list[0].GZZXBH;

                        model.GC = gzzxmodel.GC;
                        //model.WLLB = Gzzxlb;
                        model.WLLBNAME = GetwllbRightTypeString(type);
                        MES_SY_GZZX_SBH[] sbhlist = ServicModel.SY_GZZX_SBH.SELECT(model, getToken());
                        frmFindSBH        form    = new frmFindSBH(sbhlist, list[0].GZZXMS, type, true);
                        push(form, this);
                    }
                    else
                    {
                        showGZZX(btn.Text, type);
                    }
                }
                else
                {
                    showGZZX(btn.Text, type);
                }
            }
        }
예제 #20
0
        public void RWDSCAN(MES_PD_SCRW_LIST rw, int rigthID, string gc, string gzzx, int wllb, Form form1, string tmText)
        {
            form1.Close();
            form1.Hide();
            if (string.IsNullOrEmpty(gc))
            {
                bool isValid = true;
                if (rigthID == 0)
                {
                    isValid = false;
                }
                else
                {
                    RigthType = (Rigth_Type)rigthID;
                    if (RigthType == Rigth_Type.fujitl)
                    {
                        //frmFujiTL fjtlform = new frmFujiTL(Smodel.MES_PD_SCRW_LIST, sbList[0].SBMS, sbList[0].SBBH);

                        //push(fjtlform);
                    }
                    else if (RigthType == Rigth_Type.gangketl_cc || RigthType == Rigth_Type.jidiantitl_cc || RigthType == Rigth_Type.mfqqingxi || RigthType == Rigth_Type.gmgtl_cc || RigthType == Rigth_Type.fujifengkoujitl_cc || RigthType == Rigth_Type.zhengjifengkoujitl_cc)
                    {
                        //frmTL2  form = new frmTL2(Smodel.MES_PD_SCRW_LIST[0], model.SBBH, RigthType);
                        //push(form);
                        frmTL2_1 form = new frmTL2_1(rw, rw.SBBH, RigthType);
                        push(form, this);
                    }
                    else if (RigthType == Rigth_Type.ddjtl_cc)
                    {
                        frmTL2_2 form = new frmTL2_2(rw, rw.SBBH, RigthType);
                        push(form, this);
                    }
                    else if (RigthType == Rigth_Type.zhuxiancc)
                    {
                        frmZX_CC form = new frmZX_CC(rw, rw.SBBH, RigthType);
                        push(form, this);
                    }
                    else if (RigthType == Rigth_Type.baobiaocc || RigthType == Rigth_Type.dczztl_cc)
                    {
                        //frmBaobiao form = new frmBaobiao(rw, rw.SBBH, RigthType, rw.SBH,tmText);
                        frmBaobiao form = new frmBaobiao(rw, rw.SBBH, RigthType, rw.SBH);
                        push(form, this);
                    }
                    else if (RigthType == Rigth_Type.baozhuangcc)
                    {
                        frmBaozhuang form = new frmBaozhuang(new MES_PD_SCRW_LIST(), rw.SBBH, RigthType, rw.SBH);
                        push(form, this);
                    }
                    else if (RigthType == Rigth_Type.zhuxiantl || RigthType == Rigth_Type.zhujizhengjitl)
                    {
                        frmZX_TL form = new frmZX_TL(rw, rw.SBBH, RigthType);;
                        push(form, this);
                    }
                }

                if (isValid)
                {
                }
                else
                {
                    ShowMeg(q(Msg_Type.rwdexcept));//"获取任务单信息异常,请联系管理员"
                }
            }
            else
            {
                //扫描工单string gc,string gzzx,int wllb
                MES_SY_GZZX_SBH model = new MES_SY_GZZX_SBH();
                model.GZZXBH = gzzx;
                model.GC     = gc;
                model.WLLB   = wllb;
                MES_SY_GZZX_SBH[] list = ServicModel.SY_GZZX_SBH.SELECT(model, getToken());

                if (rigthID != 0)
                {
                    RigthType = (Rigth_Type)rigthID;
                    if (list.Length != 0)
                    {
                        frmFindSBH form = new frmFindSBH(list, gzzx, RigthType, tmText);
                        push(form, this);
                    }
                    else
                    {
                        ShowMeg(gzzx + q(Msg_Type.sbhempty));//对应的设备号为空
                    }
                }
                else
                {
                    ShowMeg(q(Msg_Type.rolegdexcept));//工单对应的权限异常,请联系管理员
                }
            }
        }
예제 #21
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));
            }
        }
예제 #22
0
        public void ScanTM()
        {
            if (smtextBox1.Text.Trim().Length != 10)
            {
                ShowMeg(q(Msg_Type.msgnosbh));//"扫描的不是设备号条码"
                return;
            }
            MES_SY_GZZX_SBH sbhmodel = new MES_SY_GZZX_SBH();

            sbhmodel.SBBH = smtextBox1.Text.Trim();
            MES_SY_GZZX_SBH[] sbList = ServicModel.SY_GZZX_SBH.SELECT(sbhmodel, getToken());
            if (sbList.Length == 1)
            {
                bool isGZZX_SB = false;
                for (int i = 0; i < Sbhlist.Length; i++)
                {
                    if (sbList[0].SBBH == Sbhlist[i].SBBH)
                    {
                        isGZZX_SB = true;
                        break;
                    }
                }
                if (isGZZX_SB)
                {
                    MES_PD_SCRW model = new MES_PD_SCRW();
                    model.SBBH = sbList[0].SBBH;
                    model.ZPRQ = GetSystemDate(Date_Type.hour, 0, "yyyy-MM-dd");// DateTime.Now.ToString("yyyy-MM-dd");
                    //model.GC = getGC("value");
                    //model.GZZXBH = getUserInfo("gzzxvalue");
                    SBHID = model.SBBH;

                    SELECT_MES_PD_SCRW Smodel;//SELEXT_LAST只查询最后一个任务,SELECT查询的是所有当天的任务.暂时只有负极和主线
                    switch (RigthType)
                    {
                    case Rigth_Type.gangketl_cc:
                        Smodel = ServicModel.PD_SCRW.SELECT_LAST(model, getToken());

                        break;

                    case Rigth_Type.jidiantitl_cc:
                        Smodel = ServicModel.PD_SCRW.SELECT_LAST(model, getToken());
                        break;

                    case Rigth_Type.fujitl:
                        Smodel = ServicModel.PD_SCRW.SELECT(model, getToken());
                        break;

                    case Rigth_Type.fujicc:
                        Smodel = ServicModel.PD_SCRW.SELECT_LAST(model, getToken());
                        break;

                    case Rigth_Type.zhengjicc:
                        Smodel = ServicModel.PD_SCRW.SELECT_LAST(model, getToken());
                        break;

                    case Rigth_Type.zhuxiantl:
                        Smodel = ServicModel.PD_SCRW.SELECT(model, getToken());
                        break;

                    case Rigth_Type.zhujizhengjitl:
                        Smodel = ServicModel.PD_SCRW.SELECT(model, getToken());
                        break;

                    case Rigth_Type.zhuxiancc:
                        Smodel = ServicModel.PD_SCRW.SELECT_LAST(model, getToken());
                        break;

                    case Rigth_Type.baobiaocc:
                        Smodel = ServicModel.PD_SCRW.SELECT_LAST(model, getToken());
                        break;

                    case Rigth_Type.dczztl_cc:
                        Smodel = ServicModel.PD_SCRW.SELECT_LAST(model, getToken());
                        break;

                    case Rigth_Type.baozhuangcc:
                        Smodel = ServicModel.PD_SCRW.SELECT_LAST(model, getToken());
                        break;

                    case Rigth_Type.ddjtl_cc:
                        Smodel = ServicModel.PD_SCRW.SELECT_LAST(model, getToken());
                        break;

                    default:
                        Smodel = ServicModel.PD_SCRW.SELECT_LAST(model, getToken());
                        break;
                    }
                    if (Smodel.MES_RETURN.TYPE == "E")
                    {
                        if (RigthType == Rigth_Type.baobiaocc || RigthType == Rigth_Type.dczztl_cc)
                        {
                            frmBaobiao form = new frmBaobiao(new MES_PD_SCRW_LIST(), model.SBBH, RigthType, sbList[0].SBMS);
                            push(form, this);
                            return;
                        }
                        else if (RigthType == Rigth_Type.baozhuangcc)
                        {
                            frmBaozhuang form = new frmBaozhuang(new MES_PD_SCRW_LIST(), model.SBBH, RigthType, sbList[0].SBMS);
                            push(form, this);
                            return;
                        }
                        else
                        {
                            //MessageBox.Show(Smodel.MES_RETURN.MESSAGE, "消息框");
                            ShowMeg(Smodel.MES_RETURN.MESSAGE);
                            return;
                        }
                    }
                    if (Smodel.MES_PD_SCRW_LIST.Length == 0)
                    {
                        //MessageBox.Show("找不到工作中心是" + Gzzx + "设备号是" + sbList[0].SBMS + "对应的派单任务!!!", "消息框");
                        ShowMeg(string.Format(q(Msg_Type.msgnorw), Gzzx, sbList[0].SBMS));
                        return;
                    }
                    else if (Smodel.MES_PD_SCRW_LIST.Length == 1)
                    {
                        if (RigthType == Rigth_Type.fujitl)
                        {
                            ini.IniWriteValue(ini.Section_Machine, "fjsbh", smtextBox1.Text.Trim());
                            frmFujiTL_N fjtlform = new frmFujiTL_N(Smodel.MES_PD_SCRW_LIST, sbList[0].SBMS, sbList[0].SBBH);
                            push(fjtlform, this);
                        }
                        else if (RigthType == Rigth_Type.gangketl_cc || RigthType == Rigth_Type.jidiantitl_cc || RigthType == Rigth_Type.mfqqingxi || RigthType == Rigth_Type.gmgtl_cc || RigthType == Rigth_Type.fujifengkoujitl_cc)
                        {
                            frmTL2_1 form = new frmTL2_1(Smodel.MES_PD_SCRW_LIST[0], model.SBBH, RigthType);
                            push(form, this);
                        }
                        else if (RigthType == Rigth_Type.ddjtl_cc)
                        {
                            frmTL2_2 form = new frmTL2_2(Smodel.MES_PD_SCRW_LIST[0], model.SBBH, RigthType);
                            push(form, this);
                        }
                        else if (RigthType == Rigth_Type.zhuxiancc)
                        {
                            frmZX_CC form = new frmZX_CC(Smodel.MES_PD_SCRW_LIST[0], model.SBBH, RigthType);
                            push(form, this);
                        }
                        else if (RigthType == Rigth_Type.baobiaocc || RigthType == Rigth_Type.dczztl_cc)
                        {
                            frmBaobiao form = new frmBaobiao(Smodel.MES_PD_SCRW_LIST[0], model.SBBH, RigthType, sbList[0].SBMS);
                            push(form, this);
                        }
                        else if (RigthType == Rigth_Type.baozhuangcc)
                        {
                            frmBaozhuang form = new frmBaozhuang(new MES_PD_SCRW_LIST(), model.SBBH, RigthType, sbList[0].SBMS);
                            push(form, this);
                        }
                        else if (RigthType == Rigth_Type.zhuxiantl || RigthType == Rigth_Type.zhujizhengjitl)
                        {
                            frmZX_TL form = new frmZX_TL(Smodel.MES_PD_SCRW_LIST[0], model.SBBH, RigthType);;
                            push(form, this);
                        }
                    }
                    else if (Smodel.MES_PD_SCRW_LIST.Length > 1)
                    {
                        if (RigthType == Rigth_Type.fujitl)
                        {
                            ini.IniWriteValue(ini.Section_Machine, "fjsbh", smtextBox1.Text.Trim());
                            frmFujiTL_N fjtlform = new frmFujiTL_N(Smodel.MES_PD_SCRW_LIST, sbList[0].SBMS, sbList[0].SBBH);
                            push(fjtlform, this);
                        }
                        else if (RigthType == Rigth_Type.zhuxiantl || RigthType == Rigth_Type.zhujizhengjitl)
                        {
                            frmZX_TL form = new frmZX_TL(Smodel.MES_PD_SCRW_LIST[0], model.SBBH, RigthType);
                            push(form, this);
                        }
                        this.Close();
                    }
                }
                else
                {
                    ShowMeg(q(Msg_Type.msgsbhnomacthgzzz));//"扫描的设备号不是当前工作中心下的"
                }
            }
            else if (sbList.Length == 0)
            {
                ShowMeg(q(Msg_Type.msgscannosbh));//"扫描的不是设备号条码"
                return;
            }
            else
            {
                ShowMeg(q(Msg_Type.msgsystemerror));//"系统异常请联系管理员"
                return;
            }
        }