Exemplo n.º 1
0
        private void DoSave()
        {
            wsINP.IwsINPClient client = new wsINP.IwsINPClient();
            try
            {
                baseForm.SetCursor();
                baseForm.ValidateData(this);
                if (dtlDt.Rows.Count > 0)
                {
                    tinpwip wip = GetSingleWip();
                    if ((Convert.ToDecimal(dtlDt.Rows[0]["pairqty"]) - this.numPairQty.Value) > wip.pairqty)
                    {
                        throw new Exception(UtilCulture.GetString("Msg.R01027"));
                    }

                    client.DoSupplementAdjust(baseForm.CurrentContextInfo, dtlDt.Rows[0]["supldtlsysid"].ToString(), Convert.ToInt16(this.numPairQty.Value), this.ckTwiceInspect.Checked ? MES_Misc.Y.ToString() : MES_Misc.N.ToString());

                    baseForm.CreateMessageBox(Public_MessageBox.Information, MessageBoxButtons.OK, null, UtilCulture.GetString("Msg.R00002"));
                    this.Close();
                }
                else
                {
                    throw new Exception("No data found");
                }

            }
            catch (Exception ex)
            {
                baseForm.CreateMessageBox(Public_MessageBox.Error, MessageBoxButtons.OK, null, ex.Message);
            }
            finally
            {
                baseForm.ResetCursor();
            }
        }
Exemplo n.º 2
0
        private void GetData(List<MESParameterInfo> lstParameters)
        {
            wsINP.IwsINPClient client = new wsINP.IwsINPClient();
            try
            {
                baseForm.SetCursor();

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

                this.grdPricing.SetDataBinding(ds.Tables[0], "");

                if (ds.Tables[0].Rows.Count < 1)
                {
                    this.ucToolbar1.SetToolbarWithoutRows();
                }
                else
                {
                    this.ucToolbar1.SetToolbarWithRows();
                }
            }
            catch (Exception ex)
            {
                MESMsgBox.ShowError(ExceptionParser.Parse(ex));
            }
            finally
            {
                baseForm.ResetCursor();
                baseForm.CloseWCF(client);
            }
        }
Exemplo n.º 3
0
        private void GetData(List<MESParameterInfo> lstParameters)
        {
            wsINP.IwsINPClient client = new wsINP.IwsINPClient();
            try
            {
                baseForm.SetCursor();

                DataSet ds = client.GetRepairStockRecords(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);
            }
        }
Exemplo n.º 4
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.R01023") + ": </span> " +
                            this.grdQuery.ActiveRow.Cells["yearmonth"].Value.ToString() + "," +
                            this.grdQuery.ActiveRow.Cells["customerid"].Value.ToString() + "," +
                            this.grdQuery.ActiveRow.Cells["factory"].Value.ToString());

            if (result == DialogResult.Cancel) return;

            wsINP.IwsINPClient client = new wsINP.IwsINPClient();
            try
            {
                baseForm.SetCursor();

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

                client.DoDeleteSchedule(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);
            }
        }
Exemplo n.º 5
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.R01023") + ":  " +
                            this.grdQuery.ActiveRow.Cells["recno"].Value.ToString());

            if (result == DialogResult.Cancel) return;

            wsINP.IwsINPClient client = new wsINP.IwsINPClient();
            try
            {
                baseForm.SetCursor();

                if (client.CheckReceivingUsed(baseForm.CurrentContextInfo, this.grdQuery.ActiveRow.Cells["recsysid"].Value.ToString()))
                {
                    baseForm.CreateMessageBox(Public_MessageBox.Error, MessageBoxButtons.OK, null, UtilCulture.GetString("Msg.R00095"));
                    return;
                }

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

                client.DoDeleteReceiving(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);
            }
        }
Exemplo n.º 6
0
 public int GetLeftRepairSuccessQty()
 {
     wsINP.IwsINPClient client = new wsINP.IwsINPClient();
     int reuslt = 0;
     try
     {
         reuslt = client.GetLeftRepairSuccessQty(baseForm.CurrentContextInfo, RepairHis.custorderno, RepairHis.styleno, RepairHis.color, RepairHis.size, RepairHis.step);
     }
     catch (Exception ex)
     {
         throw ex;
     }
     finally
     {
         baseForm.CloseWCF(client);
     }
     return reuslt;
 }
Exemplo n.º 7
0
        private void DoXUnpacking()
        {
            wsINP.IwsINPClient client = new wsINP.IwsINPClient();
            try
            {
                baseForm.SetCursor();
                grdQuery.UpdateData();
                List<string[]> lstunpacking = new List<string[]>();
                foreach (UltraGridRow row in this.grdQuery.Rows)
                {
                    if (row.Cells["ck"].Value.ToString().Equals(MES_Misc.Y.ToString()))
                    {
                        if (row.Cells["workgroup"].Value.ToString().Equals(""))
                        {
                            throw new Exception(UtilCulture.GetString("Msg.R01020", UtilCulture.GetString("Label.R01016")));
                        }
                        else
                        {
                            lstunpacking.Add(new string[] { row.Cells["customerid"].Value.ToString(), row.Cells["custorderno"].Value.ToString(), row.Cells["cartonno"].Value.ToString(), row.Cells["workgroup"].Value.ToString() });
                        }
                    }
                }
                if (lstunpacking.Count == 0)
                {
                    throw new Exception(UtilCulture.GetString("Msg.R01018"));
                }

                client.DoXUnpacking(baseForm.CurrentContextInfo,lstunpacking.ToArray());
                baseForm.CreateMessageBox(Public_MessageBox.Information, MessageBoxButtons.OK, null, UtilCulture.GetString("Msg.R00028"));
                RefreshGrid();
            }
            catch (Exception ex)
            {
                baseForm.CreateMessageBox(Public_MessageBox.Error, MessageBoxButtons.OK, null, ex.Message);
            }
            finally
            {
                baseForm.ResetCursor();
                baseForm.CloseWCF(client);
            }
        }
