private void btnOK_Click(object sender, EventArgs e) { if (txtName.Text.Trim().Length < 1) { txtName.Focus(); MsgBoxEx.Info("Please input name"); return; } IsysService service = sysService.GetService(); string res = ""; if (IsAdd) { res = service.AddRole(txtCode.Text, txtName.Text.Trim(), txtRemark.Text.Trim(), DataCache.UserInfo.ID); } else { res = service.UpdateRole(txtCode.Text, txtName.Text.Trim(), txtRemark.Text.Trim(), DataCache.UserInfo.ID); } if (res != "1") { MsgBoxEx.Info(res); return; } DialogResult = DialogResult.OK; }
private void InitWaferOption(IsysService service) { //yield var list = service.GetCmn("3010"); if (list.Count > 0) { foreach (var l in list) { switch (l.CODE) { case "0": nudLotYield.Value = decimal.Parse(l.VALUE); break; case "1": nudWaferYield.Value = decimal.Parse(l.VALUE); break; default: break; } } } }
private void BtnClassRole_Click(object sender, EventArgs e) { List <CMNDICT> dictList = new List <CMNDICT>(); if (clbClass.SelectedItems.Count == 0) { MsgBoxEx.Info("Please select at least one item."); return; } foreach (WmClassificationItemEntity item in clbClass.CheckedItems) { CMNDICT model = new CMNDICT(); model.DICTID = "3000"; model.CODE = item.ID.ToString(); model.NAME = item.NAME.ToString(); dictList.Add(model); } IsysService service = sysService.GetService(); service.AddDict(dictList); MsgBoxEx.Info("Save success, please refresh the data."); }
private void btnSystem_Click(object sender, EventArgs e) { IsysService service = sysService.GetService(); var list = service.GetCmn("3022"); if (list.Count > 0) { foreach (var l in list) { switch (l.CODE) { case "0": l.VALUE = nudDisk.Value.ToString(); break; default: break; } } } service.UpdateDict(list); MsgBoxEx.Info("Save success, please refresh the data."); }
private void btnOK_Click(object sender, EventArgs e) { StringBuilder sbt = new StringBuilder(); foreach (var m in pnl.Controls) { if (m is CheckBox) { CheckBox cb = (CheckBox)m; if (cb.Checked) { sbt.AppendFormat("|{0}", cb.Tag); } } } if (sbt.Length > 0) { sbt.Remove(0, 1); } IsysService service = sysService.GetService(); service.AddRoleMenu(roleID, sbt.ToString()); DialogResult = DialogResult.OK; }
private void GetData(string rolename) { IsysService service = sysService.GetService(); var data = service.GetRoleList(rolename); grdData.DataSource = data.OrderBy(p => p.CREATEDATE).ToList(); }
bool arule_OptRule(string type, string[] data) { IsysService service = sysService.GetService(); var rs = string.Empty; switch (type) { case "ADD": data[0] = Guid.NewGuid().ToString(); rs = service.AddRule(data[0], data[1], data[2], data[3], data[4].ToLower() == "all" ? "*" : data[4]); break; case "EDIT": rs = service.EditRule(data[0], data[1], data[2], data[3], data[4].ToLower() == "all" ? "*" : data[4]); break; case "DEL": rs = service.DelRule(data[0]); break; default: break; } if (rs == "-1") { MsgBoxEx.Info("Name already exist"); return(false); } frm_config_Load(null, null); return(true); }
private void GetData(string str) { IsysService service = sysService.GetService(); var list = service.GetUserList(str); list.ForEach((p) => { p.RE_REVIEW = (p.RE_REVIEW == "0" ? "No" : "Yes"); }); grdData.DataSource = list; }
private void btnOk_Click(object sender, EventArgs e) { if (txtOldPwd.Text.Trim().Length < 1) { txtOldPwd.Focus(); MsgBoxEx.Info("Please input old password"); return; } if (txtNewPwd.Text.Trim().Length < 1) { txtNewPwd.Focus(); MsgBoxEx.Info("Please input new password"); return; } if (txtConPwd.Text.Trim().Length < 1) { txtConPwd.Focus(); MsgBoxEx.Info("Please input confirm password"); return; } if (txtNewPwd.Text.Trim() != txtConPwd.Text.Trim()) { txtNewPwd.Focus(); MsgBoxEx.Info("New password and confirm password is not the same"); return; } IsysService service = sysService.GetService(); string res = service.UpdatePwd(DataCache.UserInfo.ID, txtOldPwd.Text.Trim(), txtNewPwd.Text.Trim(), DataCache.UserInfo.ID); if (res == "1") { MsgBoxEx.Info("Your password has been changed successfully,Please log in again."); //btnClose_Click(null, null); if (frmMain != null) { frmMain.ReLogin(); } } else if (res == "-1") { MsgBoxEx.Error("Your old password input errors"); } else { MsgBoxEx.Error("Your password modification failed"); } }
private void grdData_SelectionChanged(object sender, EventArgs e) { if (grdData.SelectedRows == null || grdData.SelectedRows.Count < 1) { return; } string id = grdData.SelectedRows[0].Cells["ColCode"].Value.ToString(); grdMenu.AllowUserToOrderColumns = false; IsysService service = sysService.GetService(); grdMenu.DataSource = service.GetMenuByRoleId(id); }
private void frm_main_Load(object sender, EventArgs e) { timer1.Enabled = true; cbxLang.SelectedIndex = 0; label4.Text = string.Format("{0:yyyy/MM/dd HH:mm:ss}", DateTime.Now); pnlLeft.Enabled = false; pnlLeft.Width = 1; lblArrow.Image = global::WR.Client.UI.Properties.Resources.pright; ShowForm(""); System.Threading.Tasks.Task.Factory.StartNew(() => { while (true) { try { System.Threading.Thread.Sleep(60000); //20s IsysService service = sysService.GetService(); var deviceArray = service.GetHeartBeatInterval().Select(s => s.REMARK).ToArray(); if (deviceArray.Length > 0) { var msg = string.Format("The {0} has stopped uploading, please check its status.", string.Join(",", deviceArray)); if (this.InvokeRequired) { this.BeginInvoke(new Action(() => { MsgBoxEx.Warn(msg); })); } else { MsgBoxEx.Warn(msg); } return; } } catch (Exception ex) { } } }); }
private void frm_userrole_Load(object sender, EventArgs e) { IsysService service = sysService.GetService(); var data = service.GetAllRoleByUserId(userID); foreach (var m in data.OrderBy(p => p.CREATEDATE)) { CheckBox cb = new CheckBox(); cb.Tag = m.ID; cb.Text = string.Format("[{0}]", m.ROLENAME); cb.Checked = (m.FLG == "0" ? true : false); cb.Width = 160; pnl.Controls.Add(cb); } lstL.Items.Clear(); lstR.Items.Clear(); //全部rule var lst = service.GetRule(); lstL.BeginUpdate(); foreach (var item in lst) { ListViewItem itm = new ListViewItem(item.RULENAME); itm.Name = item.ID + "L"; itm.Tag = item.ID; lstL.Items.Add(itm); } lstL.EndUpdate(); //已绑定rule var lstU = service.GetRuleByUserid(ID); lstR.BeginUpdate(); foreach (var item in lstU) { ListViewItem itm = new ListViewItem(item.RULENAME); itm.Name = item.RULEID + "R"; itm.Tag = item.RULEID; lstR.Items.Add(itm); } lstR.EndUpdate(); }
private void tlDel_Click(object sender, EventArgs e) { if (grdData.SelectedRows == null || grdData.SelectedRows.Count < 1) { return; } if (MsgBoxEx.ConfirmYesNo("Are you sure to delete the record?") == DialogResult.No) { return; } string id = grdData.SelectedRows[0].Cells["ColCode"].Value.ToString(); IsysService service = sysService.GetService(); service.DelRole(id); tlSearch.PerformClick(); }
private void btnArchive_Click(object sender, EventArgs e) { if (MsgBoxEx.ConfirmYesNo("Are you sure to archive the data") == DialogResult.No) { return; } DataOperation(0); DataCache.RefreshCache(); IsysService service = sysService.GetService(); var entity = service.GetCmn("3021").FirstOrDefault(s => s.CODE == "0"); if (entity != null) { txtArchiveDate.Text = entity.VALUE; } }
private void btnOK_Click(object sender, EventArgs e) { StringBuilder sbt = new StringBuilder(); foreach (var m in pnl.Controls) { if (m is CheckBox) { CheckBox cb = (CheckBox)m; if (cb.Checked) { sbt.AppendFormat("|{0}", cb.Tag); } } } if (sbt.Length > 0) { sbt.Remove(0, 1); } IsysService service = sysService.GetService(); service.AddUserRole(userID, sbt.ToString()); StringBuilder sbt2 = new StringBuilder(); foreach (ListViewItem m in lstR.Items) { sbt2.AppendFormat("|{0}", m.Tag); } if (sbt2.Length > 0) { sbt2.Remove(0, 1); } service.EditUserRule(ID, sbt2.ToString()); DialogResult = DialogResult.OK; }
private void frm_rolemenu_Load(object sender, EventArgs e) { IsysService service = sysService.GetService(); var data = service.GetAllMenuByRoleId(roleID); foreach (var m in data.OrderBy(p => p.MENUCODE)) { CheckBox cb = new CheckBox(); cb.Tag = m.ID; cb.Text = string.Format("[{0}]{1}", m.MENUCODE, m.MENUNAME); cb.Checked = (m.FLG == "0" ? true : false); cb.Width = 160; if (m.MENUCODE == "123") { cb.Enabled = false; cb.Checked = true; } pnl.Controls.Add(cb); } }
private void InitSystemOption(IsysService service) { //yield var list = service.GetCmn("3022"); if (list.Count > 0) { foreach (var l in list) { switch (l.CODE) { case "0": nudDisk.Value = decimal.Parse(l.VALUE); break; default: break; } } } }
private void btnOK_Click(object sender, EventArgs e) { if (txtID.Text.Trim().Length < 1) { txtID.Focus(); MsgBoxEx.Info("Please input ID"); return; } if (txtName.Text.Trim().Length < 1) { txtName.Focus(); MsgBoxEx.Info("Please input name"); return; } IsysService service = sysService.GetService(); string res = ""; if (IsAdd) { res = service.AddUser(Guid.NewGuid().ToString("N").ToUpper(), txtID.Text.Trim(), txtPwd.Text.Trim(), txtName.Text.Trim(), txtPhone.Text.Trim(), txtEmail.Text.Trim(), txtRemark.Text.Trim(), (cbxRereview.Checked ? "1" : "0"), DataCache.UserInfo.ID); } else { res = service.UpdateUser(tbUser.ID, txtID.Text.Trim(), txtPwd.Text.Trim(), txtName.Text.Trim(), txtPhone.Text.Trim(), txtEmail.Text.Trim(), txtRemark.Text.Trim(), (cbxRereview.Checked ? "1" : "0"), DataCache.UserInfo.ID); } if (res != "1") { MsgBoxEx.Info(res); return; } DialogResult = DialogResult.OK; }
private void InitClassificationRole(IsysService service) { //缺陷分类权限 IwrService wService = wrService.GetService(); clbClass.DataSource = wService.GetBaseClassificationItem(); clbClass.ValueMember = "id"; clbClass.DisplayMember = "name"; var dictList = service.GetCmn("3000"); for (int i = 0; i < clbClass.Items.Count; i++) { var code = ((WmClassificationItemEntity)clbClass.Items[i]).ID.ToString(); var rs = dictList.Count(s => s.CODE == code) > 0; if (rs) { clbClass.SetItemChecked(i, true); } } }
private void btnWaferYield_Click(object sender, EventArgs e) { IsysService service = sysService.GetService(); //yield var list = service.GetCmn("3010"); if (list.Count > 0) { foreach (var l in list) { switch (l.CODE) { case "0": l.VALUE = nudLotYield.Value.ToString(); break; case "1": l.VALUE = nudWaferYield.Value.ToString(); break; default: break; } } } var rs = service.UpdateDict(list); if (rs == "0") { DataCache.CmnDict = service.GetCmn(""); } MsgBoxEx.Info("Save success, please refresh the data."); }
private void frm_config_Load(object sender, EventArgs e) { fpnl.Controls.Clear(); IsysService service = sysService.GetService(); var lst = service.GetRule().OrderByDescending(p => p.CREATEDDATE); if (lst != null && lst.Count() > 0) { foreach (var c in lst) { WrRule erule = new WrRule(); erule.Ruleid = c.ID; erule.Rulename = c.RULENAME; erule.Ruledesr = c.DESCRP; erule.Deviceid = c.DEVICE; erule.Layer = c.LAYER; erule.RType = "EDIT"; erule.OptRule += new RuleOptEventHandler(arule_OptRule); fpnl.Controls.Add(erule); } } WrRule arule = new WrRule(); arule.RType = "ADD"; arule.OptRule += new RuleOptEventHandler(arule_OptRule); fpnl.Controls.Add(arule); cbxNotdone.Checked = DataCache.UserInfo.notdone; cbxDay.Checked = DataCache.UserInfo.theday; cbxLast.Checked = DataCache.UserInfo.lastday; cbxSpec.Checked = DataCache.UserInfo.specifiedday; if (cbxSpec.Checked) { dtDate.Value = DateTime.ParseExact(DataCache.UserInfo.fromday.ToString(), "yyyyMMdd", null, System.Globalization.DateTimeStyles.None); dateTo.Value = DateTime.ParseExact(DataCache.UserInfo.today.ToString(), "yyyyMMdd", null, System.Globalization.DateTimeStyles.None); } else { dtDate.Value = DateTime.Today.AddDays(-365); dateTo.Value = DateTime.Today; } cbxInterval.Checked = DataCache.UserInfo.IntervalDays > 0 ? true : false; if (cbxInterval.Checked) { nudDay.Value = DataCache.UserInfo.IntervalDays; } //过滤重复数据 cbxFilter.Checked = DataCache.UserInfo.FilterData; InitClassificationRole(service); txtSinfPath.Text = DataCache.SinfPath; if (DataCache.BinCodeType == "10") { rbnDecimal.Checked = true; } else { rbnHexadecimal.Checked = true; } if (DataCache.SinfType == "000") { rbnThreeByte.Checked = true; } else { rbnTwoByte.Checked = true; } InitWaferOption(service); InitSystemOption(service); YieldInit(); InitHotKey(); }
private void Login(string userid, string pwd) { IsysService service = sysService.GetService(); UserInfoEntity ent = service.Login(userid, pwd); if (ent.IsOK == 0) { DataCache.UserInfo = ent; LoadLocalSettings(DataCache.UserInfo); DataCache.CmnDict = service.GetCmn(""); DataCache.Tbmenus = service.GetMenuByUserId(userid); var msg = GetExamInfo(); if (!string.IsNullOrEmpty(msg)) { MsgBoxEx.Info(msg); return; } //加载数据 DataCache.RefreshCache(); if (this.InvokeRequired) { this.Invoke(new Action(() => { System.Configuration.Configuration config = WR.Utils.Config.GetConfig(); config.AppSettings.Settings.Remove("userid"); config.AppSettings.Settings.Add("userid", userid); config.Save(); WR.Utils.Config.Refresh(); frmMain.SetForm(); })); } else { System.Configuration.Configuration config = WR.Utils.Config.GetConfig(); config.AppSettings.Settings.Remove("userid"); config.AppSettings.Settings.Add("userid", userid); config.Save(); WR.Utils.Config.Refresh(); frmMain.SetForm(); } } else { string msg = MessageConst.frm_login_msg003; switch (ent.IsOK) { case -99: msg = MessageConst.frm_login_msg003; break; case -1: msg = MessageConst.const_msg001; break; case -2: msg = MessageConst.const_msg002; break; case -3: msg = MessageConst.const_msg003; break; case -4: msg = MessageConst.const_msg001; break; default: msg = MessageConst.const_msg001; break; } if (this.InvokeRequired) { this.Invoke(new Action(() => { MsgBoxEx.Info(msg); btnOK.Enabled = true; btnReset.Enabled = true; lblMsg.Visible = false; txtUser.Enabled = true; txtPwd.Enabled = true; txtPwd.Focus(); })); } else { MsgBoxEx.Info(msg); btnOK.Enabled = true; btnReset.Enabled = true; lblMsg.Visible = false; txtUser.Enabled = true; txtPwd.Enabled = true; txtPwd.Focus(); } } }
private void DataOperation(int type) { string sdate = string.Empty; string edate = string.Empty; if (type == 0) { if (rbtASpecified.Checked == true) { if (dtpAfrom.Value > dtpAto.Value) { MsgBoxEx.Info("Start time cannot be greater than end time."); return; } sdate = dtpAfrom.Value.ToString("yyyyMMdd"); edate = dtpAto.Value.ToString("yyyyMMdd"); } else { sdate = DateTime.MinValue.ToString("yyyyMMdd"); edate = dtpAless.Value.ToString("yyyyMMdd"); } } else if (type == 1) { if (rbtRSpecified.Checked == true) { if (dtpRfrom.Value > dtpRto.Value) { MsgBoxEx.Info("Start time cannot be greater than end time."); return; } sdate = dtpRfrom.Value.ToString("yyyyMMdd"); edate = dtpRto.Value.ToString("yyyyMMdd"); } else { sdate = DateTime.MinValue.ToString("yyyyMMdd"); edate = dtpRless.Value.ToString("yyyyMMdd"); } } else if (type == 2) { if (rbtDSpecified.Checked == true) { if (dtpDfrom.Value > dtpDto.Value) { MsgBoxEx.Info("Start time cannot be greater than end time."); return; } sdate = dtpDfrom.Value.ToString("yyyyMMdd"); edate = dtpDto.Value.ToString("yyyyMMdd"); } else { sdate = DateTime.MinValue.ToString("yyyyMMdd"); edate = dtpDless.Value.ToString("yyyyMMdd"); } } try { ShowLoading(ToopEnum.loading); IwrService service = wrService.GetService(); var msg = service.DataArchive(sdate, edate, type.ToString()); MsgBoxEx.Info(msg); } catch (Exception ex) { throw ex; } finally { //3020 IsysService service = sysService.GetService(); var list = service.GetCmn("3020"); if (list[0].CODE == "1") { list[0].CODE = "0"; service.UpdateDict(list); } CloseLoading(); } }