Exemple #1
0
        private List <BomDataGrid> getBomList(ZBCFUN_GDJGXX_READ model)
        {
            BOMdataGridView.DataSource = new List <BomDataGrid>();
            List <BomDataGrid> list = new List <BomDataGrid>();

            if (model.ET_BOM == null || model.ET_BOM.Length == 0)
            {
                ShowMeg(q(Msg_Type.msgrwunexistbom));//"任务对应BOM为空,请联系管理员"
                SMtextBox.Select();
                return(new List <BomDataGrid>());
            }
            for (int i = 0; i < model.ET_BOM.Length; i++)
            {
                BomDataGrid node = new BomDataGrid();
                node.Xh = model.ET_BOM[i].POSNR;
                if (!string.IsNullOrEmpty(model.ET_BOM[i].IDNRK))
                {
                    node.Wlxx = model.ET_BOM[i].IDNRK + "/" + model.ET_BOM[i].MAKTX;
                }
                else
                {
                    node.Wlxx = "";
                }

                node.Wllb   = model.ET_BOM[i].WLLBNAME;
                node.Wllbdm = model.ET_BOM[i].WLLB;
                if (!model.ET_BOM[i].ZSBS.Equals("Y"))
                {
                    unRequireArr.Add(i);
                }
                list.Add(node);
            }
            return(list.ToList());
        }
        public string Data_GetGDXX(string aufnr)
        {
            token = appClass.CRM_Gettoken();
            ZBCFUN_GDJGXX_READ data = crmModels.PD_GD.get_GDJGXX_BYERPNO(aufnr, token);

            return(Newtonsoft.Json.JsonConvert.SerializeObject(data));
        }
Exemple #3
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();
            }
        }
Exemple #4
0
        public string GET_GDINFO_BYSCRW(string RWBH, string GC)
        {
            TokenINFO          rst_TokenINFO          = GET_TokenINFO();
            ZBCFUN_GDJGXX_READ rst_ZBCFUN_GDJGXX_READ = mesmodels.PD_GD.SAP_GET_GDJGXX(RWBH, "", GC, rst_TokenINFO.Token);

            return(Newtonsoft.Json.JsonConvert.SerializeObject(rst_ZBCFUN_GDJGXX_READ));
        }
Exemple #5
0
        private List <BomDataGrid> getBomList(ZBCFUN_GDJGXX_READ model)
        {
            IList <BomDataGrid> list = new List <BomDataGrid>();

            for (int i = 0; i < model.ET_BOM.Length; i++)
            {
                BomDataGrid node = new BomDataGrid();
                node.Xh = model.ET_BOM[i].POSNR;
                if (!string.IsNullOrEmpty(model.ET_BOM[i].IDNRK))
                {
                    node.Wlxx = model.ET_BOM[i].IDNRK + "/" + model.ET_BOM[i].MAKTX;
                }
                else
                {
                    node.Wlxx = "";
                }

                node.Wllb   = model.ET_BOM[i].WLLBNAME;
                node.Wllbdm = model.ET_BOM[i].WLLB;
                if (!model.ET_BOM[i].ZSBS.Equals("Y"))
                {
                    unRequireArr.Add(i);
                }
                list.Add(node);
            }
            return(list.ToList());
        }
Exemple #6
0
        public void InitData(MES_PD_SCRW_LIST list)
        {
            MES_TM_CZR rymodel = new MES_TM_CZR();

            rymodel.GC           = list.GC;
            rymodel.RWBH         = list.RWBH;
            rymodel.CZLB         = 1;
            dateTimePicker1.Text = list.ZPRQ;
            _czrList             = ServicModel.TM_CZR.SELECT_CZR_NOW(rymodel, getToken());
            _bomList             = ServicModel.PD_GD.SAP_GET_GDJGXX(list.RWBH, list.ZPRQ, 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;

            MES_SY_TYPEMXLIST bcmodel1 = new MES_SY_TYPEMXLIST();

            bcmodel1.ID     = 0;
            bcmodel1.MXNAME = q(Msg_Type.titlechoice);//"==请选择==";
            bcArr           = bclist.ToList();
            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);
                BOMdataGridView.ClearSelection();
            }
            else
            {
                ShowMeg(_bomList.MES_RETURN.MESSAGE);
                //this.Close();
                BOMdataGridView.DataSource = new List <BomDataGrid>();
            }
            LSdataGridView.ReadOnly = true;
            LastDate = dateTimePicker1.Text.Trim();
            if (RigthType == Rigth_Type.mfqqingxi)
            {
                GDHlabel.Visible   = false;
                WLXXlabel.Location = GDHlabel.Location;
            }
        }
Exemple #7
0
        public string GET_GDJGXX(string RWBH, string ZPRQ, string GC)
        {
            TokenINFO rst_TokenINFO = GET_TokenINFO();
            //string token = AppClass.GetSession("token").ToString();
            ZBCFUN_GDJGXX_READ rst_ZBCFUN_GDJGXX_READ = mesmodels.PD_GD.SAP_GET_GDJGXX(RWBH, ZPRQ, GC, rst_TokenINFO.Token);

            return(Newtonsoft.Json.JsonConvert.SerializeObject(rst_ZBCFUN_GDJGXX_READ));
        }