Exemplo n.º 8
0
 private DataTable GetRepairFailed(string custorderno)
 {
     wsINP.IwsINPClient client = new wsINP.IwsINPClient();
     DataTable dt = null;
     try
     {
         List<MESParameterInfo> lstParams = new List<MESParameterInfo>() {
                     new MESParameterInfo(){ParamName="custorderno",ParamValue=custorderno},
                     new MESParameterInfo(){ParamName="reptype",ParamValue=MES_RepairType.RepairFail.ToString()}
                 };
         dt = client.GetRepairHisRecords(baseForm.CurrentContextInfo, lstParams.ToArray<MESParameterInfo>()).Tables[0];
     }
     catch (Exception ex)
     {
         throw ex;
     }
     finally
     {
         baseForm.CloseWCF(client);
     }
     return dt;
 }
Exemplo n.º 9
0
 private void DeleteShipPlan()
 {
     if (this.grdQuery.ActiveRow != null)
     {
         Dictionary<string, object> dir = new Dictionary<string, object>();
         dir.Add(UtilCulture.GetString("Label.R02057"), this.grdQuery.ActiveRow.Cells["shippingplanno"].Value.ToString());
         DialogResult result = baseForm.CreateMessageBox(Public_MessageBox.Question,
                                                         MessageBoxButtons.OKCancel,
                                                         UtilCulture.GetString("Msg.R00004"),
                                                         dir);
         if (result == DialogResult.OK)
         {
             baseForm.SetCursor();
             wsINP.IwsINPClient client = new wsINP.IwsINPClient();
             try
             {
                 if (client.HasShipByPlanNo(baseForm.CurrentContextInfo, this.grdQuery.ActiveRow.Cells["shippingplanno"].Value.ToString()))
                 {
                     baseForm.CreateMessageBox(Public_MessageBox.Error, MessageBoxButtons.OK, null, UtilCulture.GetString("Msg.R00095"));
                 }
                 else
                 {
                     client.DoDeleteShipping(baseForm.CurrentContextInfo, this.grdQuery.ActiveRow.Cells["shippingsysid"].Value.ToString());
                     RefreshGrid();
                     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);
             }
         }
     }
 }
Exemplo n.º 10
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("Menu.M200210") + ": "
                            + this.grdQuery.ActiveRow.Cells["customername"].Value.ToString() + "," + this.grdQuery.ActiveRow.Cells["itemname"].Value.ToString());

            if (result == DialogResult.Cancel) return;

            wsINP.IwsINPClient client = new wsINP.IwsINPClient();
            try
            {
                baseForm.SetCursor();

                List<MESParameterInfo> lstParameters = new List<MESParameterInfo>() {
                    new MESParameterInfo(){
                        ParamName="oprisysid",
                        ParamValue=this.grdQuery.ActiveRow.Cells["oprisysid"].Value.ToString(),
                        ParamType="string"
                    }
                };
                client.DoDeleteOtherPricing(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);
            }
        }
Exemplo n.º 11
0
 private void DoInsertRequestPay(tinprequestpay requestPay, List<tinprequestpaydtl> lstRequestPayDtl)
 {
     wsINP.IwsINPClient client = new wsINP.IwsINPClient();
     try
     {
         client.DoInsertRequestPay(baseForm.CurrentContextInfo, requestPay, lstRequestPayDtl.ToArray<tinprequestpaydtl>());
     }
     catch (Exception ex)
     {
         throw ex;
     }
     finally
     {
         baseForm.CloseWCF(client);
     }
 }
Exemplo n.º 12
0
 private void GetCustOrder(string step,string workgroup)
 {
     wsINP.IwsINPClient client = new wsINP.IwsINPClient();
     try
     {
         List<MESParameterInfo> lstParameters = new List<MESParameterInfo>();
         lstParameters.Add(new MESParameterInfo()
         {
             ParamName = "status",
             ParamValue = step,
             ParamType = "string"
         });
         lstParameters.Add(new MESParameterInfo()
         {
             ParamName = "workgroup",
             ParamValue = workgroup,
             ParamType = "string"
         });
         DataSet ds = client.GetLeftWipRecords(baseForm.CurrentContextInfo, lstParameters.ToArray<MESParameterInfo>());
         ds.Tables[0].DefaultView.Sort = "custorderno asc";
         this.ucmbCustOrderNo.SetDataBinding(ds.Tables[0], "");
     }
     catch (Exception ex)
     {
         throw ex;
     }
     finally
     {
         baseForm.CloseWCF(client);
     }
 }
