Beispiel #1
0
 public static ValueListItem[] GetValueList_Customer_All()
 {
     List<ValueListItem> lstVL = new List<ValueListItem>();
     wsMDL.IwsMDLClient client = new wsMDL.IwsMDLClient();
     try
     {
         List<MESParameterInfo> lstParameters = new List<MESParameterInfo>() { };
         List<tmdlcustomer> lstCustomer = client.GetCustomerList((new BaseForm()).CurrentContextInfo,
             lstParameters.ToArray<MESParameterInfo>()).ToList();
         var q = from p in lstCustomer orderby p.customername ascending select p;
         for (int i = 0; i < q.Count(); i++)
         {
             ValueListItem item = new ValueListItem()
             {
                 DisplayText = q.ElementAt(i).customername,
                 DataValue = q.ElementAt(i).customerid
             };
             lstVL.Add(item);
         }
         return lstVL.ToArray<ValueListItem>();
     }
     catch (Exception ex)
     {
         throw ex;
     }
     finally
     {
         baseForm.CloseWCF(client);
     }
 }
Beispiel #2
0
 public void ShowEmployeeList()
 {
     wsMDL.IwsMDLClient client = new wsMDL.IwsMDLClient();
     try
     {
         baseForm.SetCursor();
         DataSet employeeDs = client.GetEmployeeRecords(baseForm.CurrentContextInfo, QueryParameters.ToArray<MESParameterInfo>());
         this.gridEmployeeList.SetDataBinding( employeeDs.Tables[0],"");
         if (employeeDs.Tables[0].Rows.Count < 1)
         {
             this.ucToolbarEmployeeList.SetToolbarWithoutRows();
         }
         else
         {
             this.ucToolbarEmployeeList.SetToolbarWithRows();
         }
         this.ucStatusBarEmployeeList.ShowText1(UtilCulture.GetString("Msg.R00006") + ": " + employeeDs.Tables[0].Rows.Count.ToString());
     }
     catch (Exception ex)
     {
         throw ex;
     }
     finally
     {
         baseForm.ResetCursor();
         baseForm.CloseWCF(client);
     }
 }
Beispiel #3
0
        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.R01018") + ": </span> " +
                            this.grdQuery.ActiveRow.Cells["workgroup"].Value.ToString());

            if (result == DialogResult.Cancel) return;

            wsMDL.IwsMDLClient client = new wsMDL.IwsMDLClient();
            try
            {
                baseForm.SetCursor();

                List<MESParameterInfo> lstParameters = new List<MESParameterInfo>() {
                    new MESParameterInfo(){
                        ParamName="workgroup",
                        ParamValue=this.grdQuery.ActiveRow.Cells["workgroup"].Value.ToString(),
                        ParamType="string"
                    }
                };

                client.DoDeleteWorkGroup(baseForm.CurrentContextInfo, lstParameters.ToArray<MESParameterInfo>());

                MESMsgBox.ShowInformation(UtilCulture.GetString("Msg.R00003"));

                GetData(QueryParameters);
            }
            catch (Exception ex)
            {
                MESMsgBox.ShowError(ExceptionParser.Parse(ex));
            }
            finally
            {
                baseForm.ResetCursor();
                baseForm.CloseWCF(client);
            }
        }
Beispiel #4
0
        public void DoDelete()
        {
            if (this.grdQuery.ActiveRow == null) return;

            DialogResult result = baseForm.CreateMessageBox(Public_MessageBox.Question,
                        MessageBoxButtons.OKCancel,
                        UtilCulture.GetString("Msg.R00004"),
                        "" + UtilCulture.GetString("Label.R00705") + ": "
                            + this.grdQuery.ActiveRow.Cells["fromcurrency"].Value.ToString() + "->" + this.grdQuery.ActiveRow.Cells["tocurrency"].Value.ToString());

            if (result == DialogResult.Cancel) return;

            wsMDL.IwsMDLClient client = new wsMDL.IwsMDLClient();
            try
            {
                baseForm.SetCursor();

                List<MESParameterInfo> lstParameters = new List<MESParameterInfo>() {
                    new MESParameterInfo(){
                        ParamName="exsysid",
                        ParamValue=this.grdQuery.ActiveRow.Cells["exsysid"].Value.ToString(),
                        ParamType="string"
                    }
                };
                client.DoDeleteExchange(baseForm.CurrentContextInfo, lstParameters.ToArray<MESParameterInfo>());

                baseForm.CreateMessageBox(Public_MessageBox.Information, MessageBoxButtons.OK, null, UtilCulture.GetString("Msg.R00003"));
            }
            catch (Exception ex)
            {
                MESMsgBox.ShowError(ExceptionParser.Parse(ex));
            }
            finally
            {
                baseForm.ResetCursor();

                baseForm.CloseWCF(client);
            }
        }
