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(); }
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(); //} }
public MES_RETURN_UI DELETE(MES_PD_SCRW model, string ptoken) { MES_RETURN mr = client.DELETE(model, ptoken); MES_RETURN_UI mrui = new MES_RETURN_UI(); mrui.TYPE = mr.TYPE; mrui.MESSAGE = mr.MESSAGE; return(mrui); }
private void btn_Click(object sender, EventArgs e) { Button btn = (Button)sender; int index = Convert.ToInt32(btn.Tag) % 100; //任务清单 = 10 打印lot = 11 int row = Convert.ToInt32(btn.Tag) / 100; //数组第几个元素 int indexL = IndexList[row]; if (indexL == -1) { indexL = 0; } MES_PD_SCRW_LIST model = Fjcclist[row].RwArr.MES_PD_SCRW_LIST[indexL]; if (index == 11) { if (model.ISACTION == 0) { ShowMeg(q(Msg_Type.titlewaitingfortl));//"投料还没完成请耐心等待" return; } timer1.Stop(); frmFJprint form = new frmFJprint(model); show(form); RefreshZn(); //configUI(Sbhlist); timer1.Start(); //configUI(Sbhlist); //this.Refresh(); } else if (index == 10) { string sbhh = model.SBBH; string sbh = model.SBH; MES_PD_SCRW rwmodel = new MES_PD_SCRW(); rwmodel.SBBH = sbhh; rwmodel.GC = model.GC;//getGC("value"); //model.GZZXBH = getUserInfo("gzzxvalue"); rwmodel.ZPRQ = GetSystemDate(Date_Type.hour, -4, "yyyy-MM-dd"); SELECT_MES_PD_SCRW res = ServicModel.PD_SCRW.SELECT(rwmodel, getToken()); if (res.MES_RETURN.TYPE.Equals("S")) { timer1.Stop(); frmSelectRWList_N form = new frmSelectRWList_N(res.MES_PD_SCRW_LIST, sbh); show(form); timer1.Start(); } else { //MessageBox.Show(res.MES_RETURN.MESSAGE, "消息框"); ShowMeg(res.MES_RETURN.MESSAGE); } } }
public string UPDATE_SCRW(string datastring) { string token = AppClass.GetSession("token").ToString(); string rst = ""; MES_PD_SCRW model_MES_PD_SCRW = Newtonsoft.Json.JsonConvert.DeserializeObject <MES_PD_SCRW>(datastring); MES_RETURN_UI rst_MES_RETURN_UI = mesModels.PD_SCRW.UPDATE_SCRW(model_MES_PD_SCRW, token); rst = Newtonsoft.Json.JsonConvert.SerializeObject(rst_MES_RETURN_UI); return(rst); }
public string GET_SCRW_BY_ROLE(string datastring) { int STAFFID = Convert.ToInt32(AppClass.GetSession("STAFFID")); string token = AppClass.GetSession("token").ToString(); MES_PD_SCRW model_MES_PD_SCRW = Newtonsoft.Json.JsonConvert.DeserializeObject <MES_PD_SCRW>(datastring); model_MES_PD_SCRW.STAFFID = STAFFID; SELECT_MES_PD_SCRW rst_SELECT_MES_PD_SCRW = mesModels.PD_SCRW.SELECT_BY_ROLE(model_MES_PD_SCRW, token); return(Newtonsoft.Json.JsonConvert.SerializeObject(rst_SELECT_MES_PD_SCRW)); }
public string DELETE_PD_SCRW(string RWBH) { string token = AppClass.GetSession("token").ToString(); string rst = ""; MES_PD_SCRW model = new MES_PD_SCRW(); model.RWBH = RWBH; MES_RETURN_UI rst_MES_RETURN_UI = mesModels.PD_SCRW.DELETE(model, token); rst = Newtonsoft.Json.JsonConvert.SerializeObject(rst_MES_RETURN_UI); return(rst); }
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(); }
private void frmFindSBH_Shown(object sender, EventArgs e) { string gzzx = Gzzx.Split('-')[0]; if (gzzx.Equals("Z2002")) { string sbh = ini.IniReadValue(ini.Section_Machine, "fjsbh"); if (!string.IsNullOrEmpty(sbh) && IsFJpipeline == true) { MES_PD_SCRW model = new MES_PD_SCRW(); model.SBBH = sbh; //DateTime dt = Convert.ToDateTime(ServicModel.PUBLIC_FUNC.GET_TIME(getToken())).AddHours(-4); //model.ZPRQ = Convert.ToDateTime(ServicModel.PUBLIC_FUNC.GET_TIME(getToken())).AddHours(-4).ToString("yyyy-MM-dd"); model.ZPRQ = GetSystemDate(Date_Type.hour, -4, "yyyy-MM-dd"); //model.ZPRQ = DateTime.Now.ToString("yyyy-MM-dd"); SELECT_MES_PD_SCRW Smodel = ServicModel.PD_SCRW.SELECT(model, getToken()); if (Smodel.MES_RETURN.Equals("E")) { ShowMeg(Smodel.MES_RETURN.MESSAGE); } else { if (Smodel.MES_PD_SCRW_LIST.Length > 0) { frmFujiTL_N fjtlform = new frmFujiTL_N(Smodel.MES_PD_SCRW_LIST, Smodel.MES_PD_SCRW_LIST[0].SBH, sbh); push(fjtlform, this); } else { ShowMeg(q(Msg_Type.msgnodata)); //"没有查询到数据" return; } //this.Close(); } } } else { if (Sbhlist.Length == 1) { foreach (Control ctl in panel1.Controls) { if (ctl is Button) { Button btn = (Button)ctl; this.btn_Click(btn, new EventArgs()); } } } } }
public string GET_SCRW(string GC, string GZZXBH, string PDRQ) { string token = AppClass.GetSession("token").ToString(); string rst = ""; MES_PD_SCRW model_MES_PD_SCRW = new MES_PD_SCRW(); model_MES_PD_SCRW.GC = GC; model_MES_PD_SCRW.GZZXBH = GZZXBH; model_MES_PD_SCRW.ZPRQ = PDRQ; MES_PD_SCRWANDPD_LIST_SELECT rst_MES_PD_SCRWANDPD_LIST_SELECT = mesModels.PD_SCRW.SELECT_SCRW_GD(model_MES_PD_SCRW, token); rst = Newtonsoft.Json.JsonConvert.SerializeObject(rst_MES_PD_SCRWANDPD_LIST_SELECT); return(rst); }
private void nextrwbutton_Click(object sender, EventArgs e) { MES_PD_SCRW model = new MES_PD_SCRW(); model.SBBH = SBHID; //model.ZPRQ = DateTime.Now.ToString("yyyy-MM-dd"); string currentDay = ServicModel.PUBLIC_FUNC.GET_TIME(getToken()); string ksDate = Convert.ToDateTime(currentDay).AddDays(1).ToString("yyyy-MM-dd"); string jsDate = Convert.ToDateTime(currentDay).AddDays(10).ToString("yyyy-MM-dd"); model.ZPRQKS = ksDate; model.ZPRQJS = jsDate; SELECT_MES_PD_SCRW res = ServicModel.PD_SCRW.SELECT(model, getToken()); if (res.MES_RETURN.TYPE.Equals("S")) { MES_PD_SCRW_LIST[] rwlist = res.MES_PD_SCRW_LIST; //(from o in nodes_right orderby o.RGROUPID, o.RIGHTNO select o).ToList(); List <MES_PD_SCRW_LIST> nodes = (from o in rwlist.ToList() orderby o.ZPRQ select o).ToList(); if (nodes.Count > 0) { string neardate = nodes[0].ZPRQ; List <MES_PD_SCRW_LIST> requirelist = new List <MES_PD_SCRW_LIST>(); for (int i = 0; i < nodes.Count; i++) { if (nodes[i].ZPRQ.Equals(neardate)) { requirelist.Add(nodes[i]); } } frmNearDateRW form = new frmNearDateRW(requirelist.ToArray()); show(form); } else { ShowMeg(q(Msg_Type.msgzsnorw));//"暂时没有任务指派" } } else { ShowMeg(q(Msg_Type.msgzsnorw));//"暂时没有任务指派" } SMtextBox.Select(); }
private void button1_Click(object sender, EventArgs e) { MES_PD_SCRW model = new MES_PD_SCRW(); model.SBBH = SBHID; //model.ZPRQ = DateTime.Now.ToString("yyyy-MM-dd"); model.ZPRQ = GetSystemDate(Date_Type.hour, -4, "yyyy-MM-dd");//Convert.ToDateTime(ServicModel.PUBLIC_FUNC.GET_TIME(getToken())).ToString("yyyy-MM-dd"); SELECT_MES_PD_SCRW res = ServicModel.PD_SCRW.SELECT(model, getToken()); if (res.MES_RETURN.TYPE.Equals("S")) { ConfigData(res.MES_PD_SCRW_LIST); } else { ShowMeg(res.MES_RETURN.MESSAGE); } }
private void radioButton3_Click(object sender, EventArgs e) { radioButton3.Checked = true; MES_PD_SCRW model = new MES_PD_SCRW(); model.SBBH = SBHID; model.ZPRQ = Convert.ToDateTime(ServicModel.PUBLIC_FUNC.GET_TIME(getToken())).ToString("yyyy-MM-dd"); SELECT_MES_PD_SCRW res = ServicModel.PD_SCRW.SELECT(model, getToken()); if (res.MES_RETURN.TYPE.Equals("S")) { ConfigData(res.MES_PD_SCRW_LIST); } else { ShowMeg(res.MES_RETURN.MESSAGE); } //ShowList(radioType.finish); }
public string GET_RWPD(string GDDH, string ZPRQ, string UNITSNAME, string GC, int BC, int SBFL) { string token = AppClass.GetSession("token").ToString(); string rst = ""; MES_PD_SCRW model_MES_PD_SCRW = new MES_PD_SCRW(); model_MES_PD_SCRW.GDDH = GDDH; model_MES_PD_SCRW.ZPRQ = ZPRQ; model_MES_PD_SCRW.BC = BC; model_MES_PD_SCRW.SBFL = SBFL; SELECT_MES_PD_SCRW rst_SELECT_MES_PD_SCRW = mesModels.PD_SCRW.SELECT_ZPQD(model_MES_PD_SCRW, token); for (int i = 0; i < rst_SELECT_MES_PD_SCRW.MES_PD_SCRW_LIST.Length; i++) { rst_SELECT_MES_PD_SCRW.MES_PD_SCRW_LIST[i].UNITSNAME = UNITSNAME; } rst = Newtonsoft.Json.JsonConvert.SerializeObject(rst_SELECT_MES_PD_SCRW); return(rst); }
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(); } }
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(); }
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(); } }
public string GET_SCRW_BYSBBH(string in_sm) { TokenINFO rst_TokenINFO = GET_TokenINFO(); MES_PD_SCRW model_MES_PD_SCRW = new MES_PD_SCRW(); model_MES_PD_SCRW.SBBH = in_sm; string ZPRQ = mesmodels.PUBLIC_FUNC.GET_TIME(rst_TokenINFO.Token); if (ZPRQ.Length > 10) { ZPRQ = ZPRQ.Substring(0, 10); } else { ZPRQ = DateTime.Now.ToString("yyyy-MM-dd"); } model_MES_PD_SCRW.ZPRQ = ZPRQ; SELECT_MES_PD_SCRW rst_SELECT_MES_PD_SCRW = mesmodels.PD_SCRW.SELECT_LAST(model_MES_PD_SCRW, rst_TokenINFO.Token); return(Newtonsoft.Json.JsonConvert.SerializeObject(rst_SELECT_MES_PD_SCRW)); }
private void button1_Click(object sender, EventArgs e) { //ConfigData(res.MES_PD_SCRW_LIST, Sbh); //jldataGridView.ClearSelection(); ////jldataGridView.Rows[Index].Selected = true; //jldataGridView.CurrentCell = jldataGridView.Rows[Index].Cells[0]; //jldataGridView.ClearSelection(); MES_PD_SCRW model = new MES_PD_SCRW(); model.SBBH = SBHID; model.ZPRQ = DateTime.Now.ToString("yyyy-MM-dd"); SELECT_MES_PD_SCRW res = ServicModel.PD_SCRW.SELECT(model, getToken()); if (res.MES_RETURN.TYPE.Equals("S")) { ConfigData(res.MES_PD_SCRW_LIST); } else { ShowMeg(res.MES_RETURN.MESSAGE); } }
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(); //} } }
public MES_RETURN INSERT_BY_FJPD(MES_PD_SCRW model, string ptoken) { return(client.INSERT_BY_FJPD(model, ptoken)); }
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)); } }
public frmBBprint(MES_TM_TMINFO_INSERT_GL model, Print_Type ptype, Rigth_Type rtype, MES_PD_SCRW_LIST list) { InitializeComponent(); RigthType = rtype; PrintType = ptype; MES_PD_SCRW scrwmodel = new MES_PD_SCRW(); scrwmodel.RWBH = list.RWBH; SELECT_MES_PD_SCRW res = ServicModel.PD_SCRW.SELECT(scrwmodel, getToken()); if (res.MES_PD_SCRW_LIST.Length == 0) { ShowMeg(q(Msg_Type.msgrwdempty)); return; } list = res.MES_PD_SCRW_LIST[0]; if (list == null) { ShowMeg(q(Msg_Type.msgrwdempty)); return; } MES_TM_TMINFO_INSERT_GL = model; wlxxtextBox.Text = list.WLH + "/" + list.WLMS; if (!string.IsNullOrEmpty(list.XSNOBILL)) { if (!string.IsNullOrEmpty(list.PC)) { wlsxtextBox.Text = list.XSNOBILL + "-" + list.XSNOBILLMX + "/" + list.PC; } else { wlsxtextBox.Text = list.XSNOBILL + "-" + list.XSNOBILLMX; } } else { if (!string.IsNullOrEmpty(list.PC)) { wlsxtextBox.Text = list.PC; } } dcxhtextBox.Text = list.DCXHNAME; dcdjtextBox.Text = list.DCDJNAME; mbsltextBox.Text = Convert.ToString(list.MPSL); bbpmtextBox.Text = list.RQM; //if (judge.IsNumber(list.XSNOBILL) == false && !string.IsNullOrEmpty(list.XSNOBILL)) //{ // bzrichTextBox.Text = list.XSNOBILL + "-" + list.XSNOBILLMX; //} cpztcomboBox.DataSource = GetDictionaryMX(9); cpztcomboBox.DisplayMember = "MXNAME"; cpztcomboBox.ValueMember = "ID"; zhtextBox.Text = Convert.ToString(ServicModel.PD_SCRW.SELECT_TH_BY_GDDH_SBBH(list.RWBH, getToken()).TH); List <MES_SY_TYPEMXLIST> sbcdlist = GetDictionaryMX(15).ToList(); MES_SY_TYPEMXLIST choicllist = new MES_SY_TYPEMXLIST(); choicllist.ID = 0; choicllist.MXNAME = q(Msg_Type.titlechoice); sbcdlist.Insert(0, choicllist); sbcdcomboBox.DataSource = sbcdlist; sbcdcomboBox.DisplayMember = "MXNAME"; sbcdcomboBox.ValueMember = "ID"; List <MES_SY_TYPEMXLIST> hdgxlist = GetDictionaryMX(19).ToList(); hdgxlist.Insert(0, choicllist); hdgxcomboBox.DisplayMember = "MXNAME"; hdgxcomboBox.ValueMember = "ID"; hdgxcomboBox.DataSource = hdgxlist; hdgxcomboBox.SelectedValue = list.XDGX; }
private void btn_Click(object sender, EventArgs e) { Button btn = (Button)sender; string sbbh = Convert.ToString(btn.Tag); MES_PD_SCRW model = new MES_PD_SCRW(); model.SBBH = sbbh; //model.ZPRQ = DateTime.Now.ToString("yyyy-MM-dd"); model.ZPRQ = Convert.ToDateTime(ServicModel.PUBLIC_FUNC.GET_TIME(getToken())).ToString("yyyy-MM-dd"); string sydt = ""; SBHID = model.SBBH; SELECT_MES_PD_SCRW Smodel; 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: sydt = GetSystemDate(Date_Type.hour, -4, "yyyy-MM-dd");//Convert.ToDateTime(ServicModel.PUBLIC_FUNC.GET_TIME(getToken())).AddHours(-4).ToString("yyyy-MM-dd");//系统减4个小时 model.ZPRQ = sydt; Smodel = ServicModel.PD_SCRW.SELECT(model, getToken()); break; case Rigth_Type.fujicc: sydt = GetSystemDate(Date_Type.hour, -4, "yyyy-MM-dd");//Convert.ToDateTime(ServicModel.PUBLIC_FUNC.GET_TIME(getToken())).AddHours(-4).ToString("yyyy-MM-dd");//系统减4个小时 model.ZPRQ = sydt; 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; } //如果是E的时候只有包标、组合电池、包装可以进入投料产出界面,在界面上扫描工单和托盘码生成相应的任务 if (Smodel.MES_RETURN.TYPE == "E") { if (RigthType == Rigth_Type.baobiaocc || RigthType == Rigth_Type.dczztl_cc) { if (string.IsNullOrEmpty(Tm)) { frmBaobiao form = new frmBaobiao(new MES_PD_SCRW_LIST(), model.SBBH, RigthType, btn.Text); push(form, this); } else { frmBaobiao form = new frmBaobiao(new MES_PD_SCRW_LIST(), model.SBBH, RigthType, btn.Text, Tm); push(form, this); } return; } else if (RigthType == Rigth_Type.baozhuangcc) { if (string.IsNullOrEmpty(Tm)) { frmBaozhuang form = new frmBaozhuang(new MES_PD_SCRW_LIST(), model.SBBH, RigthType, btn.Text); push(form, this); } else { frmBaozhuang form = new frmBaozhuang(new MES_PD_SCRW_LIST(), model.SBBH, RigthType, btn.Text, Tm); 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 + "设备号是" + btn.Text + "对应的派单任务!!!", "消息框"); ShowMeg(string.Format(q(Msg_Type.msgnorw), Gzzx, btn.Text)); return; } else if (Smodel.MES_PD_SCRW_LIST.Length == 1) { if (RigthType == Rigth_Type.fujitl) { ini.IniWriteValue(ini.Section_Machine, "fjsbh", sbbh); frmFujiTL_N fjtlform = new frmFujiTL_N(Smodel.MES_PD_SCRW_LIST, btn.Text, 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 || 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(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) { if (string.IsNullOrEmpty(Tm)) { frmBaobiao form = new frmBaobiao(Smodel.MES_PD_SCRW_LIST[0], model.SBBH, RigthType, btn.Text); push(form, this); } else { frmBaobiao form = new frmBaobiao(Smodel.MES_PD_SCRW_LIST[0], model.SBBH, RigthType, btn.Text, Tm); push(form, this); } } else if (RigthType == Rigth_Type.baozhuangcc) { if (string.IsNullOrEmpty(Tm)) { frmBaozhuang form = new frmBaozhuang(new MES_PD_SCRW_LIST(), model.SBBH, RigthType, btn.Text); push(form, this); } else { frmBaozhuang form = new frmBaozhuang(new MES_PD_SCRW_LIST(), model.SBBH, RigthType, btn.Text, Tm); 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)//查询到的任务大于1的只有负极投料和主线投料 { if (RigthType == Rigth_Type.fujitl) { ini.IniWriteValue(ini.Section_Machine, "fjsbh", sbbh); frmFujiTL_N fjtlform = new frmFujiTL_N(Smodel.MES_PD_SCRW_LIST, btn.Text, 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(); } }
public SELECT_MES_PD_SCRW SELECT_LAST(MES_PD_SCRW model, string ptoken) { return(client.SELECT_LAST(model, ptoken)); }
public SELECT_MES_PD_SCRW UPDATE_FJCC(MES_PD_SCRW model, string ptoken) { return(client.UPDATE_FJCC(model, ptoken)); }
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(); }
public MES_PD_SCRWANDPD_LIST_SELECT SELECT_SCRW_GD(MES_PD_SCRW model, string ptoken) { return(client.SELECT_SCRW_GD(model, ptoken)); }
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; } }
public SELECT_MES_PD_SCRW SELECT_BY_ROLE(MES_PD_SCRW model, string ptoken) { return(client.SELECT_BY_ROLE(model, ptoken)); }