Exemplo n.º 13
0
        private void DoRepair(bool closeFlag)
        {
            wsINP.IwsINPClient client = new wsINP.IwsINPClient();
            try{
                baseForm.SetCursor();
                baseForm.ValidateData(this);
                if (this.numRepairQty.Value > Convert.ToInt16(this.txtPairQty.Text))
                {
                    throw new Exception(UtilCulture.GetString("Msg.R01014", UtilCulture.GetString("Label.R02026"), UtilCulture.GetString("Label.R02036")));
                }

                tinprepairhis his = new tinprepairhis();
                his.repsysid = Function.GetGUID();
                his.workgroup = ((ValueInfo)this.cmbWorkGroup.SelectedItem).ValueField;
                his.step = ((ValueInfo)this.cmbStep.SelectedItem).ValueField;
                his.reptype = MES_RepairType.ToRepair.ToString();
                his.customerid = this.ucmbCustOrderNo.SelectedRow.Cells["customerid"].Value.ToString();
                his.custorderno = this.ucmbCustOrderNo.Value.ToString();
                his.styleno = this.txtStyleNo.Text;
                his.color = this.txtColor.Text;
                his.size = this.txtSize.Text;
                his.checktype = this.ucmbCustOrderNo.SelectedRow.Cells["checktype"].Value.ToString();
                his.isfirst = this.ckIsFirst.Checked ? MES_Misc.Y.ToString() : MES_Misc.N.ToString();
                his.pairqty = this.numRepairQty.Value;
                his.claimtime = Function.GetCurrentTime();
                his.claimuser = Function.GetCurrentUser();

                List<tinprepairfail> lstreasoncode = new List<tinprepairfail>();

                foreach (UltraGridRow row in this.grdDetail.Rows)
                {
                    if (row.Cells["ck"].Value.ToString().Equals("Y"))
                    {
                        if (Convert.ToDecimal(row.Cells["pairqty"].Value)==0)
                        {
                            throw new Exception(UtilCulture.GetString("Msg.R01016", UtilCulture.GetString("Label.R02036")));
                        }
                        tinprepairfail repairfail = new tinprepairfail();
                        repairfail.reasoncode = row.Cells["reasoncode"].Value.ToString();
                        repairfail.remark = row.Cells["remark"].Value.ToString();
                        repairfail.pairqty = Convert.ToDecimal(row.Cells["pairqty"].Value);
                        lstreasoncode.Add(repairfail);
                    }
                }

                if (this.numRepairQty.Value == 0)
                {
                    throw new Exception(UtilCulture.GetString("Msg.R01016", UtilCulture.GetString("Label.R02036")));
                }
                if (lstreasoncode.Count == 0)
                {
                    throw new Exception(UtilCulture.GetString("Msg.R01015"));
                }

                client.DoInsertRepair(baseForm.CurrentContextInfo, his, lstreasoncode.ToArray<tinprepairfail>());
                baseForm.CreateMessageBox(Public_MessageBox.Information, MessageBoxButtons.OK, null, UtilCulture.GetString("Msg.R00002"));
                if (closeFlag)
                {
                    this.Close();
                }
                else
                {
                    Clean();
                }

            }
            catch (Exception ex)
            {
                baseForm.CreateMessageBox(Public_MessageBox.Error, MessageBoxButtons.OK, null, ex.Message);
            }
            finally
            {
                baseForm.ResetCursor();
                baseForm.CloseWCF(client);
            }
        }
Exemplo n.º 14
0
        private tinpshippingplan GetShippingPlan(string shippingplanno)
        {
            wsINP.IwsINPClient client = new wsINP.IwsINPClient();
            tinpshippingplan shippingplan = null;
            try
            {
                List<MESParameterInfo> lstParams = new List<MESParameterInfo>() {
                            new MESParameterInfo(){ParamName="shippingplanno",ParamValue=shippingplanno}
                        };
                shippingplan = client.GetSingleShippingPlan(baseForm.CurrentContextInfo, lstParams.ToArray<MESParameterInfo>());

            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                baseForm.CloseWCF(client);
            }
            return shippingplan;
        }
Exemplo n.º 15
0
        private void GetData()
        {
            wsINP.IwsINPClient client = new wsINP.IwsINPClient();
            try
            {
                baseForm.SetCursor();

                DataSet ds = client.GetDailySchedule(baseForm.CurrentContextInfo,this.dateTimePicker1.Text,this.dateTimePicker2.Text);

                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);
            }
        }
Exemplo n.º 16
0
 private DataTable GetSingleShipping(string sysid)
 {
     wsINP.IwsINPClient client = new wsINP.IwsINPClient();
     DataTable dt = null;
     try
     {
         List<MESParameterInfo> lstParams = new List<MESParameterInfo>() {
                     new MESParameterInfo(){ParamName="shippingsysid",ParamValue=sysid}
                 };
         dt = client.GetShippingRecords(baseForm.CurrentContextInfo, lstParams.ToArray<MESParameterInfo>()).Tables[0];
     }
     catch (Exception ex)
     {
         throw ex;
     }
     finally
     {
         baseForm.CloseWCF(client);
     }
     return dt;
 }
