public void ShowSessionHisList() { wsSYS.IwsSYSClient client =new wsSYS.IwsSYSClient(); try { baseForm.SetCursor(); DateTime fromLogonTime = DateTime.Parse(((DateTime)QueryParameters["fromlogontime"]).ToString("yyyy-MM-dd")+" 00:00:00"); DateTime toLogonTime = DateTime.Parse(((DateTime)QueryParameters["tologontime"]).ToString("yyyy-MM-dd") + " 23:59:59"); DataSet ds = client.GetSessionHisRecords(baseForm.CurrentContextInfo, (string)QueryParameters["userid"], (string)QueryParameters["machine"], (string)QueryParameters["ipaddress"], (string)QueryParameters["shift"], fromLogonTime, toLogonTime); this.gridSessionHisList.DataSource = ds.Tables[0]; if (ds.Tables[0].Rows.Count > 0) { this.ucToolbarSessionHisList.SetToolbarWithRows(); this.gridSessionHisList.Rows[0].Selected = true; } else { this.ucToolbarSessionHisList.SetToolbarWithoutRows(); } this.ucStatusBarSessionHisList.ShowText1(UtilCulture.GetString("Msg.R00006") + ": " + ds.Tables[0].Rows.Count.ToString()); } catch (Exception ex) { throw ex; } finally { baseForm.ResetCursor(); baseForm.CloseWCF(client); } }
public List<tsysstaticvalue> GetAllStaticValue() { wsSYS.IwsSYSClient client = new wsSYS.IwsSYSClient(); List<tsysstaticvalue> lstConfig = new List<tsysstaticvalue>(); try { List<MESParameterInfo> lstParameters = new List<MESParameterInfo>() { }; lstParameters.Add(new MESParameterInfo() { ParamName = "svstatus", ParamValue = "Active", ParamType = "string" }); lstConfig = client.GetStaticValueList(CurrentContextInfo, lstParameters.ToArray<MESParameterInfo>()).ToList<tsysstaticvalue>(); return lstConfig; } catch (Exception ex) { throw ex; } finally { CloseWCF(client); } }
public void DoMultiDelete() { if (this.gridSessionHisList.Selected.Rows.Count>0) { List<string> lstSession = new List<string>(); foreach (UltraGridRow row in this.gridSessionHisList.Selected.Rows) { lstSession.Add(row.Cells["SESSIONID"].Value.ToString()); } DialogResult result = baseForm.CreateMessageBox(Public_MessageBox.Question, MessageBoxButtons.OKCancel,null, UtilCulture.GetString("Msg.R00004")); if (result == DialogResult.OK) { wsSYS.IwsSYSClient client = new wsSYS.IwsSYSClient(); try { baseForm.SetCursor(); client.DoSessionMultiDelete(baseForm.CurrentContextInfo, lstSession.ToArray<string>()); ShowSessionHisList(); } catch (Exception ex) { MESMsgBox.ShowError(ExceptionParser.Parse(ex)); } finally { baseForm.ResetCursor(); baseForm.CloseWCF(client); } } } }
public void CheckRevision() { string clientRevision = ConfigReader.getCurrentRevision(); string serverRevision = string.Empty; wsSYS.IwsSYSClient client = new wsSYS.IwsSYSClient(); try { List<MESParameterInfo> lstParameter = new List<MESParameterInfo>(); List<tsysappinfo> lstAppInfo = client.GetAppInfoList(baseForm.CurrentContextInfo, lstParameter.ToArray<MESParameterInfo>()).ToList<tsysappinfo>(); if (lstAppInfo.Count > 0) { serverRevision = lstAppInfo[0].revision; } else { serverRevision = MES_Misc.Unknown.ToString(); } } catch (Exception ex) { serverRevision = MES_Misc.Unknown.ToString(); this.txtLog.Text += "Call WCF error.(" + ExceptionParser.Parse(ex) + ")\r\n"; } finally { baseForm.CloseWCF(client); } if (serverRevision.Trim() != clientRevision.Trim()) { this.txtLog.Text += "New revision found." + "\r\n"; this.txtLog.Text += "Server revision: " + serverRevision + "\r\n"; this.txtLog.Text += "Client revision: " + clientRevision + "\r\n"; this.txtLog.Text += "Click OK button to download and install new revision." + "\r\n"; this.btnOK.Enabled = true; NewRevisionFound = true; return; } this.txtLog.Text += "New revision not found." + "\r\n"; this.btnOK.Enabled = false; NewRevisionFound = false; isCancelled = false; this.Close(); }
public List<tsyssystemconfig> GetAllSystemConfig() { wsSYS.IwsSYSClient client = new wsSYS.IwsSYSClient(); List<tsyssystemconfig> lstConfig = new List<tsyssystemconfig>(); try { lstConfig = client.GetAllSystemConfigValue().ToList<tsyssystemconfig>(); return lstConfig; } catch (Exception ex) { throw ex; } finally { CloseWCF(client); } }
public void DoDelete() { if (this.grdQuery.ActiveRow == null) return; DialogResult result = baseForm.CreateMessageBox(Public_MessageBox.Question, MessageBoxButtons.OKCancel, UtilCulture.GetString("Msg.R00004"), "<span style='font-weight:bold;'>" + UtilCulture.GetString("Label.R00481") + ": </span> " + this.grdQuery.ActiveRow.Cells["configname"].Value.ToString()); if (result == DialogResult.Cancel) return; wsSYS.IwsSYSClient client = new wsSYS.IwsSYSClient(); try { baseForm.SetCursor(); List<MESParameterInfo> lstParameters = new List<MESParameterInfo>() { new MESParameterInfo(){ ParamName="configname", ParamValue=this.grdQuery.ActiveRow.Cells["configname"].Value.ToString(), ParamType="string" } }; client.DoDeleteSystemConfig(baseForm.CurrentContextInfo, lstParameters.ToArray<MESParameterInfo>()); baseForm.CreateMessageBox(Public_MessageBox.Information, MessageBoxButtons.OK, null, UtilCulture.GetString("Msg.R00003")); GetData(QueryParameters); } catch (Exception ex) { baseForm.ResetCursor(); MESMsgBox.ShowError(ExceptionParser.Parse(ex)); } finally { baseForm.ResetCursor(); baseForm.CloseWCF(client); } }
public void UnlockBill(string bcrid, string lockRefId) { wsSYS.IwsSYSClient client = new wsSYS.IwsSYSClient(); try { client.UnlockBill(CurrentContextInfo, bcrid, lockRefId); } catch (Exception ex) { throw ex; } finally { CloseWCF(client); } }
public List<string> GetBillNoBatch(string bcrid, int batchNum, string lockRefId, string baseValue, List<MESParameterInfo> lstVariablesParameters) { wsSYS.IwsSYSClient client = new wsSYS.IwsSYSClient(); List<string> lstResult = new List<string>(); try { lstResult = client.GetBatchBillNo(CurrentContextInfo, bcrid, batchNum, lockRefId, baseValue, lstVariablesParameters.ToArray<MESParameterInfo>()).ToList<string>(); } catch (Exception ex) { throw ex; } finally { CloseWCF(client); } return lstResult; }
public string GetBillNo(string bcrid, string lockRefId, string baseValue, List<MESParameterInfo> lstVariablesParameters) { wsSYS.IwsSYSClient client = new wsSYS.IwsSYSClient(); string result = string.Empty; try { result = client.GetSingleBillNo(CurrentContextInfo, bcrid, lockRefId, baseValue, lstVariablesParameters.ToArray<MESParameterInfo>()); } catch (Exception ex) { throw ex; } finally { CloseWCF(client); } return result; }
public string GetBillNo(string bcrid) { wsSYS.IwsSYSClient client = new wsSYS.IwsSYSClient(); string result = string.Empty; try { result = client.GetSingleBillNo(CurrentContextInfo, bcrid, string.Empty, string.Empty, new List<MESParameterInfo>() { }.ToArray<MESParameterInfo>()); } catch (Exception ex) { throw ex; } finally { CloseWCF(client); } return result; }
public tsysattrtplate GetAttributeTemplateObject(string attributeTemplateId) { wsSYS.IwsSYSClient client = new wsSYS.IwsSYSClient(); try { List<MESParameterInfo> lstParameters = new List<MESParameterInfo>() { new MESParameterInfo(){ ParamName="attrtplatid", ParamValue=attributeTemplateId, ParamType="string" } }; tsysattrtplate template = client.GetSingleAttributeTemplate(CurrentContextInfo, lstParameters.ToArray<MESParameterInfo>()); return template; } catch (Exception ex) { throw ex; } finally { CloseWCF(client); } }
public List<tsysmenuconfig> GetAllMenu() { wsSYS.IwsSYSClient client = new wsSYS.IwsSYSClient(); try { List<MESParameterInfo> lstParameters = new List<MESParameterInfo>(); BaseForm baseForm = new BaseForm(); return client.GetMenuConfigList(baseForm.CurrentContextInfo, lstParameters.ToArray<MESParameterInfo>()).ToList<tsysmenuconfig>(); } catch (Exception ex) { throw ex; } finally { baseForm.CloseWCF(client); } }
private void ShowSessionList() { wsSYS.IwsSYSClient client = new wsSYS.IwsSYSClient(); try { baseForm.SetCursor(); DataSet ds = client.GetSessionRecords(baseForm.CurrentContextInfo, (new List<MESParameterInfo>()).ToArray<MESParameterInfo>()); this.gridSessionList.SetDataBinding(ds.Tables[0], ""); if (ds.Tables[0].Rows.Count > 0) { this.btnExport.Enabled = true; this.gridSessionList.Rows[0].Selected = true; } else { this.btnExport.Enabled = false; } this.ucStatusBarSessionList.ShowText1(UtilCulture.GetString("Msg.R00006") + ": " + ds.Tables[0].Rows.Count.ToString()); } catch (Exception ex) { throw ex; } finally { baseForm.ResetCursor(); baseForm.CloseWCF(client); } }
private tsyssession GetSingleSession(string _sessionid) { wsSYS.IwsSYSClient client = new wsSYS.IwsSYSClient(); tsyssession result = null; try { baseForm.SetCursor(); List<MESParameterInfo> lstParameters = new List<MESParameterInfo>(); lstParameters.Add(new MESParameterInfo() { ParamName = "sessionid", ParamValue = _sessionid, ParamType = "string" }); result = client.GetSingleSession(baseForm.CurrentContextInfo, lstParameters.ToArray<MESParameterInfo>()); } catch (Exception ex) { throw ex; } finally { baseForm.ResetCursor(); baseForm.CloseWCF(client); } return result; }
private void GetData(List<MESParameterInfo> lstParameters) { wsSYS.IwsSYSClient client = new wsSYS.IwsSYSClient(); try { baseForm.SetCursor(); DataSet ds = client.GetSystemConfigRecords(baseForm.CurrentContextInfo, lstParameters.ToArray<MESParameterInfo>()); this.grdQuery.SetDataBinding(ds.Tables[0], ""); if (this.grdQuery.Rows.Count < 1) { this.ucToolbar1.SetToolbarWithoutRows(); } else { this.ucToolbar1.SetToolbarWithRows(); } this.ucStatusBar1.ShowText1(UtilCulture.GetString("Msg.R00006") + ": " + ds.Tables[0].Rows.Count.ToString()); } catch (Exception ex) { MESMsgBox.ShowError(ExceptionParser.Parse(ex)); } finally { baseForm.ResetCursor(); baseForm.CloseWCF(client); } }
public static void InitCMB_AttributeTemplate_All(ComboBox cmb, MES_AttributeTemplate_UsedBy usedBy) { cmb.Items.Clear(); cmb.DisplayMember = "DisplayField"; cmb.ValueMember = "ValueField"; wsSYS.IwsSYSClient client = new wsSYS.IwsSYSClient(); try { List<MESParameterInfo> lstParameters = new List<MESParameterInfo>() { new MESParameterInfo() { ParamName="usedby", ParamValue = usedBy.ToString(), ParamType="string" } }; List<tsysattrtplate> lstArrtibueteTemplate = client.GetAttributeTemplateList((new BaseForm()).CurrentContextInfo, lstParameters.ToArray<MESParameterInfo>()).ToList<tsysattrtplate>(); var q = from p in lstArrtibueteTemplate orderby p.attrtplatname ascending select p; for (int i = 0; i < q.Count(); i++) { cmb.Items.Add(new ValueInfo() { DisplayField = q.ElementAt(i).attrtplatname, ValueField = q.ElementAt(i).attrtplatid }); } } catch (Exception ex) { throw ex; } finally { baseForm.CloseWCF(client); } }