예제 #1
0
파일: IQCBll.cs 프로젝트: jimidzj/Inspect
        public void DoInsertIQC(tinpiqc iqc,List<tinpiqcfail> lstFail, List<tinpiqcreturn> lstReturn)
        {
            IQCDal iqcDal = new IQCDal(dbInstance);

            CustOrderHistoryBll historyBll = new CustOrderHistoryBll(dbInstance, CurrentContextInfo);
            string eventGroup = Function.GetGUID();

            try
            {
                dbInstance.BeginTransaction();

                iqcDal.DoInsert<tinpiqc>(iqc);

                for (int i = 0; i < lstFail.Count; i++)
                {
                    iqcDal.DoInsert<tinpiqcfail>(lstFail[i]);
                }

                for (int i = 0; i < lstReturn.Count; i++)
                {
                    iqcDal.DoInsert<tinpiqcreturn>(lstReturn[i]);
                    iqcDal.UpdateCartonStatus(lstReturn[i].custorderno, lstReturn[i].cartonno);

                    List<MESParameterInfo> lstParam = new List<MESParameterInfo>() {
                        new MESParameterInfo(){ParamName="custorderno",ParamValue=lstReturn[i].custorderno},
                        new MESParameterInfo(){ParamName="cartonno",ParamValue=lstReturn[i].cartonno}
                    };
                    List<tinpreceivingctndtl> ctlDtl = baseDal.GetSelectedObjects<tinpreceivingctndtl>(lstParam);

                    if (ctlDtl.Count > 0)
                    {
                        historyBll.WriteHistory("IQCReturn", eventGroup,iqc.customerid, lstReturn[i].custorderno,
                                    lstReturn[i].cartonno, ctlDtl[0].styleno, ctlDtl[0].color,
                                    ctlDtl[0].size, 1, ctlDtl[0].pairqty, iqc.iqcsysid,
                                    iqc.remark);
                    }
                    else
                    {
                        historyBll.WriteHistory("IQCReturn", eventGroup,iqc.customerid, lstReturn[i].custorderno,
                                    lstReturn[i].cartonno, string.Empty, string.Empty,
                                    string.Empty, 1, 0, iqc.iqcsysid,
                                    iqc.remark);
                    }
                }

                dbInstance.Commit();
            }
            catch (Exception ex)
            {
                dbInstance.Rollback();
                throw ex;
            }
            finally
            {
                dbInstance.CloseConnection();
            }
        }
예제 #2
0
 /// <summary>
 /// Create a new tinpiqc object.
 /// </summary>
 /// <param name="iqcsysid">Initial value of the iqcsysid property.</param>
 /// <param name="customerid">Initial value of the customerid property.</param>
 /// <param name="styleno">Initial value of the styleno property.</param>
 /// <param name="bootheight">Initial value of the bootheight property.</param>
 public static tinpiqc Createtinpiqc(global::System.String iqcsysid, global::System.String customerid, global::System.String styleno, global::System.Decimal bootheight)
 {
     tinpiqc tinpiqc = new tinpiqc();
     tinpiqc.iqcsysid = iqcsysid;
     tinpiqc.customerid = customerid;
     tinpiqc.styleno = styleno;
     tinpiqc.bootheight = bootheight;
     return tinpiqc;
 }
예제 #3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the tinpiqc EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddTotinpiqc(tinpiqc tinpiqc)
 {
     base.AddObject("tinpiqc", tinpiqc);
 }
예제 #4
0
 public void DoInsertIQC(ContextInfo contextInfo, tinpiqc iqc, 
     List<tinpiqcfail> lstFail,List<tinpiqcreturn> lstReturn)
 {
     contextInfo.Action = MES_ActionType.Insert;
     IQCBll bll = new IQCBll(contextInfo);
     bll.CallAccessControl();
     bll.DoInsertIQC(iqc, lstFail, lstReturn);
     GC.Collect();
 }