Exemplo n.º 17
0
        private void DoSave()
        {
            wsINP.IwsINPClient client = new wsINP.IwsINPClient();
            try
            {
                baseForm.SetCursor();
                baseForm.ValidateData(this);
                if (this.numPairQty.Value == orgqty)
                {
                    throw new Exception(UtilCulture.GetString("Msg.R01025"));
                }
                if (this.numPairQty.Value > orgqty)
                {
                    if (RepairHis.reptype.Equals(MES_RepairType.ToRepair.ToString()))
                    {
                        tinpwip wip = GetSingleWip();
                        if (wip != null)
                        {
                            if ((this.numPairQty.Value - orgqty) > wip.pairqty)
                            {
                                throw new Exception(UtilCulture.GetString("Msg.R01027"));
                            }
                        }
                        else
                        {
                            if ((this.numPairQty.Value - orgqty) > 0)
                            {
                                throw new Exception(UtilCulture.GetString("Msg.R01027"));
                            }
                        }
                    }

                    if (RepairHis.reptype.Equals(MES_RepairType.RepairFail.ToString()) || RepairHis.reptype.Equals(MES_RepairType.RepairSuccess.ToString()))
                    {
                        tinprepairstock stock = GetSingleRepairStock();
                        if (stock != null)
                        {
                            if ((this.numPairQty.Value - orgqty) > stock.curpairqty)
                            {
                                throw new Exception(UtilCulture.GetString("Msg.R01026"));
                            }
                        }
                        else
                        {
                            throw new Exception("No data found");
                        }
                    }
                }
                else
                {
                    if (RepairHis.reptype.Equals(MES_RepairType.ToRepair.ToString()))
                    {
                        tinprepairstock stock = GetSingleRepairStock();
                        if (stock != null)
                        {
                            if ((orgqty-this.numPairQty.Value) > stock.curpairqty)
                            {
                                throw new Exception(UtilCulture.GetString("Msg.R01026"));
                            }
                        }
                        else
                        {
                            throw new Exception("No data found");
                        }
                    }
                    else if (RepairHis.reptype.Equals(MES_RepairType.RepairSuccess.ToString()))
                    {
                        int leftSuccessQty = GetLeftRepairSuccessQty();
                        if ((orgqty - this.numPairQty.Value) > leftSuccessQty)
                        {
                            throw new Exception(UtilCulture.GetString("Msg.R01027"));
                        }

                    }
                }
                client.DoRepaireAdjust(baseForm.CurrentContextInfo, RepairHis.repsysid, ReaseanCode, Convert.ToInt16(this.numPairQty.Value));
                baseForm.CreateMessageBox(Public_MessageBox.Information, MessageBoxButtons.OK, null, UtilCulture.GetString("Msg.R00002"));
                this.Close();
            }
            catch (Exception ex)
            {
                baseForm.CreateMessageBox(Public_MessageBox.Error, MessageBoxButtons.OK, null, ex.Message);
            }
            finally
            {
                baseForm.ResetCursor();
            }
        }
Exemplo n.º 18
0
        private void GetWarehouseData(List<MESParameterInfo> lstParameters)
        {
            wsINP.IwsINPClient client = new wsINP.IwsINPClient();
            try
            {
                baseForm.SetCursor();

                DataSet ds = new DataSet();
                DataSet mainds = client.GetReceivingSumCtnDtlRecords(baseForm.CurrentContextInfo, lstParameters.ToArray<MESParameterInfo>());
                DataSet subds = client.GetReceivingCtnDtlRecords(baseForm.CurrentContextInfo, lstParameters.ToArray<MESParameterInfo>());
                DataTable maindt = mainds.Tables[0];
                DataTable subdt = subds.Tables[0];
                maindt.TableName = "Main";
                subdt.TableName = "Sub";
                mainds.Tables.Clear();
                subds.Tables.Clear();

                if (maindt != null)
                {
                    ds.Tables.Add(maindt);
                    ds.Tables.Add(subdt);
                    ds.Relations.Add("ps", new DataColumn[] { ds.Tables["Main"].Columns["customerid"], ds.Tables["Main"].Columns["custorderno"], ds.Tables["Main"].Columns["cartonno"] }, new DataColumn[] { ds.Tables["Sub"].Columns["customerid"], ds.Tables["Sub"].Columns["custorderno"], ds.Tables["Sub"].Columns["cartonno"] }, false);
                    this.grdWarehouse.SetDataBinding(ds, "");
                }

                this.ucStatusBar1.ShowText1(UtilCulture.GetString("Msg.R00006") + ": " + maindt.Rows.Count.ToString());

            }
            catch (Exception ex)
            {
                MESMsgBox.ShowError(ExceptionParser.Parse(ex));
            }
            finally
            {
                baseForm.ResetCursor();
                baseForm.CloseWCF(client);
            }
        }