Exemple #8
0
        public void configUI(MES_PD_SCRW_LIST list)
        {
            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());
            dateTimePicker1.Text = list.ZPRQ;
            _bomList             = ServicModel.PD_GD.SAP_GET_GDJGXX(list.RWBH, list.ZPRQ, list.GC, getToken());
            gzzxtextBox.Text     = list.GZZXBH + "-" + list.GZZXNAME;
            czrytextBox.Text     = _czrList.CZR;
            gctextBox.Text       = list.GC;
            sbhtextBox.Text      = list.SBH;
            pctextBox.Text       = list.PC;
            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;                   //"任务单:"
            dcdjlabel.Text       = q(Msg_Type.titledcdj) + list.DCDJNAME;              //"电池等级:"
            dcxhlabel1.Text      = q(Msg_Type.titledcdj) + list.DCXHNAME;              //电池型号:
            if (string.IsNullOrEmpty(list.XSNOBILL))
            {
                tskclabel1.Text = q(Msg_Type.titletskc);//"特殊库存:";
            }
            else
            {
                tskclabel1.Text = q(Msg_Type.titletskc) + list.XSNOBILL + "-" + list.XSNOBILLMX;
            }

            if (_bomList.MES_RETURN.TYPE.Equals("S"))
            {
                BOMdataGridView.DataSource = getBomList(_bomList);
            }
            else
            {
                ShowMeg(_bomList.MES_RETURN.MESSAGE);
                BOMdataGridView.DataSource = new List <BomDataGrid>();
            }
            LSdataGridView.ReadOnly = true;
            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[q(Msg_Type.fieldstatus)].Style.BackColor = Color.White;
                    }
                }
            }
            BOMdataGridView.ClearSelection();
        }
Exemple #9
0
        private void frmZX_TL_Shown(object sender, EventArgs e)
        {
            MES_TM_CZR rymodel = new MES_TM_CZR();

            rymodel.GC           = MES_PD_SCRW_LIST.GC;
            rymodel.RWBH         = MES_PD_SCRW_LIST.RWBH;
            rymodel.CZLB         = 1;
            dateTimePicker1.Text = MES_PD_SCRW_LIST.ZPRQ;
            _czrList             = ServicModel.TM_CZR.SELECT_CZR_NOW(rymodel, getToken());
            _bomList             = ServicModel.PD_GD.SAP_GET_GDJGXX(MES_PD_SCRW_LIST.RWBH, MES_PD_SCRW_LIST.ZPRQ, MES_PD_SCRW_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 = MES_PD_SCRW_LIST.GZZXBH + "-" + MES_PD_SCRW_LIST.GZZXNAME;

            gctextBox.Text  = MES_PD_SCRW_LIST.GC;
            sbhtextBox.Text = MES_PD_SCRW_LIST.SBH;

            MESlabel.Text   = q(Msg_Type.titlemesgd) + MES_PD_SCRW_LIST.GDDH;                                           //"MES工单:"
            GDHlabel.Text   = q(Msg_Type.titlegd) + MES_PD_SCRW_LIST.ERPNO;                                             //"工单号:"
            WLXXlabel.Text  = q(Msg_Type.titlewlxx) + MES_PD_SCRW_LIST.WLH + "/" + MES_PD_SCRW_LIST.WLMS;               //"物料信息:"
            WLLBlabel1.Text = q(Msg_Type.titlewllb) + MES_PD_SCRW_LIST.WLLBNAME;                                        //"物料类别:"
            dclabel.Text    = q(Msg_Type.titledcdjandxh) + MES_PD_SCRW_LIST.DCXHNAME + "/" + MES_PD_SCRW_LIST.DCDJNAME; //"电池型号/等级:"
            rwdlabel.Text   = q(Msg_Type.titlerwd) + MES_PD_SCRW_LIST.RWBH;                                             //"任务单:"
            configBom();
            if (_bomList.MES_RETURN.TYPE.Equals("S"))
            {
                BOMdataGridView.DataSource = getBomList(_bomList);
            }
            else
            {
                ShowMeg(_bomList.MES_RETURN.MESSAGE);
                //this.Close();
                BOMdataGridView.DataSource = new List <BomDataGrid>();
            }
            BOMdataGridView.ClearSelection();
            LSdataGridView.ReadOnly = true;

            LastDate = dateTimePicker1.Text.Trim();
            ConfigJsDataGridView();
            LSdataGridView.ClearSelection();
            BOMdataGridView.ClearSelection();
            button3.Text = q(Msg_Type.fieldhidden);// "隐藏";
            IShidden(true);
        }
Exemple #10
0
        public MsgReturn VerifyWLisALL()
        {
            MsgReturn msgInfo = new MsgReturn();

            msgInfo.Pass = false;
            msgInfo.Msg  = q(Msg_Type.msgbomunfinish);//"生成物料的相关BOM物料不齐全,请查看需要添加的物料";
            int bomcount             = 0;
            int tmcount              = 0;
            ZBCFUN_GDJGXX_READ judge = BomList;

            //list.Where((x, i) => list.FindIndex(z => z.WLLB == x.WLLB) == i);
            //List<int> list = BomList.ET_BOM.ToList().Select(x => x.WLLB).Distinct().ToList();

            List <ET_BOM> list1 = new List <ET_BOM>();

            if (BomList.ET_BOM == null)
            {
                return(msgInfo);
            }
            for (int i = 0; i < BomList.ET_BOM.Length; i++)
            {
                if (list1.Exists(x => x.WLLB == BomList.ET_BOM[i].WLLB) == false)
                {
                    list1.Add(BomList.ET_BOM[i]);
                }
            }

            for (int i = 0; i < list1.Count; i++)
            {
                if (list1[i].ZSBS.Equals("Y"))
                {
                    bomcount++;
                    for (int j = 0; j < Tmlist.Count; j++)
                    {
                        if (list1[i].WLLB == Tmlist[j].Wllbdm)
                        {
                            tmcount++;
                        }
                    }
                }
            }
            if (tmcount >= bomcount)
            {
                msgInfo.Pass = true;
            }


            return(msgInfo);
        }
Exemple #11
0
        public void RefreshRW(MES_PD_SCRW_LIST list, string shebeihaoID)
        {
            //monthCalendar1.Visible = false;
            //scrqtextBox.Text = DateTime.Now.ToString("yyyy-MM-dd");
            SMtextBox.Select();
            SBHID  = shebeihaoID;
            Tmlist = new List <TMDataGrid>();
            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, list.ZPRQ, 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;

            gctextBox.Text  = list.GC;
            sbhtextBox.Text = list.SBH;

            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);
                //this.Close();
                BOMdataGridView.DataSource = new List <BomDataGrid>();
            }
            BOMdataGridView.ClearSelection();
            LSdataGridView.ReadOnly = true;
            UpdateJSDataGrid(MES_PD_SCRW_LIST.RWBH);
            //getTMList(ServicModel.TM_TMINFO.SELECT_TL_LAST(MES_PD_SCRW_LIST.RWBH, getToken()));
        }