Beispiel #5
0
 private void DeleteShift()
 {
     if (this.gridShiftList.ActiveRow != null)
     {
         Dictionary<string, object> dir = new Dictionary<string, object>();
         dir.Add(UtilCulture.GetString("Label.R00394"), this.gridShiftList.ActiveRow.Cells["SHIFT"].Value.ToString());
         DialogResult result = baseForm.CreateMessageBox(Public_MessageBox.Question,
                                                         MessageBoxButtons.OKCancel,
                                                         UtilCulture.GetString("Msg.R00004"),
                                                         dir);
         if (result == DialogResult.OK)
         {
             baseForm.SetCursor();
             wsMDL.IwsMDLClient client = new wsMDL.IwsMDLClient();
             try
             {
                 List<MESParameterInfo> lstParameters = new List<MESParameterInfo>();
                 lstParameters.Add(new MESParameterInfo()
                 {
                     ParamName = "shift",
                     ParamValue = this.gridShiftList.ActiveRow.Cells["SHIFT"].Value.ToString(),
                     ParamType = "string"
                 });
                 client.DoDeleteShift(baseForm.CurrentContextInfo, lstParameters.ToArray<MESParameterInfo>());
                 ShowShiftList();
                 baseForm.CreateMessageBox(Public_MessageBox.Information, MessageBoxButtons.OK, null, UtilCulture.GetString("Msg.R00003"));
             }
             catch (Exception ex)
             {
                 MESMsgBox.ShowError(ExceptionParser.Parse(ex));
             }
             finally
             {
                 baseForm.ResetCursor();
                 baseForm.CloseWCF(client);
             }
         }
     }
 }
Beispiel #6
0
        public static void InitCMB_Shift_All(UltraComboEditor cmb)
        {
            wsMDL.IwsMDLClient client = new wsMDL.IwsMDLClient();

            try
            {
                List<MESParameterInfo> lstParameters = new List<MESParameterInfo>();
                cmb.DataSource = client.GetShiftRecords((new BaseForm()).CurrentContextInfo, lstParameters.ToArray<MESParameterInfo>()).Tables[0];
                cmb.DisplayMember = "shiftname";
                cmb.ValueMember = "shift";
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                baseForm.CloseWCF(client);
            }
        }