Exemplo n.º 19
0
 private tinpwip GetSingleWip()
 {
     wsINP.IwsINPClient client = new wsINP.IwsINPClient();
     tinpwip wip = null;
     try
     {
         List<MESParameterInfo> lstParameters = new List<MESParameterInfo>();
         lstParameters.Add(new MESParameterInfo()
         {
             ParamName = "customerid",
             ParamValue = RepairHis.customerid,
             ParamType = "string"
         });
         lstParameters.Add(new MESParameterInfo()
         {
             ParamName = "custorderno",
             ParamValue = RepairHis.custorderno,
             ParamType = "string"
         });
         lstParameters.Add(new MESParameterInfo()
         {
             ParamName = "styleno",
             ParamValue = RepairHis.styleno,
             ParamType = "string"
         });
         lstParameters.Add(new MESParameterInfo()
         {
             ParamName = "color",
             ParamValue = RepairHis.color,
             ParamType = "string"
         });
         lstParameters.Add(new MESParameterInfo()
         {
             ParamName = "size",
             ParamValue = RepairHis.size,
             ParamType = "string"
         });
         lstParameters.Add(new MESParameterInfo()
         {
             ParamName = "status",
             ParamValue = RepairHis.step,
             ParamType = "string"
         });
         lstParameters.Add(new MESParameterInfo()
         {
             ParamName = "workgroup",
             ParamValue = RepairHis.workgroup,
             ParamType = "string"
         });
         wip = client.GetSingleWip(baseForm.CurrentContextInfo, lstParameters.ToArray<MESParameterInfo>());
     }
     catch (Exception ex)
     {
         throw ex;
     }
     finally
     {
         baseForm.CloseWCF(client);
     }
     return wip;
 }
Exemplo n.º 20
0
 private DataTable GetRepairFail(string repsysid,string reasoncode)
 {
     wsINP.IwsINPClient client = new wsINP.IwsINPClient();
     DataTable dt = null;
     try
     {
         List<MESParameterInfo> lstParameters = new List<MESParameterInfo>();
         lstParameters.Add(new MESParameterInfo()
         {
             ParamName = "repsysid",
             ParamValue = repsysid,
             ParamType = "string"
         });
         lstParameters.Add(new MESParameterInfo()
         {
             ParamName = "reasoncode",
             ParamValue = reasoncode,
             ParamType = "string"
         });
         dt = client.GetRepairFailRecords(baseForm.CurrentContextInfo, lstParameters.ToArray<MESParameterInfo>()).Tables[0];
     }
     catch (Exception ex)
     {
         throw ex;
     }
     finally
     {
         baseForm.CloseWCF(client);
     }
     return dt;
 }
Exemplo n.º 21
0
        public void DoShowEmptyData()
        {
            wsINP.IwsINPClient client = new wsINP.IwsINPClient();

            try
            {
                baseForm.SetCursor();

                #region Show flow
                List<MESParameterInfo> lstParameter = new List<MESParameterInfo>()
                {
                    new MESParameterInfo()
                    {
                        ParamName="prisysid",
                        ParamValue=MES_DummyData.Dummy_Data_XXX_111.ToString(),
                        ParamType="string"
                    }
                };

                DataSet ds = client.GetPricingRecords(baseForm.CurrentContextInfo, lstParameter.ToArray<MESParameterInfo>());
                this.grdDetail.DataSource = ds.Tables[0];
                #endregion
            }
            catch (Exception ex)
            {
                MESMsgBox.ShowError(ExceptionParser.Parse(ex));
            }
            finally
            {
                baseForm.ResetCursor();
                baseForm.CloseWCF(client);
            }
        }
Exemplo n.º 22
0
        private System.Data.DataTable GetShippingDetail(string orderNo)
        {
            wsINP.IwsINPClient client = new wsINP.IwsINPClient();
            System.Data.DataTable dt = null;
            try
            {
                List<MESParameterInfo> lstParameters = new List<MESParameterInfo>();
                lstParameters.Add(new MESParameterInfo()
                {
                    ParamName = "custorderno",
                    ParamValue = orderNo,
                    ParamType = "string"
                });
                lstParameters.Add(new MESParameterInfo()
                {
                    ParamName = "shippingstatus",
                    ParamValue = MES_ShippingStatus.Shipped.ToString(),
                    ParamType = "string"
                });
                dt = client.GetShippingDtlRecords(baseForm.CurrentContextInfo, lstParameters.ToArray<MESParameterInfo>()).Tables[0];

            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                baseForm.CloseWCF(client);
            }
            return dt;
        }
Exemplo n.º 23
0
        public void DoShowSingleObject(List<MESParameterInfo> lstParameters)
        {
            wsINP.IwsINPClient client = new wsINP.IwsINPClient();

            try
            {
                baseForm.SetCursor();

                #region Show to UI
                tinppricing prc = client.GetSinglePricing(baseForm.CurrentContextInfo, lstParameters.ToArray<MESParameterInfo>());

                if (prc == null) return;

                baseForm.ShowSingleObjectToUI<tinppricing>(prc, this);
                OriginalPricing = prc;
                #endregion

                #region Show pricing detail
                List<MESParameterInfo> lstParameter = new List<MESParameterInfo>()
                {
                    new MESParameterInfo()
                    {
                        ParamName="prisysid",
                        ParamValue=prc.prisysid,
                        ParamType="string"
                    }
                };

                DataSet ds = client.GetPricingRecords(baseForm.CurrentContextInfo, lstParameter.ToArray<MESParameterInfo>());
                this.grdDetail.DataSource = ds.Tables[0];
                #endregion
            }
            catch (Exception ex)
            {
                MESMsgBox.ShowError(ExceptionParser.Parse(ex));
            }
            finally
            {
                baseForm.ResetCursor();
                baseForm.CloseWCF(client);
            }
        }