Exemple #12
0
        public MsgReturn VerifyWLisALL()
        {
            MsgReturn msgInfo = new MsgReturn();

            msgInfo.Pass = false;
            if (BomList != null)
            {
                //msgInfo.Msg = "生成物料的相关BOM物料不齐全,请查看需要添加的物料";
                msgInfo.Msg = q(Msg_Type.msgbomunfinish);
                int bomcount             = 0;
                int tmcount              = 0;
                ZBCFUN_GDJGXX_READ judge = BomList;

                List <ET_BOM> list1 = new List <ET_BOM>();

                for (int i = 0; i < BomList.ET_BOM.Length; i++)
                {
                    if (list1.Exists(x => x.WLLB == BomList.ET_BOM[i].WLLB) == false)
                    {
                        list1.Add(BomList.ET_BOM[i]);
                    }
                }
                for (int i = 0; i < list1.Count; i++)
                {
                    if (list1[i].ZSBS.Equals("Y"))
                    {
                        bomcount++;
                        for (int j = 0; j < Tmlist.Count; j++)
                        {
                            if (list1[i].WLLB == Tmlist[j].Wllbdm)
                            {
                                tmcount++;
                            }
                        }
                    }
                }
                if (tmcount >= bomcount)
                {
                    msgInfo.Pass = true;
                }
            }
            else
            {
                msgInfo.Msg = q(Msg_Type.msgscantpmforgl);//"请先扫描托盘码信息带出需要关联的BOM相关信息";
            }

            return(msgInfo);
        }
Exemple #13
0
        public ActionResult RWQD_PRINT()
        {
            string token = AppClass.GetSession("token").ToString();
            List <MODEL_RWQD_PRINT> rst = new List <MODEL_RWQD_PRINT>();

            MES_PD_SCRW_LIST[] model_MES_PD_SCRW_LIST = (MES_PD_SCRW_LIST[])Session["MES_PD_SCRW_LIST"];
            for (int i = 0; i < model_MES_PD_SCRW_LIST.Length; i++)
            {
                MODEL_RWQD_PRINT   child_MODEL_RWQD_PRINT   = new MODEL_RWQD_PRINT();
                ZBCFUN_GDJGXX_READ model_ZBCFUN_GDJGXX_READ = mesModels.PD_GD.SAP_GET_GDJGXX(model_MES_PD_SCRW_LIST[i].RWBH, model_MES_PD_SCRW_LIST[i].ZPRQ, model_MES_PD_SCRW_LIST[i].GC, token);
                child_MODEL_RWQD_PRINT.MES_PD_SCRW_LIST   = model_MES_PD_SCRW_LIST[i];
                child_MODEL_RWQD_PRINT.ZBCFUN_GDJGXX_READ = model_ZBCFUN_GDJGXX_READ;
                rst.Add(child_MODEL_RWQD_PRINT);
            }
            return(View(rst));
        }
Exemple #14
0
        private void addsdbutton_Click(object sender, EventArgs e)
        {
            ZBCFUN_GDJGXX_READ r = ServicModel.PD_GD.SAP_GET_GDJGXX(MES_PD_SCRW_LIST.RWBH, MES_PD_SCRW_LIST.ZPRQ, MES_PD_SCRW_LIST.GC, getToken());

            if (!r.MES_RETURN.TYPE.Equals("S"))
            {
                ShowMeg(r.MES_RETURN.MESSAGE);
                SMtextBox.Select();
                return;
            }
            if (string.IsNullOrEmpty(czrytextbox.Text.Trim()))
            {
                ShowMeg(q(Msg_Type.msgczrnoempty));//"操作人员不能为空,请扫码添加操作人员"
                SMtextBox.Select();
                return;
            }
            frmZXprint form = new frmZXprint(MES_PD_SCRW_LIST, dateTimePicker1.Text.Trim());

            form.block = configgridviewData;
            show(form);
            SMtextBox.Select();
        }
