Exemple #1
0
 /// <summary>
 /// Deprecated Method for adding a new object to the tinprepairstock EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddTotinprepairstock(tinprepairstock tinprepairstock)
 {
     base.AddObject("tinprepairstock", tinprepairstock);
 }
Exemple #2
0
 /// <summary>
 /// Create a new tinprepairstock object.
 /// </summary>
 /// <param name="customerid">Initial value of the customerid property.</param>
 /// <param name="custorderno">Initial value of the custorderno property.</param>
 /// <param name="styleno">Initial value of the styleno property.</param>
 /// <param name="color">Initial value of the color property.</param>
 /// <param name="size">Initial value of the size property.</param>
 /// <param name="checktype">Initial value of the checktype property.</param>
 /// <param name="workgroup">Initial value of the workgroup property.</param>
 /// <param name="step">Initial value of the step property.</param>
 public static tinprepairstock Createtinprepairstock(global::System.String customerid, global::System.String custorderno, global::System.String styleno, global::System.String color, global::System.String size, global::System.String checktype, global::System.String workgroup, global::System.String step)
 {
     tinprepairstock tinprepairstock = new tinprepairstock();
     tinprepairstock.customerid = customerid;
     tinprepairstock.custorderno = custorderno;
     tinprepairstock.styleno = styleno;
     tinprepairstock.color = color;
     tinprepairstock.size = size;
     tinprepairstock.checktype = checktype;
     tinprepairstock.workgroup = workgroup;
     tinprepairstock.step = step;
     return tinprepairstock;
 }
Exemple #3
0
        private void DoRepair()
        {
            wsINP.IwsINPClient client = new wsINP.IwsINPClient();
            try
            {
                baseForm.SetCursor();
                baseForm.ValidateData(this);
                if (((ValueInfo)this.cmbJointType.SelectedItem).ValueField != "")
                {
                    if (((ValueInfo)this.cmbJointType.SelectedItem).ValueField.Equals("签名") && this.txtSignature.Text.Trim() == "")
                    {
                        throw new Exception(UtilCulture.GetString("Msg.R01020", UtilCulture.GetString("Label.R010763")));
                    }
                    if (this.numFailedQty.Value > 0)
                    {
                        throw new Exception(UtilCulture.GetString("Msg.R01014", UtilCulture.GetString("Label.R01076"), "0"));
                    }
                }

                if (this.numSuccessQty.Value == 0 && this.numFailedQty.Value == 0)
                {
                    throw new Exception(UtilCulture.GetString("Msg.R01017", UtilCulture.GetString("Label.R01075"), UtilCulture.GetString("Label.R01076")));
                }
                if ((this.numSuccessQty.Value + this.numFailedQty.Value) > RepairStock.curpairqty)
                {
                    throw new Exception(UtilCulture.GetString("Msg.R01014", UtilCulture.GetString("Label.R01075") + "+" + UtilCulture.GetString("Label.R01076"), UtilCulture.GetString("Label.R01074")));
                }

                tinprepairstock repairstock = new tinprepairstock();
                repairstock.customerid = RepairStock.customerid;
                repairstock.custorderno = this.txtCustOrderNo.Text;
                repairstock.styleno = this.txtStyleNo.Text;
                repairstock.color = this.txtColor.Text;
                repairstock.size = this.txtSize.Text;
                repairstock.checktype = RepairStock.checktype;
                repairstock.ttlpairgoodqty = this.numSuccessQty.Value;
                repairstock.ttlbadqty = this.numFailedQty.Value;
                repairstock.step = ((ValueInfo)this.cmbToStep.SelectedItem).ValueField;
                repairstock.workgroup = ((ValueInfo)this.cmbWorkGroup.SelectedItem).ValueField;

                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.R010761")));
                        }
                        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);
                    }
                }

                client.DoRepairBack(baseForm.CurrentContextInfo, repairstock, lstreasoncode.ToArray<tinprepairfail>(), ((ValueInfo)this.cmbJointType.SelectedItem).ValueField,this.txtSignature.Text.Trim());
                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();
                baseForm.CloseWCF(client);
            }
        }