Exemplo n.º 24
0
 private DataTable GetShippingOrigDtlForReport(string sysid)
 {
     wsINP.IwsINPClient client = new wsINP.IwsINPClient();
     DataTable dt = null;
     try
     {
         dt = client.GetShippingOrigDtlForReport(baseForm.CurrentContextInfo, sysid).Tables[0];
     }
     catch (Exception ex)
     {
         throw ex;
     }
     finally
     {
         baseForm.CloseWCF(client);
     }
     return dt;
 }
Exemplo n.º 25
0
 private tinprequestpay GetSingleRequestPay(string sysid)
 {
     wsINP.IwsINPClient client = new wsINP.IwsINPClient();
     tinprequestpay result = null;
     try
     {
         List<MESParameterInfo> lstParams = new List<MESParameterInfo>() {
                     new MESParameterInfo(){ParamName="shippingsysid",ParamValue=sysid}
                 };
         result = client.GetSingleRequestPay(baseForm.CurrentContextInfo, lstParams.ToArray<MESParameterInfo>());
     }
     catch (Exception ex)
     {
         throw ex;
     }
     finally
     {
         baseForm.CloseWCF(client);
     }
     return result;
 }
Exemplo n.º 26
0
        private void DoShipPlan()
        {
            wsINP.IwsINPClient client = new wsINP.IwsINPClient();
            try
            {
                baseForm.SetCursor();
                baseForm.ValidateData(this);

                if (ShipingSysId == null)
                {
                    ShipingSysId = Function.GetGUID();
                }
                List<string> lstcustorderno = new List<string>();
                List<tinpshippingdtl> lstshippingdtl = new List<tinpshippingdtl>();
                foreach (UltraGridRow row in this.grdDetail.Rows)
                {
                    if (lstcustorderno.Contains(row.Cells["custorderno"].Value.ToString()))
                    {
                        throw new Exception(UtilCulture.GetString("Msg.R01022", row.Cells["custorderno"].Value.ToString()));
                    }
                    else
                    {
                        lstcustorderno.Add(row.Cells["custorderno"].Value.ToString());
                    }
                    if ( Convert.ToInt16(row.Cells["cartonqty"].Value) <= 0)
                    {
                        throw new Exception(UtilCulture.GetString("Msg.R01016", UtilCulture.GetString("Label.R02021")));
                    }
                    int maxcartonqty = getMaxCartonQty(((ValueInfo)this.cmbCustomer.SelectedItem).ValueField,row.Cells["custorderno"].Value.ToString());
                    if (Convert.ToInt16(row.Cells["cartonqty"].Value) >maxcartonqty )
                    {
                        throw new Exception(UtilCulture.GetString("Msg.R01014", UtilCulture.GetString("Label.R02021"), maxcartonqty.ToString()));
                    }
                    tinpshippingdtl dtl = new tinpshippingdtl();
                    if (UpdateMode == Public_UpdateMode.Update)
                    {
                        List<MESParameterInfo> lstParams = new List<MESParameterInfo>() {
                            new MESParameterInfo(){ParamName="custorderno",ParamValue=row.Cells["custorderno"].Value.ToString()},
                            new MESParameterInfo(){ParamName="shippingsysid",ParamValue=ShipingSysId}
                        };

                        DataSet ds = client.GetShippingDtlCtnRecords(baseForm.CurrentContextInfo, lstParams.ToArray<MESParameterInfo>());

                        if (ds.Tables[0].Rows.Count > Convert.ToInt16(row.Cells["cartonqty"].Value))
                        {
                            throw new Exception(UtilCulture.GetString("Msg.R01023", UtilCulture.GetString("Label.R02021"), ds.Tables[0].Rows.Count.ToString()));
                        }
                    }
                    dtl.shippingsysid = ShipingSysId;
                    dtl.shippingplanno = this.txtShippingPlanNo.Text;
                    dtl.customerid =((ValueInfo)this.cmbCustomer.SelectedItem).ValueField;
                    dtl.custorderno = row.Cells["custorderno"].Value.ToString();
                    dtl.ttlcantonqty = Convert.ToInt16(row.Cells["cartonqty"].Value);
                    lstshippingdtl.Add(dtl);
                }
                if (lstshippingdtl.Count == 0)
                {
                    throw new Exception(UtilCulture.GetString("Msg.R01019"));
                }
                tinpshippingplan shippingplan = new tinpshippingplan();
                shippingplan.shippingplanno = this.txtShippingPlanNo.Text;
                shippingplan.loadingdate = Convert.ToDateTime(this.dtLoadingDt.Value);
                shippingplan.boxqty = this.txtBoxQty.Text;
                shippingplan.deliverybill = this.txtDeliveryBill.Text;
                shippingplan.inshipno = this.txtInShipNo.Text;
                shippingplan.commissionedqty =Convert.ToInt16( this.numCommissionedQty.Value);
                shippingplan.commissionedvolume = this.numCommissionedVolume.Value;
                shippingplan.commissionedweight = this.numCommissionedWeight.Value;
                shippingplan.startport = this.txtStartPort.Text;
                shippingplan.destinationport = this.txtDestinationPort.Text;
                shippingplan.unloadport = this.txtUnloadPort.Text;
                shippingplan.voyage = this.txtVoyage.Text;
                shippingplan.remark = this.txtRemark.Text;

                client.DoShipPlan(baseForm.CurrentContextInfo, lstshippingdtl.ToArray<tinpshippingdtl>(), shippingplan);
                if (UpdateMode == Public_UpdateMode.Update)
                {
                    baseForm.CreateMessageBox(Public_MessageBox.Information, MessageBoxButtons.OK, null, UtilCulture.GetString("Msg.R00002"));
                }
                else
                {
                    baseForm.CreateMessageBox(Public_MessageBox.Information, MessageBoxButtons.OK, null, UtilCulture.GetString("Msg.R00001"));
                }
                this.Close();

            }
            catch (Exception ex)
            {
                baseForm.CreateMessageBox(Public_MessageBox.Error, MessageBoxButtons.OK, null, ex.Message);
            }
            finally
            {
                baseForm.ResetCursor();
                baseForm.CloseWCF(client);
            }
        }