Exemple #15
0
        public MsgReturn VerifyWLisALL()
        {
            MsgReturn msgInfo = new MsgReturn();

            msgInfo.Pass = false;
            msgInfo.Msg  = q(Msg_Type.msgbomunfinish);
            int bomcount             = 0;
            int tmcount              = 0;
            ZBCFUN_GDJGXX_READ judge = BomList;

            List <ET_BOM> list1 = new List <ET_BOM>();

            for (int i = 0; i < BomList.ET_BOM.Length; i++)
            {
                if (list1.Exists(x => x.WLLB == BomList.ET_BOM[i].WLLB) == false)
                {
                    list1.Add(BomList.ET_BOM[i]);
                }
            }
            for (int i = 0; i < list1.Count; i++)
            {
                if (list1[i].ZSBS.Equals("Y"))
                {
                    bomcount++;
                    for (int j = 0; j < Tmlist.Count; j++)
                    {
                        if (list1[i].WLLB == Tmlist[j].Wllbdm)
                        {
                            tmcount++;
                        }
                    }
                }
            }
            if (tmcount >= bomcount)
            {
                msgInfo.Pass = true;
            }
            return(msgInfo);
        }
Exemple #16
0
        private List <BomDataGrid> getBomList(ZBCFUN_GDJGXX_READ model)
        {
            IList <BomDataGrid> list = new List <BomDataGrid>();

            string[] cols  = { "序号", "物料信息", "物料类别", "物料类别代码", "状态" };
            string[] colss = { "Xh", "Wlxx", "Wllb", "Wllbdm", "zt" };
            string[] vcol  = { "物料类别代码" };
            DataGridBuild(cols, colss, BOMdataGridView, vcol);
            for (int i = 0; i < model.ET_BOM.Length; i++)
            {
                BomDataGrid node = new BomDataGrid();
                node.Xh     = model.ET_BOM[i].POSNR;
                node.Wlxx   = model.ET_BOM[i].IDNRK + "/" + model.ET_BOM[i].MAKTX;
                node.Wllb   = model.ET_BOM[i].WLLBNAME;
                node.Wllbdm = model.ET_BOM[i].WLLB;
                if (!model.ET_BOM[i].ZSBS.Equals("Y"))
                {
                    unRequireArr.Add(i);
                }
                list.Add(node);
            }
            return(list.ToList());
        }
Exemple #17
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();
        }
Exemple #18
0
        public void CHANGERWD()
        {
            MES_PD_SCRW model = new MES_PD_SCRW();

            model.RWBH     = SMtextBox.Text.Trim().ToUpper();//.Text.Trim().ToUpper();
            model.WLLBNAME = "素电";
            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)
                {
                    MES_PD_SCRW_LIST = res.MES_PD_SCRW_LIST[0];
                    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);
                }
                else
                {
                    ShowMeg(q(Msg_Type.msgrwexcept));//"任务异常请联系管理员"
                    SMtextBox.Select();
                    return;
                }
            }
            else
            {
                ShowMeg(res.MES_RETURN.MESSAGE);
                SMtextBox.Select();
                return;
            }

            SBHID  = MES_PD_SCRW_LIST.SBBH;
            Tmlist = new List <TMDataGrid>();

            MES_TM_CZR rymodel = new MES_TM_CZR();

            rymodel.GC   = MES_PD_SCRW_LIST.GC;
            rymodel.RWBH = MES_PD_SCRW_LIST.RWBH;
            rymodel.CZLB = 1;
            _czrList     = ServicModel.TM_CZR.SELECT_CZR_NOW(rymodel, getToken());
            _bomList     = ServicModel.PD_GD.SAP_GET_GDJGXX(MES_PD_SCRW_LIST.RWBH, MES_PD_SCRW_LIST.ZPRQ, MES_PD_SCRW_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 = MES_PD_SCRW_LIST.GZZXBH + "-" + MES_PD_SCRW_LIST.GZZXNAME;
            gctextBox.Text   = MES_PD_SCRW_LIST.GC;
            sbhtextBox.Text  = MES_PD_SCRW_LIST.SBH;

            MESlabel.Text   = q(Msg_Type.titlemesgd) + MES_PD_SCRW_LIST.GDDH;                                           //"MES工单:"
            GDHlabel.Text   = q(Msg_Type.titlegd) + MES_PD_SCRW_LIST.ERPNO;                                             //"工单号:"
            WLXXlabel.Text  = q(Msg_Type.titlewlxx) + MES_PD_SCRW_LIST.WLH + "/" + MES_PD_SCRW_LIST.WLMS;               //"物料信息:"
            WLLBlabel1.Text = q(Msg_Type.titlewllb) + MES_PD_SCRW_LIST.WLLBNAME;                                        //"物料类别:"
            dclabel.Text    = q(Msg_Type.titledcdjandxh) + MES_PD_SCRW_LIST.DCXHNAME + "/" + MES_PD_SCRW_LIST.DCDJNAME; //"电池型号/等级:"
            rwdlabel.Text   = q(Msg_Type.titlerwd) + MES_PD_SCRW_LIST.RWBH;                                             //"任务单:"
            //configBom();
            if (_bomList.MES_RETURN.TYPE.Equals("S"))
            {
                BOMdataGridView.DataSource = getBomList(_bomList);
            }
            else
            {
                ShowMeg(_bomList.MES_RETURN.MESSAGE);
                //this.Close();
                BOMdataGridView.DataSource = new List <BomDataGrid>();
            }
            //BOMdataGridView.DataSource = getBomList(_bomList);
            BOMdataGridView.ClearSelection();
            LSdataGridView.ReadOnly = true;
            dateTimePicker1.Text    = MES_PD_SCRW_LIST.ZPRQ;
            LastDate = dateTimePicker1.Text.Trim();
            ConfigJsDataGridView();
        }