Exemple #4
0
        public void DoInsertRepair(tinprepairhis repairhis,List<tinprepairfail> lstreasoncode)
        {
            try
            {
                dbInstance.BeginTransaction();

                repairHisDal.DoInsert(repairhis);

                foreach (tinprepairfail repairfail in lstreasoncode)
                {
                    repairfail.repsysid = repairhis.repsysid;
                    repairFailDal.DoInsert(repairfail);
                }

                List<MESParameterInfo> lstParams = new List<MESParameterInfo>() {
                            new MESParameterInfo(){ParamName="customerid",ParamValue=repairhis.customerid},
                            new MESParameterInfo(){ParamName="custorderno",ParamValue=repairhis.custorderno},
                            new MESParameterInfo(){ParamName="styleno",ParamValue=repairhis.styleno},
                            new MESParameterInfo(){ParamName="color",ParamValue=repairhis.color},
                            new MESParameterInfo(){ParamName="size",ParamValue=repairhis.size},
                            new MESParameterInfo(){ParamName="checktype",ParamValue=repairhis.checktype},
                            new MESParameterInfo(){ParamName="workgroup",ParamValue=repairhis.workgroup},
                            new MESParameterInfo(){ParamName="step",ParamValue=repairhis.step}
                        };

                List<tinprepairstock> lstRepairStock = baseDal.GetSelectedObjects<tinprepairstock>(lstParams, string.Empty, true, -1);
                if (lstRepairStock.Count > 0)
                {
                    tinprepairstock repairStock = lstRepairStock[0];
                    repairStock.curpairqty = repairStock.curpairqty + repairhis.pairqty;
                    baseDal.DoUpdate(repairStock);
                }
                else
                {
                    tinprepairstock repairStock = new tinprepairstock();
                    repairStock.customerid = repairhis.customerid;
                    repairStock.custorderno = repairhis.custorderno;
                    repairStock.styleno = repairhis.styleno;
                    repairStock.color = repairhis.color;
                    repairStock.size = repairhis.size;
                    repairStock.checktype = repairhis.checktype;
                    repairStock.curpairqty = repairhis.pairqty;
                    repairStock.ttlbadqty = 0;
                    repairStock.ttlpairgoodqty = 0;
                    repairStock.workgroup = repairhis.workgroup;
                    repairStock.step = repairhis.step;
                    repairStock.lastupdatetime = Function.GetCurrentTime();
                    baseDal.DoInsert(repairStock);
                }

                #region Update WIP
                wipDal.SaveOrUpdate(repairhis.customerid, repairhis.custorderno, repairhis.styleno, repairhis.color, repairhis.size, repairhis.step, repairhis.workgroup, Convert.ToInt16(-repairhis.pairqty), repairhis.checktype);
                wipDal.SaveOrUpdate(repairhis.customerid, repairhis.custorderno, repairhis.styleno, repairhis.color, repairhis.size, MES_WIPStatus.Repair.ToString(), repairhis.workgroup, Convert.ToInt16(repairhis.pairqty), repairhis.checktype);
                #endregion

                #region Update CustomerOrder History
                tinpcustorderhistory history = new tinpcustorderhistory();
                history.customerid = "";
                history.cartonno = "";
                history.cartonqty = 0;
                history.custorderno = repairhis.custorderno;
                history.size = repairhis.size;
                history.styleno = repairhis.styleno;
                history.color = repairhis.color;
                history.eventgroup = Function.GetGUID();
                history.eventname = "To Repair";
                history.pairqty = repairhis.pairqty;
                history.refsysid = repairhis.repsysid;
                history.remark = "";

                history.eventtime = Function.GetCurrentTime();
                history.eventuser = CurrentContextInfo.CurrentUser;
                history.ohsysid = Function.GetGUID();
                history.shift = CurrentContextInfo.Shift;
                history.workgroup = CurrentContextInfo.WorkGroup;

                custOrderHistoryDal.DoInsert<tinpcustorderhistory>(history);
                #endregion

                dbInstance.Commit();
            }
            catch (Exception ex)
            {
                dbInstance.Rollback();
                throw ex;
            }
            finally
            {
                dbInstance.CloseConnection();
            }
        }