Exemplo n.º 27
0
 private DataTable GetValidPricing(string customerid, DateTime date)
 {
     wsINP.IwsINPClient client = new wsINP.IwsINPClient();
     DataTable dt = null;
     try
     {
         dt = client.GetValidPricing(baseForm.CurrentContextInfo, customerid, date).Tables[0];
     }
     catch (Exception ex)
     {
         throw ex;
     }
     finally
     {
         baseForm.CloseWCF(client);
     }
     return dt;
 }
Exemplo n.º 28
0
        private DataTable GetCustOrder()
        {
            wsINP.IwsINPClient client = new wsINP.IwsINPClient();
            DataTable dt = null;
            try
            {
                dt = client.GetPackingCartonSummaryRecords(baseForm.CurrentContextInfo).Tables[0];

            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                baseForm.CloseWCF(client);
            }
            return dt;
        }
Exemplo n.º 29
0
        private DataTable GetShippingDtlRecords()
        {
            wsINP.IwsINPClient client = new wsINP.IwsINPClient();
            DataTable dt = null;
            try
            {
                List<MESParameterInfo> lstParams = new List<MESParameterInfo>() {
                            new MESParameterInfo(){ParamName="shippingsysid",ParamValue=ShipingSysId}
                        };
                dt = client.GetShippingDtlRecords(baseForm.CurrentContextInfo, lstParams.ToArray<MESParameterInfo>()).Tables[0];
                dt.Columns.Add("cartonqty");
                foreach (DataRow row in dt.Rows)
                {
                    row["cartonqty"] = row["ttlcantonqty"];
                }

            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                baseForm.CloseWCF(client);
            }
            return dt;
        }