Exemple #19
0
        private void dylotbutton_Click(object sender, EventArgs e)
        {
            ZBCFUN_GDJGXX_READ r = ServicModel.PD_GD.SAP_GET_GDJGXX(MES_PD_SCRW_LIST.RWBH, MES_PD_SCRW_LIST.ZPRQ, MES_PD_SCRW_LIST.GC, getToken());

            if (!r.MES_RETURN.TYPE.Equals("S"))
            {
                ShowMeg(r.MES_RETURN.MESSAGE);
                SMtextBox.Select();
                return;
            }
            MsgReturn msgInfo = VerifyWLisALL();

            if (msgInfo.Pass == false)
            {
                //MessageBox.Show(msgInfo.Msg, "消息框");
                ShowMeg(msgInfo.Msg);
                SMtextBox.Select();
                return;
            }
            MsgReturn msgInfo1 = VerifyContent();

            if (msgInfo1.Pass == false)
            {
                //MessageBox.Show(msgInfo1.Msg, "消息框");
                ShowMeg(msgInfo1.Msg);
                SMtextBox.Select();
                return;
            }
            if (Convert.ToInt32(bccomboBox.SelectedValue) == 0)
            {
                //MessageBox.Show("生成LOT表必须输入班次信息不能为空", "消息框");
                ShowMeg(q(Msg_Type.msgbcnoemptyforlotb));
                SMtextBox.Select();
                return;
            }
            MES_TM_TMINFO_INSERT_GL model = new MES_TM_TMINFO_INSERT_GL();
            MES_TM_TMINFO           info  = new MES_TM_TMINFO();

            model.MES_TM_TMINFO        = info;
            model.MES_TM_TMINFO.TMLB   = 1;
            model.MES_TM_TMINFO.SCDATE = dateTimePicker1.Text.Trim();
            model.MES_TM_TMINFO.BC     = Convert.ToInt32(bccomboBox.SelectedValue);
            model.MES_TM_TMINFO.RWBH   = MES_PD_SCRW_LIST.RWBH;
            model.MES_TM_TMINFO.SL     = MES_PD_SCRW_LIST.BZCOUNT;
            if (RigthType == Rigth_Type.mfqqingxi)
            {
                model.MES_TM_TMINFO.PC = pctextBox.Text.Trim();
            }
            else
            {
                model.MES_TM_TMINFO.PC = MES_PD_SCRW_LIST.PC;
            }

            model.MES_TM_TMINFO.JLR      = Convert.ToInt32(getUserInfo("staffid"));
            model.MES_TM_TMINFO.GC       = MES_PD_SCRW_LIST.GC;
            model.MES_TM_TMINFO.SL       = MES_PD_SCRW_LIST.BZCOUNT;
            model.MES_TM_TMINFO.MINVALUE = MES_PD_SCRW_LIST.MINVALUE;
            model.MES_TM_TMINFO.MAXVALUE = MES_PD_SCRW_LIST.MAXVALUE;
            IList <MES_TM_GL> nodes = new List <MES_TM_GL>();

            for (int i = 0; i < Tmlist.Count; i++)
            {
                MES_TM_GL node = new MES_TM_GL();
                node.XCTM   = Tmlist[i].Tm;
                node.XCTMGC = Tmlist[i].Gc;
                nodes.Add(node);
            }
            model.MES_TM_GL = nodes.ToArray();

            frmPrint_N form = new frmPrint_N(model, Print_Type.lot, RigthType);

            show(form);

            string printToHome = ini.IniReadValue(ini.Section_Configuration, "printTohome");

            if (printToHome.Equals("true"))
            {
                zybutton.PerformClick();
            }
            //this.Close();
            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.Columns["状态"].DefaultCellStyle.BackColor = Color.Red;
            Tmlist = new List <TMDataGrid>();
            LSdataGridView.DataSource = Tmlist;
            LSdataGridView.Columns[q(Msg_Type.fielddelete)].DisplayIndex = 4;//"删除"
            SMtextBox.Select();
        }
