private void JLdataGridView_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex != -1) { if (this.JLdataGridView.CurrentCell.OwningColumn.Name == q(Msg_Type.fielddelete))//"删除" { //string tm = Convert.ToString(this.JLdataGridView.CurrentRow.Cells["条码"].Value); //if (MessageBox.Show("是否确认删除条码" + tm, "消息框", MessageBoxButtons.OKCancel) == DialogResult.OK) //{ // MES_RETURN_UI res = ServicModel.TM_TMINFO.DELETE(tm, getToken()); // if (res.TYPE.Equals("S")) // { // configgridviewData(MES_PD_SCRW_LIST.RWBH); // ShowMeg("删除成功"); // } // else // { // ShowMeg(res.MESSAGE); // } //} } else if (this.JLdataGridView.CurrentCell.OwningColumn.Name == q(Msg_Type.fieldprint)) //"打印" { string tm = Convert.ToString(this.JLdataGridView.CurrentRow.Cells[q(Msg_Type.fieldtm)].Value); //"条码" frmPrintTM form = new frmPrintTM(tm, Rigth_Type.zhuxiancc, Print_Type.zxlot); show(form); } } }
/// <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); } } }
private void button1_Click(object sender, EventArgs e) { frmPrintTM form = new frmPrintTM(); show(form); }