Exemplo n.º 30
0
        public void DoSaveSingleObject()
        {
            wsINP.IwsINPClient client = new wsINP.IwsINPClient();

            try
            {
                baseForm.SetCursor();

                #region Validate & build object from UI
                baseForm.ValidateData(this);

                if (!CheckBeforeSave()) return;

                tinppricing prc = new tinppricing();

                if (UpdateMode == Public_UpdateMode.Update)
                {
                    prc = OriginalPricing;
                }

                //Build Pricing Object
                baseForm.CreateSingleObject<tinppricing>(prc, this, UpdateMode);

                if (UpdateMode == Public_UpdateMode.Insert)
                {
                    prc.prisysid = Function.GetGUID();
                }

                prc.lastmodifiedtime = Function.GetCurrentTime();
                prc.lastmodifieduser = Function.GetCurrentUser();

                #endregion

                #region Prepare Pricing Detail
                List<tinppricingdtl> lstDtl = new List<tinppricingdtl>();
                for (int i = 0; i < grdDetail.Rows.Count; i++)
                {
                    tinppricingdtl dtl = new tinppricingdtl();

                    dtl.checktype = this.grdDetail.Rows[i].Cells["checktype"].Value.ToString();
                    dtl.lastmodifiedtime = prc.lastmodifiedtime;
                    dtl.lastmodifieduser = prc.lastmodifieduser;
                    dtl.pridtlsysid = Function.GetGUID();
                    dtl.prisysid = prc.prisysid;
                    dtl.remark = string.Empty;
                    dtl.category = this.grdDetail.Rows[i].Cells["category"].Value.ToString();

                    if (this.grdDetail.Rows[i].Cells["reworkratio"].Value.ToString() == string.Empty)
                        dtl.reworkratio = null;
                    else
                        dtl.reworkratio = decimal.Parse(this.grdDetail.Rows[i].Cells["reworkratio"].Value.ToString());

                    if (this.grdDetail.Rows[i].Cells["reworkprice"].Value.ToString() == string.Empty)
                        dtl.reworkprice = null;
                    else
                        dtl.reworkprice = decimal.Parse(this.grdDetail.Rows[i].Cells["reworkprice"].Value.ToString());

                    if (this.grdDetail.Rows[i].Cells["sbootheight"].Value.ToString() == string.Empty)
                        dtl.sbootheight = 0;
                    else
                        dtl.sbootheight = decimal.Parse(this.grdDetail.Rows[i].Cells["sbootheight"].Value.ToString());

                    if (this.grdDetail.Rows[i].Cells["ebootheight"].Value.ToString() == string.Empty)
                        dtl.ebootheight = 0;
                    else
                        dtl.ebootheight = decimal.Parse(this.grdDetail.Rows[i].Cells["ebootheight"].Value.ToString());

                    lstDtl.Add(dtl);
                }

                var q = (from p in lstDtl
                         group p by new { p.category, p.checktype,p.sbootheight,p.ebootheight } into t1
                         select new
                         {
                             category = t1.Key.category,
                             checktype = t1.Key.checktype,
                             pridtlsysid = t1.Max(p => p.pridtlsysid),
                             prisysid = t1.Max(p => p.prisysid),
                             remark = t1.Max(p => p.remark),
                             reworkratio = t1.Max(p => p.reworkratio),
                             reworkprice = t1.Max(p => p.reworkprice),
                             sbootheight = t1.Key.sbootheight,
                             ebootheight = t1.Key.ebootheight,
                             lastmodifiedtime = t1.Max(p => p.lastmodifiedtime),
                             lastmodifieduser = t1.Max(p => p.lastmodifieduser)
                         }).ToList();

                List<tinppricingdtldef> lstDef = new List<tinppricingdtldef>();
                for (int i = 0; i < grdDetail.Rows.Count; i++)
                {
                    tinppricingdtldef def = new tinppricingdtldef();

                    var q1 = (from p in q
                              where p.category == this.grdDetail.Rows[i].Cells["category"].Value.ToString()
                              && p.checktype == this.grdDetail.Rows[i].Cells["checktype"].Value.ToString()
                              && p.sbootheight == Decimal.Parse(this.grdDetail.Rows[i].Cells["sbootheight"].Value.ToString())
                              && p.ebootheight == Decimal.Parse(this.grdDetail.Rows[i].Cells["ebootheight"].Value.ToString())
                              select p.pridtlsysid).Single();

                    def.currency = this.grdDetail.Rows[i].Cells["currency"].Value.ToString();

                    if (this.grdDetail.Rows[i].Cells["effectivedate"].Value.ToString() != string.Empty)
                        def.effectivedate = DateTime.Parse(this.grdDetail.Rows[i].Cells["effectivedate"].Value.ToString());

                    if (this.grdDetail.Rows[i].Cells["expireddate"].Value.ToString() != string.Empty)
                        def.expireddate = DateTime.Parse(this.grdDetail.Rows[i].Cells["expireddate"].Value.ToString());
                    else
                        def.expireddate = null;

                    def.price = decimal.Parse(this.grdDetail.Rows[i].Cells["price"].Value.ToString());
                    def.pridtldefsysid = Function.GetGUID();
                    def.pridtlsysid = q1;
                    def.remark = this.grdDetail.Rows[i].Cells["remark"].Value.ToString();
                    def.unit = this.grdDetail.Rows[i].Cells["unit"].Value.ToString();

                    lstDef.Add(def);
                }

                List<tinppricingdtl> lstDtlFinal = new List<tinppricingdtl>();
                for (int i = 0; i < q.Count; i++)
                {
                    tinppricingdtl dtl = new tinppricingdtl();

                    dtl.checktype = q[i].checktype;
                    dtl.lastmodifiedtime = q[i].lastmodifiedtime;
                    dtl.lastmodifieduser = q[i].lastmodifieduser;
                    dtl.pridtlsysid = q[i].pridtlsysid;
                    dtl.prisysid = q[i].prisysid;
                    dtl.remark = q[i].remark;
                    dtl.category = q[i].category;
                    dtl.reworkratio = q[i].reworkratio;
                    dtl.reworkprice = q[i].reworkprice;
                    dtl.sbootheight = q[i].sbootheight;
                    dtl.ebootheight = q[i].ebootheight;

                    lstDtlFinal.Add(dtl);
                }
                #endregion

                #region call WCF

                if (UpdateMode == Public_UpdateMode.Insert)
                {
                    client.DoInsertPricing(baseForm.CurrentContextInfo, prc,
                        lstDtlFinal.ToArray<tinppricingdtl>(), lstDef.ToArray<tinppricingdtldef>());
                }

                if (UpdateMode == Public_UpdateMode.Update)
                {
                    client.DoUpdatePricing(baseForm.CurrentContextInfo, prc,
                        lstDtlFinal.ToArray<tinppricingdtl>(), lstDef.ToArray<tinppricingdtldef>());
                }
                #endregion

                if (UpdateMode == Public_UpdateMode.Insert)
                    baseForm.CreateMessageBox(Public_MessageBox.Information, MessageBoxButtons.OK, null, UtilCulture.GetString("Msg.R00001"));
                else if (UpdateMode == Public_UpdateMode.Update)
                    baseForm.CreateMessageBox(Public_MessageBox.Information, MessageBoxButtons.OK, null, UtilCulture.GetString("Msg.R00002"));

                this.Close();
            }
            catch (Exception ex)
            {
                MESMsgBox.ShowError(ExceptionParser.Parse(ex));
            }
            finally
            {
                baseForm.ResetCursor();
                baseForm.CloseWCF(client);
            }
        }