Exemple #20
0
        private void dylotbutton_Click(object sender, EventArgs e)
        {
            ZBCFUN_GDJGXX_READ r = ServicModel.PD_GD.SAP_GET_GDJGXX(MES_PD_SCRW_LIST.RWBH, MES_PD_SCRW_LIST.ZPRQ, MES_PD_SCRW_LIST.GC, getToken());

            if (!r.MES_RETURN.TYPE.Equals("S"))
            {
                ShowMeg(r.MES_RETURN.MESSAGE);
                SMtextBox.Select();
                return;
            }
            if (!IsTMP)
            {
                //ShowMeg("请先扫描托盘码");
                ShowMeg(q(Msg_Type.msgscantpm));
            }
            else
            {
                MsgReturn msgInfo = VerifyWLisALL();
                if (msgInfo.Pass == false)
                {
                    //MessageBox.Show(msgInfo.Msg, "消息框");
                    ShowMeg(msgInfo.Msg);
                    SMtextBox.Select();
                    return;
                }
                MsgReturn msgInfo1 = VerifyContent();
                if (msgInfo1.Pass == false)
                {
                    //MessageBox.Show(msgInfo1.Msg, "消息框");
                    ShowMeg(msgInfo1.Msg);
                    SMtextBox.Select();
                    return;
                }
                if (string.IsNullOrEmpty(Tpm))
                {
                    //ShowMeg("托盘码信息不能为空");
                    ShowMeg(q(Msg_Type.msgtpmnoempty));
                }
                //if (Convert.ToInt32(bccomboBox.SelectedValue) == 0)
                //{
                //    MessageBox.Show("生成领用表必须输入班次信息不能为空", "消息框");
                //    return;
                //}
                MES_TM_TMINFO_INSERT_GL model = new MES_TM_TMINFO_INSERT_GL();
                MES_TM_TMINFO           info  = new MES_TM_TMINFO();
                model.MES_TM_TMINFO      = info;
                model.MES_TM_TMINFO.TMLB = 1;
                //model.MES_TM_TMINFO.BC = Convert.ToInt32(bccomboBox.SelectedValue);
                model.MES_TM_TMINFO.RWBH    = MES_PD_SCRW_LIST.RWBH;
                model.MES_TM_TMINFO.PC      = MES_PD_SCRW_LIST.PC;
                model.MES_TM_TMINFO.JLR     = Convert.ToInt32(getUserInfo("staffid"));
                model.MES_TM_TMINFO.GC      = MES_PD_SCRW_LIST.GC;
                model.MES_TM_TMINFO.SL      = MES_PD_SCRW_LIST.SL;
                model.MES_TM_TMINFO.TPM     = Tpm;
                model.MES_TM_TMINFO.TMCOUNT = 1;
                model.MES_TM_TMINFO.MAC     = DeviceInfo.GetNetCardMAC().Substring(0, 17);
                //model.MES_TM_TMINFO.TMSX = Print_Type.
                IList <MES_TM_GL> nodes = new List <MES_TM_GL>();

                for (int i = 0; i < Tmlist.Count; i++)
                {
                    MES_TM_GL node = new MES_TM_GL();
                    node.XCTM   = Tmlist[i].Tm;
                    node.XCTMGC = Tmlist[i].Gc;
                    nodes.Add(node);
                }
                model.MES_TM_GL = nodes.ToArray();

                Sonluk.UI.Model.MES.TM_TMINFOService.MES_TM_TMINFO_INSERT_RETURN res = ServicModel.TM_TMINFO.INSERT(model, 0, getToken());
                if (res.MES_RETURN.TYPE.Equals("S"))
                {
                    //ShowMeg("关联成功", 1500);
                    ShowMeg(q(Msg_Type.msgglsuccess), 1500);
                    //if (MessageBox.Show("关联成功", "消息框", MessageBoxButtons.OK) == DialogResult.OK)
                    //{
                    string printToHome = ini.IniReadValue(ini.Section_Configuration, "printTohome");
                    if (printToHome.Equals("true"))
                    {
                        zybutton.PerformClick();
                    }
                    IsTMP   = false;
                    BomList = new ZBCFUN_GDJGXX_READ();
                    List <BomDataGrid> list = new List <BomDataGrid>();
                    BOMdataGridView.DataSource = list;
                    BomList = null;
                    Tmlist  = new List <TMDataGrid>();
                    LSdataGridView.DataSource = Tmlist.ToList();
                    LSdataGridView.ClearSelection();
                    LSdataGridView.Columns[q(Msg_Type.fielddelete)].DisplayIndex = 4;
                    MES_PD_SCRW_LIST = new MES_PD_SCRW_LIST();
                    MESlabel.Text    = q(Msg_Type.titlemesgd) + MES_PD_SCRW_LIST.GDDH;
                    GDHlabel.Text    = q(Msg_Type.titlegd) + MES_PD_SCRW_LIST.ERPNO;
                    WLXXlabel.Text   = q(Msg_Type.titlewlxx);
                    WLLBlabel1.Text  = q(Msg_Type.titlewllb) + MES_PD_SCRW_LIST.WLLBNAME;
                    rwdlabel.Text    = q(Msg_Type.titlerwd) + MES_PD_SCRW_LIST.RWBH;
                    tpmlabel.Text    = q(Msg_Type.titletpm);//"托盘码:";
                    Tpm = SMtextBox.Text.Trim();
                    //dcdjlabel.Text = "电池等级:" + list.DCDJNAME;
                    //dcxhlabel1.Text = "电池型号:" + list.DCXHNAME;
                    if (!string.IsNullOrEmpty(MES_PD_SCRW_LIST.XSNOBILL) && !string.IsNullOrEmpty(MES_PD_SCRW_LIST.XSNOBILLMX))
                    {
                        tskclabel1.Text = q(Msg_Type.titletskc) + MES_PD_SCRW_LIST.XSNOBILL + "-" + MES_PD_SCRW_LIST.XSNOBILLMX;
                    }
                    else
                    {
                        tskclabel1.Text = q(Msg_Type.titletskc);
                    }
                    //}
                }
                else
                {
                    ShowMeg(res.MES_RETURN.MESSAGE);
                }
            }

            SMtextBox.Select();
        }