Exemple #5
0
        public void DoRepairBack(tinprepairstock repairstock, List<tinprepairfail> lstreasoncode, string jointtype, string signature)
        {
            try
            {
                dbInstance.BeginTransaction();

                #region repairhis
                tinprepairhis goodhis = new tinprepairhis();
                if (repairstock.ttlpairgoodqty > 0)
                {
                    goodhis.repsysid = Function.GetGUID();
                    goodhis.workgroup = repairstock.workgroup;
                    goodhis.step = repairstock.step;
                    goodhis.reptype = MES_RepairType.RepairSuccess.ToString();
                    goodhis.customerid = repairstock.customerid;
                    goodhis.custorderno = repairstock.custorderno;
                    goodhis.styleno = repairstock.styleno;
                    goodhis.color = repairstock.color;
                    goodhis.size = repairstock.size;
                    goodhis.checktype = repairstock.checktype;
                    goodhis.pairqty = repairstock.ttlpairgoodqty;
                    goodhis.claimtime = Function.GetCurrentTime();
                    goodhis.claimuser = CurrentContextInfo.CurrentUser;
                    if (jointtype != null && signature != null)
                    {
                        goodhis.jointtype = jointtype;
                        goodhis.signature = signature;
                    }
                    repairHisDal.DoInsert(goodhis);
                }
                tinprepairhis badhis = new tinprepairhis();
                if (repairstock.ttlbadqty > 0)
                {
                    badhis.repsysid = Function.GetGUID();
                    badhis.workgroup = repairstock.workgroup;
                    badhis.step = repairstock.step;
                    badhis.reptype = MES_RepairType.RepairFail.ToString();
                    badhis.customerid = repairstock.customerid;
                    badhis.custorderno = repairstock.custorderno;
                    badhis.styleno = repairstock.styleno;
                    badhis.color = repairstock.color;
                    badhis.size = repairstock.size;
                    badhis.checktype = repairstock.checktype;
                    badhis.pairqty = repairstock.ttlbadqty;
                    badhis.claimtime = Function.GetCurrentTime();
                    badhis.claimuser = CurrentContextInfo.CurrentUser;
                    repairHisDal.DoInsert(badhis);

                    foreach (tinprepairfail repairfail in lstreasoncode)
                    {
                        repairfail.repsysid = badhis.repsysid;
                        repairFailDal.DoInsert(repairfail);
                    }
                }
                #endregion

                List<MESParameterInfo> lstParams = new List<MESParameterInfo>() {
                            new MESParameterInfo(){ParamName="customerid",ParamValue=repairstock.customerid},
                            new MESParameterInfo(){ParamName="custorderno",ParamValue=repairstock.custorderno},
                            new MESParameterInfo(){ParamName="styleno",ParamValue=repairstock.styleno},
                            new MESParameterInfo(){ParamName="color",ParamValue=repairstock.color},
                            new MESParameterInfo(){ParamName="size",ParamValue=repairstock.size},
                            new MESParameterInfo(){ParamName="checktype",ParamValue=repairstock.checktype},
                            new MESParameterInfo(){ParamName="step",ParamValue=repairstock.step},
                            new MESParameterInfo(){ParamName="workgroup",ParamValue=repairstock.workgroup}
                        };

                List<tinprepairstock> lstRepairStock = baseDal.GetSelectedObjects<tinprepairstock>(lstParams, string.Empty, true, -1);
                if (lstRepairStock.Count > 0)
                {
                    tinprepairstock rsk = lstRepairStock[0];
                    rsk.curpairqty = rsk.curpairqty - repairstock.ttlpairgoodqty - repairstock.ttlbadqty;
                    rsk.ttlbadqty = rsk.ttlbadqty + repairstock.ttlbadqty;
                    rsk.ttlpairgoodqty = rsk.ttlpairgoodqty + repairstock.ttlpairgoodqty;
                    rsk.lastupdatetime = Function.GetCurrentTime();
                    baseDal.DoUpdate(rsk);
                }

                #region Update WIP
                wipDal.SaveOrUpdate(repairstock.customerid, repairstock.custorderno, repairstock.styleno, repairstock.color, repairstock.size, repairstock.step, repairstock.workgroup, Convert.ToInt16(repairstock.ttlpairgoodqty), repairstock.checktype);
                wipDal.SaveOrUpdate(repairstock.customerid, repairstock.custorderno, repairstock.styleno, repairstock.color, repairstock.size, MES_WIPStatus.BAD.ToString(), MES_Misc.BadStock.ToString(), Convert.ToInt16(repairstock.ttlbadqty), repairstock.checktype);
                wipDal.SaveOrUpdate(repairstock.customerid, repairstock.custorderno, repairstock.styleno, repairstock.color, repairstock.size, MES_WIPStatus.Repair.ToString(), repairstock.workgroup, -Convert.ToInt16(repairstock.ttlpairgoodqty + repairstock.ttlbadqty), repairstock.checktype);
                #endregion

                #region Update CustomerOrder History
                string eventgroup = Function.GetGUID();
                if (goodhis.pairqty > 0)
                {
                    tinpcustorderhistory goodhistory = new tinpcustorderhistory();
                    goodhistory.customerid = goodhis.customerid;
                    goodhistory.cartonno = "";
                    goodhistory.cartonqty = 0;
                    goodhistory.custorderno = goodhis.custorderno;
                    goodhistory.size = goodhis.size;
                    goodhistory.styleno = goodhis.styleno;
                    goodhistory.color = goodhis.color;
                    goodhistory.eventgroup = eventgroup;
                    goodhistory.eventname = "Repair";
                    goodhistory.pairqty = goodhis.pairqty;
                    goodhistory.refsysid = goodhis.repsysid;
                    goodhistory.remark = "";

                    goodhistory.eventtime = Function.GetCurrentTime();
                    goodhistory.eventuser = CurrentContextInfo.CurrentUser;
                    goodhistory.ohsysid = Function.GetGUID();
                    goodhistory.shift = CurrentContextInfo.Shift;
                    goodhistory.workgroup = CurrentContextInfo.WorkGroup;

                    custOrderHistoryDal.DoInsert<tinpcustorderhistory>(goodhistory);
                }

                if (badhis.pairqty > 0)
                {
                    tinpcustorderhistory badhistory = new tinpcustorderhistory();
                    badhistory.customerid = badhis.customerid;
                    badhistory.cartonno = "";
                    badhistory.cartonqty = 0;
                    badhistory.custorderno = badhis.custorderno;
                    badhistory.size = badhis.size;
                    badhistory.styleno = badhis.styleno;
                    badhistory.color = badhis.color;
                    badhistory.eventgroup = eventgroup;
                    badhistory.eventname = "Repair";
                    badhistory.pairqty = badhis.pairqty;
                    badhistory.refsysid = badhis.repsysid;
                    badhistory.remark = "";

                    badhistory.eventtime = Function.GetCurrentTime();
                    badhistory.eventuser = CurrentContextInfo.CurrentUser;
                    badhistory.ohsysid = Function.GetGUID();
                    badhistory.shift = CurrentContextInfo.Shift;
                    badhistory.workgroup = CurrentContextInfo.WorkGroup;

                    custOrderHistoryDal.DoInsert<tinpcustorderhistory>(badhistory);
                }

                #endregion
                dbInstance.Commit();
            }
            catch (Exception ex)
            {
                dbInstance.Rollback();
                throw ex;
            }
            finally
            {
                dbInstance.CloseConnection();
            }
        }