Beispiel #7
0
        public static void InitCMB_Shift_All(ComboBox cmb)
        {
            cmb.Items.Clear();
            cmb.DisplayMember = "DisplayField";
            cmb.ValueMember = "ValueField";

            wsMDL.IwsMDLClient client = new wsMDL.IwsMDLClient();

            try
            {
                List<MESParameterInfo> lstParameters = new List<MESParameterInfo>();
                List<tmdlshift> lstShift = client.GetShiftList((new BaseForm()).CurrentContextInfo, lstParameters.ToArray<MESParameterInfo>()).ToList<tmdlshift>();
                var q = (from p in lstShift
                         orderby p.shift ascending
                         select p);

                foreach (tmdlshift sf in q)
                {
                    cmb.Items.Add(new ValueInfo()
                    {
                        DisplayField = sf.shiftname,
                        ValueField = sf.shift
                    });
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                baseForm.CloseWCF(client);
            }
        }
Beispiel #8
0
        public static void InitCMB_ReasonCode_ByCategoryStep(ComboBox cmd,
            MES_ReasonCategory reasonCategory, string stepsysid)
        {
            cmd.Items.Clear();
            cmd.DisplayMember = "DisplayField";
            cmd.ValueMember = "ValueField";

            wsMDL.IwsMDLClient client = new wsMDL.IwsMDLClient();

            try
            {
                List<tmdlreasoncode> lstReasonCode = client.GetReasonCodeList_ByCategoryStep(
                    (new BaseForm()).CurrentContextInfo, reasonCategory.ToString(), stepsysid).ToList<tmdlreasoncode>();

                var q = from p in lstReasonCode orderby p.reasoncodedesc ascending select p;
                for (int i = 0; i < q.Count(); i++)
                {
                    cmd.Items.Add(new ValueInfo()
                    {
                        DisplayField = q.ElementAt(i).reasoncodedesc,
                        ValueField = q.ElementAt(i).reasoncode
                    });
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                baseForm.CloseWCF(client);
            }
        }
Beispiel #9
0
        public static void InitCMB_ReasonCategory_All(ComboBox cmd)
        {
            cmd.Items.Clear();
            cmd.DisplayMember = "DisplayField";
            cmd.ValueMember = "ValueField";

            wsMDL.IwsMDLClient client = new wsMDL.IwsMDLClient();

            try
            {
                List<MESParameterInfo> lstParameters = new List<MESParameterInfo>();
                List<tmdlreasoncategory> lstReasonCategory = client.GetReasonCategoryList((new BaseForm()).CurrentContextInfo, lstParameters.ToArray<MESParameterInfo>()).ToList<tmdlreasoncategory>();
                var q = from p in lstReasonCategory orderby p.reasoncategory ascending select p;
                for (int i = 0; i < q.Count(); i++)
                {
                    cmd.Items.Add(new ValueInfo()
                    {
                        DisplayField = q.ElementAt(i).reasoncategory,
                        ValueField = q.ElementAt(i).reasoncategory
                    });
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                baseForm.CloseWCF(client);
            }
        }
Beispiel #10
0
        public static ValueListItem[] GetValueList_Employee(string employeeType)
        {
            List<ValueListItem> lstVL = new List<ValueListItem>();
            ValueListItem emptyitem = new ValueListItem()
            {
                DisplayText = " ",
                DataValue = ""
            };
            lstVL.Add(emptyitem);

            wsMDL.IwsMDLClient client = new wsMDL.IwsMDLClient();

            try
            {
                List<MESParameterInfo> lstParameters = new List<MESParameterInfo>();
                lstParameters.Add(new MESParameterInfo()
                {
                    ParamName = "employeetypeid",
                    ParamValue = employeeType,
                    ParamType = "string"
                });
                List<tmdlemployee> lstEmployee = client.GetEmployeeList((new BaseForm()).CurrentContextInfo, lstParameters.ToArray<MESParameterInfo>()).ToList<tmdlemployee>();

                for (int i = 0; i < lstEmployee.Count; i++)
                {
                    ValueListItem item = new ValueListItem()
                    {
                        DisplayText = lstEmployee[i].employeename.Trim(),
                        DataValue = lstEmployee[i].employeeid
                    };
                    lstVL.Add(item);
                }

                return lstVL.ToArray<ValueListItem>();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                baseForm.CloseWCF(client);
            }
        }
Beispiel #11
0
        public static void InitCMB_ReasonCode_ByCategory(ComboBox cmd, MES_ReasonCategory reasonCategory)
        {
            cmd.Items.Clear();
            cmd.DisplayMember = "DisplayField";
            cmd.ValueMember = "ValueField";

            wsMDL.IwsMDLClient client = new wsMDL.IwsMDLClient();

            try
            {
                List<MESParameterInfo> lstParameters = new List<MESParameterInfo>();
                lstParameters.Add(new MESParameterInfo()
                {
                    ParamName = "reasoncategory",
                    ParamValue = reasonCategory.ToString()
                });

                List<tmdlreasoncode> lstReasonCode = client.GetReasonCodeList((new BaseForm()).CurrentContextInfo, lstParameters.ToArray<MESParameterInfo>()).ToList<tmdlreasoncode>();
                for (int i = 0; i < lstReasonCode.Count; i++)
                {
                    cmd.Items.Add(new ValueInfo()
                    {
                        DisplayField = lstReasonCode[i].reasoncodedesc,
                        ValueField = lstReasonCode[i].reasoncode
                    });
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                baseForm.CloseWCF(client);
            }
        }
Beispiel #12
0
 private void UpdateCustomer(tmdlcustomer _customer, List<tmdlcontact> lstContact)
 {
     wsMDL.IwsMDLClient client = new wsMDL.IwsMDLClient();
     try
     {
         client.DoUpdateCustomer(baseForm.CurrentContextInfo, _customer, lstContact.ToArray());
     }
     catch (Exception ex)
     {
         throw ex;
     }
     finally
     {
         baseForm.CloseWCF(client);
     }
 }
Beispiel #13
0
 private DataSet GetAllCustomer()
 {
     wsMDL.IwsMDLClient client = new wsMDL.IwsMDLClient();
     DataSet ds = null;
     try
     {
         baseForm.SetCursor();
         List<MESParameterInfo> lstParameters = new List<MESParameterInfo>();
         ds = client.GetCustomerRecords(baseForm.CurrentContextInfo, lstParameters.ToArray<MESParameterInfo>());
     }
     catch (Exception ex)
     {
         throw ex;
     }
     finally
     {
         baseForm.ResetCursor();
         baseForm.CloseWCF(client);
     }
     return ds;
 }
Beispiel #14
0
        public static ValueListItem[] GetValueList_Employee()
        {
            List<ValueListItem> lstVL = new List<ValueListItem>();
            ValueListItem emptyitem = new ValueListItem()
            {
                DisplayText = " ",
                DataValue = ""
            };
            lstVL.Add(emptyitem);

            wsMDL.IwsMDLClient client = new wsMDL.IwsMDLClient();

            try
            {
                List<MESParameterInfo> lstParameters = new List<MESParameterInfo>();
                //lstParameters.Add(new MESParameterInfo()
                //{
                //    ParamName = "employeestatus",
                //    ParamValue = MES_Flag.Valid.ToString(),
                //    ParamType = "string"
                //});
                List<tmdlemployee> lstEmployee = client.GetEmployeeList((new BaseForm()).CurrentContextInfo, lstParameters.ToArray<MESParameterInfo>()).ToList<tmdlemployee>();
                var q = from p in lstEmployee orderby p.employeename ascending select p;
                for (int i = 0; i < q.Count(); i++)
                {
                    ValueListItem item = new ValueListItem()
                    {
                        DisplayText = q.ElementAt(i).employeename.Trim(),
                        DataValue = q.ElementAt(i).employeeid
                    };
                    lstVL.Add(item);
                }

                return lstVL.ToArray<ValueListItem>();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                baseForm.CloseWCF(client);
            }
        }
Beispiel #15
0
        private void DoLogon()
        {
            wsSEC.IwsSECClient client = new wsSEC.IwsSECClient();
            wsMDL.IwsMDLClient clientMDL = new wsMDL.IwsMDLClient();

            try
            {
                baseForm.SetCursor();

                baseForm.ValidateData(this);

                if (this.chkLogonToBasis.Checked)
                    baseForm.CurrentContextInfo.MiscValue1 = "Modeling";
                else
                    baseForm.CurrentContextInfo.MiscValue1 = "WIP Client";

                client.Logon(baseForm.CurrentContextInfo, this.cmbUser.Text, UtilSecurity.EncryptPassword(txtPassword.Text));

                #region Set public variables
                Parameter.LOGON_USER = this.cmbUser.Text.Trim();
                Parameter.SHIFT = (this.cmbShift.SelectedItem as ValueInfo).ValueField;
                Parameter.SESSION_ID = GENLSYS.MES.Common.Function.GetGUID();
                Parameter.LANGUAGE = (this.cmbLanguage.SelectedItem as ValueInfo).ValueField;
                // Parameter.WORKGROUP = "G1";//getWorkGroupByIP
                InitResourceFile(Parameter.LANGUAGE);

                string machine = Dns.GetHostName();

                baseForm.CurrentContextInfo.SessionId = Parameter.SESSION_ID;
                baseForm.CurrentContextInfo.CurrentUser = Parameter.LOGON_USER;
                baseForm.CurrentContextInfo.WorkGroup = Parameter.WORKGROUP;
                client.UpdateLogonTime(baseForm.CurrentContextInfo, Parameter.SESSION_ID, this.cmbUser.Text, machine, Parameter.SHIFT);
                //get authorization
                Parameter.ALL_FUNCTIONS = client.GetFunctionsRecords(baseForm.CurrentContextInfo,
                    (new List<MESParameterInfo>()).ToArray<MESParameterInfo>()).Tables[0];
                Parameter.USER_FUNCTIONS = client.GetFunctionsByUserId(baseForm.CurrentContextInfo,
                    Parameter.LOGON_USER).Tables[0];
                //get user object
                List<tsecuser> lstUser = client.GetUserList(baseForm.CurrentContextInfo,
                    new List<MESParameterInfo>() {
                        new MESParameterInfo(){
                            ParamName ="userid",
                            ParamValue=Parameter.LOGON_USER
                        }
                    }.ToArray<MESParameterInfo>()).ToList<tsecuser>();

                if (lstUser.Count > 0)
                {
                    Parameter.CURRENT_USER_OBJECT = lstUser[0];
                }
                //get employee object
                List<tmdlemployee> lstEmployee = clientMDL.GetEmployeeList(baseForm.CurrentContextInfo,
                    new List<MESParameterInfo>() {
                        new MESParameterInfo(){
                            ParamName ="employeeid",
                            ParamValue=lstUser[0].employeeid
                        }
                    }.ToArray()).ToList();

                //   if (lstEmployee.Count > 0)
                //   {
                //       Parameter.WORKGROUP = lstEmployee[0].workgroup;
                //       baseForm.CurrentContextInfo.WorkGroup = Parameter.WORKGROUP;
                //   }
                //get system config
                if (Parameter.CURRENT_SYSTEM_CONFIG == null)
                {
                    Parameter.CURRENT_SYSTEM_CONFIG = baseForm.GetAllSystemConfig();
                    baseForm.SetParameter();
                }
                //get static value
                if (Parameter.CURRENT_STATIC_VALUE == null)
                    Parameter.CURRENT_STATIC_VALUE = baseForm.GetAllStaticValue();
                //set host name as work group
                string host = Dns.GetHostName();
                string lineGroup = "unknow";
                foreach (tsysstaticvalue item in baseForm.GetStaticValue(MES_StaticValue_Type.LineGroup))
                {
                    if (item.svtext == host)
                    {
                        lineGroup = item.svvalue;
                        break;
                    }
                }

                Parameter.WORKGROUP = lineGroup;
                baseForm.CurrentContextInfo.WorkGroup = Parameter.WORKGROUP;

                //update user profile
                UpdateUserProfile();
                #endregion

                ShowModeling(false);

                Parameter.LOGON_FORM = this;

                this.Hide();
            }
            catch (Exception ex)
            {
                switch (ExceptionParser.Parse(ex))
                {
                    case "-300001":
                        errorCount++;
                        baseForm.CreateMessageBox(Public_MessageBox.Error, MessageBoxButtons.OK, null, UtilCulture.GetString("Msg.R00011"));
                        break;
                    case "-300002":
                        errorCount++;
                        baseForm.CreateMessageBox(Public_MessageBox.Error, MessageBoxButtons.OK, null, UtilCulture.GetString("Msg.R00012"));
                        break;
                    case "-300003":
                        errorCount++;
                        baseForm.CreateMessageBox(Public_MessageBox.Error, MessageBoxButtons.OK, null, UtilCulture.GetString("Msg.R00013"));
                        break;
                    case "-300004":
                        errorCount++;
                        baseForm.CreateMessageBox(Public_MessageBox.Error, MessageBoxButtons.OK, null, UtilCulture.GetString("Msg.R00014"));
                        break;
                    case "-300005":
                        errorCount++;
                        baseForm.CreateMessageBox(Public_MessageBox.Error, MessageBoxButtons.OK, null, UtilCulture.GetString("Msg.R00046"));
                        break;
                    default:
                        baseForm.CreateMessageBox(Public_MessageBox.Error, MessageBoxButtons.OK, null, ExceptionParser.Parse(ex));
                        break;
                }

                if (errorCount >= 5)
                {
                    baseForm.CreateMessageBox(Public_MessageBox.Error, MessageBoxButtons.OK, null, UtilCulture.GetString("Msg.R00122"));
                    this.Dispose();
                }
            }
            finally
            {
                baseForm.ResetCursor();
                if (client.State == System.ServiceModel.CommunicationState.Opened)
                    baseForm.CloseWCF(client);
            }
        }
Beispiel #16
0
        private void GetReasonCode()
        {
            wsMDL.IwsMDLClient client = new wsMDL.IwsMDLClient();
            try
            {
                List<MESParameterInfo> lstParameters = new List<MESParameterInfo>();
                lstParameters.Add(new MESParameterInfo()
                {
                    ParamName = "reasoncategory",
                    ParamValue = "%" + MES_ReasonCategory.Repair.ToString() + "%",
                    ParamType = "string"
                });
                DataTable dt = client.GetReasonCodeRecords(baseForm.CurrentContextInfo, lstParameters.ToArray<MESParameterInfo>()).Tables[0];
                DataView dv = dt.DefaultView;
                dv.RowFilter = "reasoncategory LIKE '%全检%'";
                dv.Sort = "reasoncategorydesc asc";
                dt = dv.ToTable();

                int categoryIndex = 0;
                string beforecategory = "";

                if (dt != null)
                {
                    dt.Columns.Add(new DataColumn("ck", typeof(string)));
                    dt.Columns.Add(new DataColumn("pairqty", typeof(int)));
                    dt.Columns.Add(new DataColumn("remark", typeof(string)));
                    dt.Columns.Add(new DataColumn("categoryindex", typeof(int)));

                    foreach (DataRow row in dt.Rows)
                    {
                        if (!row["reasoncategorydesc"].ToString().Equals(beforecategory))
                        {
                            beforecategory = row["reasoncategorydesc"].ToString();
                            categoryIndex++;
                        }

                        row["ck"] = "N";
                        row["pairqty"] = 0;
                        row["remark"] = "";
                        row["categoryindex"] = categoryIndex;
                    }
                    this.grdDetail.SetDataBinding(dt, "");
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                baseForm.CloseWCF(client);
            }
        }
Beispiel #17
0
 private void UpdateEmployeeType(tmdlemployeetype _employeetype)
 {
     wsMDL.IwsMDLClient client = new wsMDL.IwsMDLClient();
     try
     {
         client.DoUpdateEmployeeType(baseForm.CurrentContextInfo, _employeetype);
     }
     catch (Exception ex)
     {
         throw ex;
     }
     finally
     {
         baseForm.CloseWCF(client);
     }
 }
Beispiel #18
0
 private tmdlemployeetype GetSingleEmployeeType(string _employeeTypeId)
 {
     wsMDL.IwsMDLClient client = new wsMDL.IwsMDLClient();
     tmdlemployeetype result = null;
     try
     {
         baseForm.SetCursor();
         List<MESParameterInfo> lstParameters = new List<MESParameterInfo>();
         lstParameters.Add(new MESParameterInfo()
         {
             ParamName = "employeetypeid",
             ParamValue = _employeeTypeId,
             ParamType = "string"
         });
         result = client.GetSingleEmployeeType(baseForm.CurrentContextInfo, lstParameters.ToArray<MESParameterInfo>());
     }
     catch (Exception ex)
     {
         throw ex;
     }
     finally
     {
         baseForm.ResetCursor();
         baseForm.CloseWCF(client);
     }
     return result;
 }
Beispiel #19
0
        public static void InitCMB_WorkGroup(ComboBox cmb)
        {
            cmb.Items.Clear();
            cmb.DisplayMember = "DisplayField";
            cmb.ValueMember = "ValueField";

            wsMDL.IwsMDLClient client = new wsMDL.IwsMDLClient();

            try
            {
                List<MESParameterInfo> lstParameters = new List<MESParameterInfo>();
                List<tmdlworkgroup> lstShift = client.GetWorkGroupList((new BaseForm()).CurrentContextInfo, lstParameters.ToArray<MESParameterInfo>()).ToList<tmdlworkgroup>();

                var q = from p in lstShift orderby p.workgroupdesc ascending select p;
                foreach (tmdlworkgroup workgroup in q)
                {
                    cmb.Items.Add(new ValueInfo()
                    {
                        DisplayField = workgroup.workgroupdesc,
                        ValueField = workgroup.workgroup
                    });
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                baseForm.CloseWCF(client);
            }
        }
Beispiel #20
0
        private void GetData(List<MESParameterInfo> lstParameters)
        {
            wsMDL.IwsMDLClient client = new wsMDL.IwsMDLClient();
            try
            {
                baseForm.SetCursor();

                DataSet ds = client.GetWorkGroupRecords(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);
            }
        }
Beispiel #21
0
        public static ValueListItem[] GetValueList_ReasonCode(MES_ReasonCategory reasonCategory)
        {
            List<ValueListItem> lstVL = new List<ValueListItem>();
            wsMDL.IwsMDLClient client = new wsMDL.IwsMDLClient();
            try
            {
                List<MESParameterInfo> lstParameters = new List<MESParameterInfo>();
                lstParameters.Add(new MESParameterInfo() {
                    ParamName="reasoncategory",
                    ParamValue=reasonCategory.ToString()
                });
                List<tmdlreasoncode> lstReasonCode = client.GetReasonCodeList((new BaseForm()).CurrentContextInfo,
                    lstParameters.ToArray<MESParameterInfo>()).ToList();

                var q = from p in lstReasonCode orderby p.reasoncodedesc ascending select p;
                for (int i = 0; i < q.Count(); i++)
                {
                    ValueListItem item = new ValueListItem()
                    {
                        DisplayText = q.ElementAt(i).reasoncodedesc,
                        DataValue = q.ElementAt(i).reasoncode
                    };
                    lstVL.Add(item);
                }
                return lstVL.ToArray<ValueListItem>();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                baseForm.CloseWCF(client);
            }
        }
Beispiel #22
0
        private void GetContactList(List<MESParameterInfo> lstParameters)
        {
            wsMDL.IwsMDLClient client = new wsMDL.IwsMDLClient();
            try
            {
                baseForm.SetCursor();

                DataSet ds = client.GetContactRecords(baseForm.CurrentContextInfo, lstParameters.ToArray<MESParameterInfo>());

                this.grdContact.SetDataBinding(ds.Tables[0], "");
            }
            catch (Exception ex)
            {
                MESMsgBox.ShowError(ExceptionParser.Parse(ex));
            }
            finally
            {
                baseForm.ResetCursor();
                baseForm.CloseWCF(client);
            }
        }
Beispiel #23
0
 private DataSet GetWorkGroupRecordsByStep(string step)
 {
     wsMDL.IwsMDLClient client = new wsMDL.IwsMDLClient();
     DataSet ds = null;
     try
     {
         baseForm.SetCursor();
         List<MESParameterInfo> lstParameters = new List<MESParameterInfo>();
         lstParameters.Add(new MESParameterInfo()
         {
             ParamName = "step",
             ParamValue = step,
             ParamType = "string"
         });
         ds = client.GetWorkGroupRecords(baseForm.CurrentContextInfo, lstParameters.ToArray<MESParameterInfo>());
     }
     catch (Exception ex)
     {
         throw ex;
     }
     finally
     {
         baseForm.ResetCursor();
         baseForm.CloseWCF(client);
     }
     return ds;
 }
Beispiel #24
0
 private DataTable GetWorkGroup()
 {
     wsMDL.IwsMDLClient client = new wsMDL.IwsMDLClient();
     DataTable dt = null;
     try
     {
         dt = client.GetWorkGroupRecords(baseForm.CurrentContextInfo, (new List<MESParameterInfo>()).ToArray<MESParameterInfo>()).Tables[0];
     }
     catch (Exception ex)
     {
         throw ex;
     }
     finally
     {
         baseForm.CloseWCF(client);
     }
     return dt;
 }
Beispiel #25
0
 private DataTable GetReasonCodeDataTable()
 {
     wsMDL.IwsMDLClient client = new wsMDL.IwsMDLClient();
     try
     {
         List<MESParameterInfo> lstParameters = new List<MESParameterInfo>();
         lstParameters.Add(new MESParameterInfo()
         {
             ParamName = "reasoncategory",
             ParamValue = "%" + MES_ReasonCategory.Repair.ToString() + "%",
             ParamType = "string"
         });
         return client.GetReasonCodeRecords(baseForm.CurrentContextInfo, lstParameters.ToArray<MESParameterInfo>()).Tables[0];
     }
     catch (Exception ex)
     {
         throw ex;
     }
     finally
     {
         baseForm.CloseWCF(client);
     }
 }
Beispiel #26
0
        public static void InitCMB_Customer_All(ComboBox cmb)
        {
            cmb.Items.Clear();
            cmb.DisplayMember = "DisplayField";
            cmb.ValueMember = "ValueField";

            wsMDL.IwsMDLClient client = new wsMDL.IwsMDLClient();

            try
            {
                List<MESParameterInfo> lstParameters = new List<MESParameterInfo>();
                List<tmdlcustomer> lstCustomer = client.GetCustomerList((new BaseForm()).CurrentContextInfo, lstParameters.ToArray<MESParameterInfo>()).ToList<tmdlcustomer>();
                for (int i = 0; i < lstCustomer.Count; i++)
                {
                    cmb.Items.Add(new ValueInfo()
                    {
                        DisplayField = lstCustomer[i].customername,
                        ValueField = lstCustomer[i].customerid
                    });
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                baseForm.CloseWCF(client);
            }
        }
Beispiel #27
0
 private DataTable GetValidExchange(DateTime date)
 {
     wsMDL.IwsMDLClient client = new wsMDL.IwsMDLClient();
     DataTable dt = null;
     try
     {
        dt = client.GetValidExchange(baseForm.CurrentContextInfo, date).Tables[0];
     }
     catch (Exception ex)
     {
         throw ex;
     }
     finally
     {
         baseForm.CloseWCF(client);
     }
     return dt;
 }
Beispiel #28
0
        public static void InitCMB_EmployeeType_All(ComboBox cmb)
        {
            cmb.Items.Clear();
            cmb.DisplayMember = "DisplayField";
            cmb.ValueMember = "ValueField";

            wsMDL.IwsMDLClient client = new wsMDL.IwsMDLClient();

            try
            {
                List<MESParameterInfo> lstParameters = new List<MESParameterInfo>();
                List<tmdlemployeetype> lstemtype = client.GetEmployeeTypeList((new BaseForm()).CurrentContextInfo, lstParameters.ToArray<MESParameterInfo>()).ToList<tmdlemployeetype>();

                var q = from p in lstemtype orderby p.employeetypename ascending select p;
                for (int i = 0; i < q.Count(); i++)
                {
                    cmb.Items.Add(new ValueInfo()
                    {
                        DisplayField = q.ElementAt(i).employeetypename,
                        ValueField = q.ElementAt(i).employeetypeid
                    });
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                baseForm.CloseWCF(client);
            }
        }
Beispiel #29
0
        public static void InitCMB_Employee_Valid(ComboBox cmd)
        {
            cmd.Items.Clear();
            cmd.DisplayMember = "DisplayField";
            cmd.ValueMember = "ValueField";

            wsMDL.IwsMDLClient client = new wsMDL.IwsMDLClient();

            try
            {
                List<MESParameterInfo> lstParameters = new List<MESParameterInfo>();
                lstParameters.Add(new MESParameterInfo()
                {
                    ParamName = "employeestatus",
                    ParamValue = MES_Flag.Valid.ToString(),
                    ParamType = "string"
                });

                List<tmdlemployee> lseEmployee = client.GetEmployeeList((new BaseForm()).CurrentContextInfo, lstParameters.ToArray<MESParameterInfo>()).ToList<tmdlemployee>();
                var q = from p in lseEmployee orderby p.employeeid ascending select p;
                for (int i = 0; i < q.Count(); i++)
                {
                    cmd.Items.Add(new ValueInfo()
                    {
                        DisplayField = q.ElementAt(i).employeeid + "(" + q.ElementAt(i).employeename + ")",
                        ValueField = q.ElementAt(i).employeeid
                    });
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                baseForm.CloseWCF(client);
            }
        }
Beispiel #30
0
 private void UpdateShift(tmdlshift _shift)
 {
     wsMDL.IwsMDLClient client = new wsMDL.IwsMDLClient();
     try
     {
         client.DoUpdateShift(baseForm.CurrentContextInfo, _shift);
     }
     catch (Exception ex)
     {
         throw ex;
     }
     finally
     {
         baseForm.CloseWCF(client);
     }
 }