Exemple #21
0
        private void dylotbutton_Click(object sender, EventArgs e)
        {
            ZBCFUN_GDJGXX_READ r = ServicModel.PD_GD.SAP_GET_GDJGXX(MES_PD_SCRW_LIST.RWBH, MES_PD_SCRW_LIST.ZPRQ, MES_PD_SCRW_LIST.GC, getToken());

            if (!r.MES_RETURN.TYPE.Equals("S"))
            {
                ShowMeg(r.MES_RETURN.MESSAGE);
                SMtextBox.Select();
                return;
            }
            if (!IsGD)
            {
                ShowMeg(q(Msg_Type.msgscangd));
            }
            else
            {
                MsgReturn msgInfo = VerifyWLisALL();
                if (msgInfo.Pass == false)
                {
                    //MessageBox.Show(msgInfo.Msg, "消息框");
                    ShowMeg(msgInfo.Msg);
                    return;
                }
                MsgReturn msgInfo1 = VerifyContent();
                if (msgInfo1.Pass == false)
                {
                    //MessageBox.Show(msgInfo1.Msg, "消息框");
                    ShowMeg(msgInfo1.Msg);
                    return;
                }
                MES_TM_TMINFO_INSERT_GL model = new MES_TM_TMINFO_INSERT_GL();
                MES_TM_TMINFO           info  = new MES_TM_TMINFO();
                model.MES_TM_TMINFO          = info;
                model.MES_TM_TMINFO.TMLB     = 1;
                model.MES_TM_TMINFO.SCDATE   = dateTimePicker1.Text.Trim();
                model.MES_TM_TMINFO.RWBH     = MES_PD_SCRW_LIST.RWBH;
                model.MES_TM_TMINFO.PC       = MES_PD_SCRW_LIST.PC;
                model.MES_TM_TMINFO.JLR      = Convert.ToInt32(getUserInfo("staffid"));
                model.MES_TM_TMINFO.GC       = MES_PD_SCRW_LIST.GC;
                model.MES_TM_TMINFO.SL       = MES_PD_SCRW_LIST.BZCOUNT;
                model.MES_TM_TMINFO.MINVALUE = MES_PD_SCRW_LIST.MINVALUE;
                model.MES_TM_TMINFO.MAXVALUE = MES_PD_SCRW_LIST.MAXVALUE;

                IList <MES_TM_GL> nodes = new List <MES_TM_GL>();

                for (int i = 0; i < Tmlist.Count; i++)
                {
                    MES_TM_GL node = new MES_TM_GL();
                    node.XCTM   = Tmlist[i].Tm;
                    node.XCTMGC = Tmlist[i].Gc;
                    nodes.Add(node);
                }
                model.MES_TM_GL = nodes.ToArray();
                if (RigthType == Rigth_Type.baobiaocc)
                {
                    frmBBprint form = new frmBBprint(model, Print_Type.bblot, RigthType, MES_PD_SCRW_LIST);
                    form.block = re;
                    show(form);
                    string printToHome = ini.IniReadValue(ini.Section_Configuration, "printTohome");
                    if (printToHome.Equals("true"))
                    {
                        zybutton.PerformClick();
                    }
                }
                else
                {
                    frmPrint_N form = new frmPrint_N(model, Print_Type.lot, RigthType);

                    form.block = re;
                    show(form);
                    string printToHome = ini.IniReadValue(ini.Section_Configuration, "printTohome");
                    if (printToHome.Equals("true"))
                    {
                        zybutton.PerformClick();
                    }
                    //this.Close();
                }
            }
            SMtextBox.Select();
        }
Exemple #22
0
        public void SCANGD()
        {
            //if (gccomboBox.SelectedValue.Equals("0"))
            //{
            //    //&&  gccomboBox.SelectedValue.Equals("0")
            //    //ShowMeg("请选择工单对应的工厂");
            //    ShowMeg(q(Msg_Type.msggdgc));
            //    return;
            //}
            //string gc =  Convert.ToString(gccomboBox.SelectedValue);


            //ZBCFUN_GDJGXX_READ sap_res = ServicModel.PD_GD.get_GDJGXX_BYERPNO_GC(gc, smtextBox.Text.Trim().ToUpper(), getToken());
            ZBCFUN_GDJGXX_READ sap_res = ServicModel.PD_GD.get_GDJGXX_BYERPNO(smtextBox.Text.Trim().ToUpper(), getToken());

            if (!sap_res.MES_RETURN.TYPE.Equals("S"))
            {
                ShowMeg(sap_res.MES_RETURN.MESSAGE);
                return;
            }
            MES_PD_GD gdmodel = new MES_PD_GD();

            gdmodel.ERPNO = smtextBox.Text.Trim().ToUpper();
            gdmodel.JLR   = Convert.ToInt32(getUserInfo("staffid"));
            SELECT_MES_PD_GD res = ServicModel.PD_GD.SELECT_BY_ERPNO_SYNC(gdmodel, getToken());

            if (res.MES_RETURN.TYPE.Equals("S"))
            {
                if (res.MES_PD_GD_LIST.Length == 1)
                {
                    MES_PD_GD_LIST node = res.MES_PD_GD_LIST[0];
                    if (node.WLLBNAME.Equals("成品"))
                    {
                        //ShowMeg("成品请扫描<生产入库标识>");
                        ShowMeg(q(Msg_Type.msgcpscanrkbs));
                        return;
                    }
                    if (block != null)
                    {
                        MES_SY_GZZX_WLLB wllbModel = new MES_SY_GZZX_WLLB();
                        wllbModel.WLLBID = node.WLLB;
                        wllbModel.GC     = node.GC;
                        wllbModel.GZZXBH = node.GZZXBH;
                        MES_SY_GZZX_WLLB_SELECT wllbRes = ServicModel.SY_GZZX_WLLB.SELECT(wllbModel, getToken());

                        MES_SY_GC gc_model = new MES_SY_GC();
                        gc_model.GC = node.GC;
                        MES_SY_GC[] gc_res    = ServicModel.SY_GC.read(gc_model, getToken());
                        MES_SY_GZZX gzzxmodel = new MES_SY_GZZX();
                        gzzxmodel.GZZXBH = node.GZZXBH;
                        gzzxmodel.GC     = node.GC;
                        MES_SY_GZZX[] gzzx_res = ServicModel.SY_GZZX.SELECT(gzzxmodel, getToken());



                        ini.IniWriteValue(ini.Section_UserInfo, "gzzxvalue", node.GZZXBH);
                        ini.IniWriteValue(ini.Section_UserInfo, "gzzxtext", gzzx_res[0].GZZXMS);
                        ini.IniWriteValue(ini.Section_GC, "value", node.GC);
                        ini.IniWriteValue(ini.Section_GC, "text", gc_res[0].GCMS);



                        if (wllbRes.MES_RETURN.TYPE.Equals("S"))
                        {
                            if (wllbRes.MES_SY_GZZX_WLLB != null && wllbRes.MES_SY_GZZX_WLLB.Length == 1)
                            {
                                block(new MES_PD_SCRW_LIST(), wllbRes.MES_SY_GZZX_WLLB[0].RIGHTID, node.GC, node.GZZXBH, node.WLLB, this, smtextBox.Text.Trim().ToUpper());
                                //this.Close();
                            }
                            else
                            {
                                //ShowMeg("获取工单对应权限异常,请联系管理员");
                                ShowMeg(q(Msg_Type.msggdroleexcept));
                            }
                        }
                        else
                        {
                            ShowMeg(wllbRes.MES_RETURN.MESSAGE);
                        }
                    }
                }
                else
                {
                    //ShowMeg("工单获取的工单信息异常,请联系管理员");
                    ShowMeg(q(Msg_Type.msggdroleexcept));
                }
            }
            else
            {
                ShowMeg(res.MES_RETURN.MESSAGE);
            }
        }