Exemple #6
0
 private void ucToolbar1_RepairEventHandler(object sender, EventArgs e)
 {
     if (this.grdQuery.ActiveRow != null)
     {
         frmRepair f = new frmRepair();
         tinprepairstock repairstock = new tinprepairstock();
         repairstock.customerid = this.grdQuery.ActiveRow.Cells["customerid"].Value.ToString();
         repairstock.custorderno = this.grdQuery.ActiveRow.Cells["custorderno"].Value.ToString();
         repairstock.styleno = this.grdQuery.ActiveRow.Cells["styleno"].Value.ToString();
         repairstock.size = this.grdQuery.ActiveRow.Cells["size"].Value.ToString();
         repairstock.color = this.grdQuery.ActiveRow.Cells["color"].Value.ToString();
         repairstock.checktype = this.grdQuery.ActiveRow.Cells["checktype"].Value.ToString();
         repairstock.curpairqty = Convert.ToInt16(this.grdQuery.ActiveRow.Cells["curpairqty"].Value.ToString());
         repairstock.step = this.grdQuery.ActiveRow.Cells["step"].Value.ToString();
         repairstock.workgroup = this.grdQuery.ActiveRow.Cells["workgroup"].Value.ToString();
         f.Customer = this.grdQuery.ActiveRow.Cells["customername"].Value.ToString();
         f.RepairStock = repairstock;
         f.ShowDialog();
         RefreshGrid();
     }
 }
Exemple #7
0
 public void DoRepairBack(ContextInfo contextInfo, tinprepairstock repairstock, List<tinprepairfail> lstreasoncode, string jointtype, string signature)
 {
     contextInfo.Action = MES_ActionType.Insert;
     RepairStockBll bll = new RepairStockBll(contextInfo);
     bll.CallAccessControl();
     bll.DoRepairBack(repairstock, lstreasoncode, jointtype, signature);
     GC.Collect();
 }