Exemple #23
0
        public frmTL2(MES_PD_SCRW_LIST list, string shebeihaoID, Rigth_Type rtype)
        {
            InitializeComponent();
            this.Text = GetFormName(rtype);
            if (rtype != Rigth_Type.gangketl_cc)
            {
                dyrkbutton.Visible = false;
            }
            bingLSdatagridView();
            bindBomView();
            RigthType = rtype;
            SMtextBox.Select();
            SBHID  = shebeihaoID;
            Tmlist = new List <TMDataGrid>();
            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;

            MES_SY_TYPEMXLIST bcmodel1 = new MES_SY_TYPEMXLIST();

            bcmodel1.ID     = 0;
            bcmodel1.MXNAME = "==请选择==";
            bcArr           = bclist.ToList();
            bcArr.Insert(0, bcmodel1);

            bccomboBox.DisplayMember   = "MXNAME";
            bccomboBox.ValueMember     = "ID";
            bccomboBox.DataSource      = bcArr;
            bccomboBox.SelectedValue   = list.BC;
            MESlabel.Text              = "MES工单:" + list.GDDH;
            GDHlabel.Text              = "工单号:" + list.ERPNO;
            WLXXlabel.Text             = "物料信息:" + list.WLH + "/" + list.WLMS;
            WLLBlabel1.Text            = "物料类别:" + list.WLLBNAME;
            rwdlabel.Text              = "任务单:" + list.RWBH;
            BOMdataGridView.DataSource = getBomList(_bomList);
            //scrqtextBox.Text = DateTime.Now.ToString("yyyy-MM-dd");
            LSdataGridView.ReadOnly = true;
            if (RigthType == Rigth_Type.mfqqingxi)
            {
                GDHlabel.Visible   = false;
                WLXXlabel.Location = GDHlabel.Location;
            }
        }
Exemple #24
0
        public void RefreshRW(MES_PD_SCRW_LIST list, string shebeihaoID)
        {
            this._MES_PD_SCRW_LIST = list;
            Tmlist = new List <TMDataGrid>();
            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;
            MES_SY_TYPEMXLIST bcmodel1 = new MES_SY_TYPEMXLIST();

            bcmodel1.ID     = 0;
            bcmodel1.MXNAME = "==请选择==";
            bcArr           = bclist.ToList();
            bcArr.Insert(0, bcmodel1);
            bccomboBox.DisplayMember = "MXNAME";
            bccomboBox.ValueMember   = "ID";
            bccomboBox.DataSource    = bcArr;
            bccomboBox.SelectedValue = list.BC;



            MESlabel.Text              = "MES工单:" + list.GDDH;
            GDHlabel.Text              = "工单号:" + list.ERPNO;
            WLXXlabel.Text             = "物料信息:" + list.WLH + "/" + list.WLMS;
            WLLBlabel1.Text            = "物料类别:" + list.WLLBNAME;
            rwdlabel.Text              = "任务单:" + list.RWBH;
            BOMdataGridView.DataSource = getBomList(_bomList);
            //scrqtextBox.Text = DateTime.Now.ToString("yyyy-MM-dd");
            LSdataGridView.ReadOnly = true;
            BOMdataGridView.Columns["状态"].DefaultCellStyle.BackColor = Color.Red;
            for (int i = 0; i < unRequireArr.Count; i++)
            {
                BOMdataGridView.Rows[unRequireArr[i]].Cells["状态"].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);
            }
            else
            {
                Tmlist = new  List <TMDataGrid>();
                LSdataGridView.DataSource = new List <TMDataGrid>();
                LSdataGridView.ClearSelection();
                LSdataGridView.Columns["删除"].DisplayIndex = 4;
            }
            if (RigthType == Rigth_Type.mfqqingxi)
            {
                GDHlabel.Visible   = false;
                WLXXlabel.Location = GDHlabel.Location;
            }
        }