Ejemplo n.º 1
0
        public QC_HF_ChangeLogModelList GetModelList(string qualityCode)
        {
            QC_HF_ChangeLogTable table = new QC_HF_ChangeLogTable();
            SelectSqlSection     sql   = DataAccess.DefaultDB.Select(table, table.AllColumns());

            if (qualityCode != "")
            {
                sql.Where(table.QUALITY_CODE == qualityCode);
            }
            using (SafeDataReader sdr = new SafeDataReader(sql.ToDataReader()))
            {
                QC_HF_ChangeLogModelList result = new QC_HF_ChangeLogModelList();
                while (sdr.Read())
                {
                    QC_HF_ChangeLogModel m = new QC_HF_ChangeLogModel();
                    m.QualityCode    = sdr.GetString(table.QUALITY_CODE);
                    m.QC_Ref_PPO_Old = sdr.GetString(table.QC_Ref_PPO_Old);
                    m.QC_Ref_GP_Old  = sdr.GetString(table.QC_Ref_GP_Old);
                    m.HF_Ref_PPO_Old = sdr.GetString(table.HF_Ref_PPO_Old);
                    m.HF_Ref_GP_Old  = sdr.GetString(table.HF_Ref_GP_Old);
                    m.QC_Ref_PPO_New = sdr.GetString(table.QC_Ref_PPO_New);
                    m.QC_Ref_GP_New  = sdr.GetString(table.QC_Ref_GP_New);
                    m.HF_Ref_PPO_New = sdr.GetString(table.HF_Ref_PPO_New);
                    m.HF_Ref_GP_New  = sdr.GetString(table.HF_Ref_GP_New);
                    m.CreateDate     = sdr.GetDateTime(table.CREATE_DATE);
                    m.Creator        = sdr.GetString(table.CREATOR);

                    result.Add(m);
                }
                return(result);
            }
        }
Ejemplo n.º 2
0
        //public QC_HF_ChangeLogModelList GetModelListByAttC(QC_HF_ChangeLogModel model)
        //{
        //    QC_HF_ChangeLogTable table = new QC_HF_ChangeLogTable();
        //    SelectSqlSection sql = DataAccess.DefaultDB.Select(table, table.AllColumns());
        //    sql.Where(table.Sourcing == model.Sourcing)
        //        .Where(table.MaterialGroup == model.MaterialGroup);

        //    sql.Where(table.AfGmmm == model.AfGmmm);


        //    sql.Where(table.BfGmmm == model.BfGmmm);

        //    if (!string.IsNullOrEmpty(model.Status))
        //    {

        //        sql.Where(table.Status == model.Status);
        //    }

        //    if (model.DyeMethod == "")
        //    {
        //        sql.Where(table.DyeMethod == null || table.DyeMethod == "" || table.DyeMethod == " ");
        //    }
        //    else
        //    {
        //        sql.Where(table.DyeMethod == model.DyeMethod);
        //    }
        //    if (model.Pattern == "")
        //    {
        //        sql.Where(table.Pattern == null || table.Pattern == "" || table.Pattern == " ");
        //    }
        //    else
        //    {
        //        sql.Where(table.Pattern == model.Pattern);
        //    }
        //    if (model.ShrinkageTestingMethod == "")
        //    {
        //        sql.Where(table.ShrinkageTestingMethod == null || table.ShrinkageTestingMethod == "" || table.ShrinkageTestingMethod == " ");
        //    }
        //    else
        //    {
        //        sql.Where(table.ShrinkageTestingMethod == model.ShrinkageTestingMethod);
        //    }
        //    if (model.GmtWashing == "")
        //    {
        //        sql.Where(table.GmtWashing == null || table.GmtWashing == "" || table.GmtWashing == " ");
        //    }
        //    else
        //    {
        //        sql.Where(table.GmtWashing == model.GmtWashing);
        //    }
        //    if (model.Shrinkage == "")
        //    {
        //        sql.Where(table.Shrinkage == null || table.Shrinkage == "" || table.Shrinkage == " ");
        //    }
        //    else
        //    {
        //        sql.Where(table.Shrinkage == model.Shrinkage);
        //    }
        //    using (SafeDataReader sdr = new SafeDataReader(sql.ToDataReader()))
        //    {
        //        QC_HF_ChangeLogModelList result = new QC_HF_ChangeLogModelList();
        //        while (sdr.Read())
        //        {
        //            QC_HF_ChangeLogModel m = new QC_HF_ChangeLogModel();
        //            m.QualityCode = sdr.GetString(table.QUALITY_CODE);
        //            result.Add(m);
        //        }
        //        return result;
        //    }
        //}

        //public QC_HF_ChangeLogModelList GetModelListOne(QC_HF_ChangeLogModel model)
        //{

        //    string Sql1 = "SELECT * " +
        //     " FROM (SELECT ROWNUM as Items, E.* " +
        //      "  FROM (SELECT DISTINCT A.* " +
        //        "  FROM QC_HF_ChangeLog A " +
        //              " LEFT JOIN QCConstructionDtl B " +
        //                "  ON A.Quality_Code = B.Quality_Code " +
        //             "  LEFT JOIN QCFinishDtl C " +
        //                "  ON A.Quality_COde = C.Quality_Code " +
        //              " LEFT JOIN QCCustomerLibrary D " +
        //                "  ON D.Quality_Code = A.Quality_Code " +
        //              " LEFT JOIN QCCustomerLibrary F " +
        //              "    ON F.Quality_Code=A.Quality_Code " +
        //                "  where @Condition order by A.Quality_Code asc ) E) " +
        //     "  WHERE @PageSize";

        //    //"select CUSTOMER_CD||'<|>'||NAME as CU from gen_customer where (CUSTOMER_CD like (UPPER(@Name)||'%') or NAME like (UPPER(@Name)||'%') ) and rownum<51 order by NAME asc"

        //    string Sql2 = " SELECT count( DISTINCT A.Quality_Code) " +
        //        "  FROM QC_HF_ChangeLog A " +
        //             "  LEFT JOIN QCConstructionDtl B " +
        //               "   ON A.Quality_Code = B.Quality_Code " +
        //             "  LEFT JOIN QCFinishDtl C " +
        //                 " ON A.Quality_COde = C.Quality_Code " +
        //             "  LEFT JOIN QCCustomerLibrary D " +
        //                "  ON D.Quality_Code = A.Quality_Code " +
        //              " LEFT JOIN QCCustomerLibrary F " +
        //              "    ON F.Quality_Code=A.Quality_Code where @Condition order by A.Quality_Code asc";

        //    int flag = 0;
        //    // SelectSqlSection sql = DataAccess.DefaultDB.Select(table, table.AllColumns().Distinct);


        //    // 添加查询条件
        //    StringBuilder sb = new StringBuilder("");
        //    if (model.Pattern != "" && model.Pattern != null)
        //    {
        //        sb.Append("UPPER(A.Pattern)=@Pattern");
        //        flag++;
        //    }
        //    if (model.CreateDate != null && model.CreateDate != DateTime.MinValue)
        //    {
        //        if (flag == 0)
        //            sb.Append("A.Create_Date>=@CreateTime");
        //        else
        //            sb.Append(" and A.Create_Date>=@CreateTime");
        //        flag++;

        //    }

        //    if (model.Creator != "" && model.Creator != null)
        //    {
        //        if (flag == 0)
        //            sb.Append("upper(A.Creator)=@Creator");
        //        else
        //            sb.Append("and upper(A.Creator)=@Creator");
        //        flag++;
        //    }
        //    if (model.BfGmmm != null && model.BfGmmm != 0)
        //    {
        //        if (flag == 0) sb.Append("A.BF_GMMM=@BfGmmm");
        //        else
        //            sb.Append(" and A.BF_GMMM=@BfGmmm");
        //        flag++;
        //    }
        //    if (model.AfGmmm != null && model.AfGmmm != 0)
        //    {
        //        if (flag == 0)
        //            sb.Append("A.AF_GMMM=@AfGmmm");
        //        else
        //            sb.Append(" and A.AF_GMMM=@AfGmmm");
        //        flag++;
        //    }
        //    if (model.Status != "" && model.Status != null)
        //    {
        //        if (flag == 0)
        //            sb.Append("UPPER(A.Status)=@Status");
        //        else
        //            sb.Append(" and UPPER(A.Status)=@Status");
        //        flag++;
        //    }
        //    if (model.CustomerQaulityId != "" && model.CustomerQaulityId != null)
        //    {
        //        if (flag == 0)
        //            sb.Append("UPPER(F.Customer_Quality_ID)=@CustomerQualityId");
        //        else
        //            sb.Append(" and UPPER(F.Customer_Quality_ID)=@CustomerQualityId");
        //        flag++;
        //    }
        //    if (model.Sourcing != "" && model.Sourcing != null)
        //    {
        //        if (flag == 0)
        //            sb.Append("UPPER(A.Sourcing)=@Sourcing");
        //        else
        //            sb.Append(" and UPPER(A.Sourcing)=@Sourcing");
        //        flag++;
        //    }
        //    if (model.MaterialGroup != "" && model.MaterialGroup != null)
        //    {
        //        if (flag == 0)
        //            sb.Append("UPPER(A.Material_Group)=@MaterialGroup");
        //        else
        //            sb.Append(" and UPPER(A.Material_Group)=@MaterialGroup");
        //        flag++;
        //    }

        //    if (model.QualityCode != "" && model.QualityCode != null)
        //    {
        //        if (flag == 0)
        //            sb.Append("UPPER(A.Quality_Code)=@QualityCode");
        //        else
        //            sb.Append(" and UPPER(A.Quality_Code)=@QualityCode");
        //        flag++;
        //    }
        //    if (model.DyeMethod != "" && model.DyeMethod != null)
        //    {
        //        if (flag == 0)
        //            sb.Append("UPPER(A.Dye_Method)=@DyeMethod");
        //        else
        //            sb.Append(" and UPPER(A.Dye_Method)=@DyeMethod");
        //        flag++;
        //    }
        //    if (model.Sales != "" && model.Sales != null)
        //    {
        //        if (flag == 0)
        //            sb.Append("upper(D.Sales)=@Salesed");
        //        else
        //            sb.Append(" and upper(D.Sales)=@Salesed");
        //        flag++;
        //    }

        //    if (model.SalesTeam != "" && model.SalesTeam != null)
        //    {
        //        if (flag == 0)
        //            sb.Append("UPPER(D.Sales_Group)=@SalesTeam");
        //        else
        //            sb.Append(" and UPPER(D.Sales_Group)=@SalesTeam");
        //        flag++;
        //    }

        //    if (model.Construction != "" && model.Construction != null)
        //    {
        //        if (flag == 0)
        //            sb.Append("UPPER(B.Construction)=@Construction");
        //        else
        //            sb.Append(" and UPPER(B.Construction)=@Construction");
        //        flag++;
        //    }

        //    if (model.Finishing != "" && model.Finishing != null)
        //    {
        //        if (flag == 0)
        //            sb.Append("UPPER(C.Finishing_Code)=@Finishing");
        //        else
        //            sb.Append(" and UPPER(C.Finishing_Code)=@Finishing");
        //        flag++;
        //    }
        //    // 添加对customer条件的判断 by LYH 2014/2/25
        //    if (model.CustomerCode != "" && model.CustomerCode != null)
        //    {
        //        if (flag == 0)
        //            sb.Append("UPPER(D.BUYER_ID) = @CustomerCode");
        //        else
        //            sb.Append(" and UPPER(D.BUYER_ID) = @CustomerCode");
        //        flag++;
        //    }

        //    QC_HF_ChangeLogModelList result = new QC_HF_ChangeLogModelList();
        //    if (flag == 0)
        //        return result;
        //    Sql1 = Sql1.Replace("@Condition", sb.ToString());
        //    Sql1 = Sql1.Replace("@PageSize", "Items>" + ((model.StartPage - 1) * model.PageSize) + " and Items<=" + (model.StartPage * model.PageSize));
        //    Sql2 = Sql2.Replace("@Condition", sb.ToString());

        //    CustomSqlSection csql1 = DataAccess.DefaultDB.CustomSql(Sql1);

        //    CustomSqlSection csql2 = DataAccess.DefaultDB.CustomSql(Sql2);

        //    // 对查询参数赋值

        //    string tempSql = sb.ToString();
        //    if (tempSql.Contains("@AfGmmm"))
        //    {
        //        csql1.AddInputParameter("AfGmmm", DbType.Int32, model.AfGmmm);
        //        csql2.AddInputParameter("AfGmmm", DbType.Int32, model.AfGmmm);
        //    }
        //    if (tempSql.Contains("@CreateTime"))
        //    {
        //        csql1.AddInputParameter("CreateTime", DbType.DateTime, model.CreateDate);
        //        csql2.AddInputParameter("CreateTime", DbType.DateTime, model.CreateDate);
        //    }
        //    if (tempSql.Contains("@BfGmmm"))
        //    {
        //        csql1.AddInputParameter("BfGmmm", DbType.Int32, model.BfGmmm);
        //        csql2.AddInputParameter("BfGmmm", DbType.Int32, model.BfGmmm);
        //    }
        //    if (tempSql.Contains("@Pattern"))
        //    {
        //        csql1.AddInputParameter("Pattern", DbType.String, model.Pattern.ToUpper());
        //        csql2.AddInputParameter("Pattern", DbType.String, model.Pattern.ToUpper());
        //    }
        //    if (tempSql.Contains("@Status"))
        //    {
        //        csql1.AddInputParameter("Status", DbType.String, model.Status.ToUpper());
        //        csql2.AddInputParameter("Status", DbType.String, model.Status.ToUpper());
        //    }
        //    if (tempSql.Contains("@Sourcing"))
        //    {
        //        csql1.AddInputParameter("Sourcing", DbType.String, model.Sourcing.ToUpper());
        //        csql2.AddInputParameter("Sourcing", DbType.String, model.Sourcing.ToUpper());
        //    }
        //    if (tempSql.Contains("@CustomerQualityId"))
        //    {
        //        csql1.AddInputParameter("CustomerQualityId", DbType.String, model.CustomerQaulityId.ToUpper());
        //        csql2.AddInputParameter("CustomerQualityId", DbType.String, model.CustomerQaulityId.ToUpper());
        //    }
        //    if (tempSql.Contains("@MaterialGroup"))
        //    {
        //        csql1.AddInputParameter("MaterialGroup", DbType.String, model.MaterialGroup.ToUpper());
        //        csql2.AddInputParameter("MaterialGroup", DbType.String, model.MaterialGroup.ToUpper());
        //    }
        //    if (tempSql.Contains("@QualityCode"))
        //    {
        //        csql1.AddInputParameter("QualityCode", DbType.String, model.QualityCode.ToUpper());
        //        csql2.AddInputParameter("QualityCode", DbType.String, model.QualityCode.ToUpper());
        //    }
        //    if (tempSql.Contains("@Creator"))
        //    {
        //        csql1.AddInputParameter("Creator", DbType.String, model.Creator.ToUpper());
        //        csql2.AddInputParameter("Creator", DbType.String, model.Creator.ToUpper());
        //    }
        //    if (tempSql.Contains("@DyeMethod"))
        //    {
        //        csql1.AddInputParameter("DyeMethod", DbType.String, model.DyeMethod.ToUpper());
        //        csql2.AddInputParameter("DyeMethod", DbType.String, model.DyeMethod.ToUpper());
        //    }
        //    if (tempSql.Contains("@Salesed"))
        //    {
        //        csql1.AddInputParameter("Salesed", DbType.String, model.Sales.ToUpper());
        //        csql2.AddInputParameter("Salesed", DbType.String, model.Sales.ToUpper());
        //    }
        //    if (tempSql.Contains("@SalesTeam"))
        //    {
        //        csql1.AddInputParameter("SalesTeam", DbType.String, model.SalesTeam.ToUpper());
        //        csql2.AddInputParameter("SalesTeam", DbType.String, model.SalesTeam.ToUpper());
        //    }
        //    if (tempSql.Contains("@Construction"))
        //    {
        //        csql1.AddInputParameter("Construction", DbType.String, model.Construction.ToUpper());
        //        csql2.AddInputParameter("Construction", DbType.String, model.Construction.ToUpper());
        //    }
        //    if (tempSql.Contains("@Finishing"))
        //    {
        //        csql1.AddInputParameter("Finishing", DbType.String, model.Finishing.ToUpper());
        //        csql2.AddInputParameter("Finishing", DbType.String, model.Finishing.ToUpper());
        //    }
        //    // 添加对customer条件的判断 by LYH 2014/2/25
        //    if (tempSql.Contains("@CustomerCode"))
        //    {
        //        csql1.AddInputParameter("CustomerCode", DbType.String, model.CustomerCode.ToUpper());
        //        csql2.AddInputParameter("CustomerCode", DbType.String, model.CustomerCode.ToUpper());
        //    }

        //    //  int count = TableMapModel.SetRangeSql(ref sql, table, table.QualityCode, model.StartPage, model.PageSize, model.OrderByField);
        //    int count = csql2.ToScalar<int>();
        //    QC_HF_ChangeLogTable table = new QC_HF_ChangeLogTable();

        //    QcconstructiondtlManager qcm = new QcconstructiondtlManager();
        //    QcfinishdtlManager qsm = new QcfinishdtlManager();
        //    QccustomerlibraryManager qlm = new QccustomerlibraryManager();
        //    QcconstructiondtlModelList qcml = new QcconstructiondtlModelList();
        //    QcfinishdtlModelList qsml = new QcfinishdtlModelList();
        //    QccustomerlibraryModelList qclm = new QccustomerlibraryModelList();
        //    QcavailablewidthModelList qsaw = new QcavailablewidthModelList();
        //    QcavailablewidthManager qcam = new QcavailablewidthManager();
        //    QcyarndtlManager qym = new QcyarndtlManager();
        //    QcyarndtlModelList qyml = new QcyarndtlModelList();
        //    DataSet ds;
        //    CustomSqlSection css;
        //    DataTable dt;
        //    using (SafeDataReader sdr = new SafeDataReader(csql1.ToDataReader()))
        //    {

        //        while (sdr.Read())
        //        {
        //            QC_HF_ChangeLogModel m = new QC_HF_ChangeLogModel();
        //            m.GridRowCount = count;
        //            m.QualityCode = sdr.GetString(table.QualityCode);


        //            qcml = qcm.GetModelListOne(new QcconstructiondtlModel() { QualityCode = m.QualityCode });
        //            for (int i = 0; i < qcml.Count; i++)
        //            {
        //                m.Construction = m.Construction + qcml[i].Construction + ";";
        //            }

        //            qsml = qsm.GetModelListOne(new QcfinishdtlModel() { QualityCode = m.QualityCode });
        //            for (int i = 0; i < qsml.Count; i++)
        //            {
        //                m.Finishing = m.Finishing + qsml[i].FinishingCode + ";";
        //            }

        //            qclm = qlm.GetModelList(new QccustomerlibraryModel() { QualityCode = m.QualityCode });
        //            for (int i = 0; i < qclm.Count; i++)
        //            {
        //                m.CustomerQualityId = m.CustomerQualityId + qclm[i].CustomerQualityId + ";";
        //                m.BuyserIds = m.BuyserIds + qclm[i].BuyerId + ";";
        //                m.Brank = m.Brank + qclm[i].Brand + ";";
        //                m.MillComments = m.MillComments + qclm[i].MillComments + ";";
        //            }
        //            qsaw = qcam.GetModelList(new QcavailablewidthModel() { QualityCode = m.QualityCode });
        //            for (int i = 0; i < qsaw.Count; i++)
        //            {
        //                if (i != qsaw.Count - 1)
        //                    m.AvaWidth = m.AvaWidth + string.Format("{0}G{1}Inch/{2}N/{3}-{4}\"", qsaw[i].Gauge, qsaw[i].Diameter, qsaw[i].TotalNeedles, qsaw[i].Width, qsaw[i].MaxWidth) + "--";
        //                else
        //                    m.AvaWidth = m.AvaWidth + string.Format("{0}G{1}Inch/{2}N/{3}-{4}\"", qsaw[i].Gauge, qsaw[i].Diameter, qsaw[i].TotalNeedles, qsaw[i].Width, qsaw[i].MaxWidth);
        //            }
        //            qyml = qym.GetModelList(new QcyarndtlModel() { QualityCode = m.QualityCode });
        //            for (int i = 0; i < qyml.Count; i++)
        //            {
        //                if (i != qyml.Count - 1)
        //                    m.YarnInfo = m.YarnInfo + string.Format("{0}X{1} {2} {3}% {4}", qyml[i].YarnCount, qyml[i].Threads, qyml[i].YarnType, qyml[i].YarnRatio, qyml[i].YarnComponent) + "--";
        //                else
        //                    m.YarnInfo = m.YarnInfo + string.Format("{0}X{1} {2} {3}% {4}", qyml[i].YarnCount, qyml[i].Threads, qyml[i].YarnType, qyml[i].YarnRatio, qyml[i].YarnComponent);
        //            }

        //            //by mengjw 2015-08-04
        //            //原来
        //            //css= DataAccess.DefaultDB.CustomSql("SELECT distinct pi.ppo_no as PPO,pi.FABRIC_TYPE_CD  "+
        //            //  "FROM ppo_hd ph,gen_customer c,ppo_QC_HF_ChangeLog qc, ppo_item pi, fab_combo fc, ppo_qccomment qcc,ppo_item_combo pic,QC_HF_ChangeLog qm  "+
        //            //  " WHERE ph.ppo_no=pi.ppo_no and  fc.fab_combo_id = qcc.fab_combo_id and qc.ppo_item_id=pi.ppo_item_id and pi.ppo_item_id=pic.ppo_item_id and pi.quality_code=qm.quality_code and "+
        //            //  " pic.fab_combo_id=fc.fab_combo_id and qc.ppo_qc_id=qcc.ppo_qc_id and ph.customer_cd=c.customer_cd and qm.Status='Approved' and QCC.STATUS='Approved' and qm.quality_code=@QC ");
        //            //改为
        //            css = DataAccess.DefaultDB.CustomSql("SELECT distinct pi.ppo_no as PPO,pi.FABRIC_TYPE_CD  " +
        //             "FROM ppo_hd ph,gen_customer c,ppo_QC_HF_ChangeLog qc, ppo_item pi, fab_combo fc, ppo_qccomment qcc,ppo_item_combo pic,QC_HF_ChangeLog qm  " +
        //             " WHERE ph.ppo_no=pi.ppo_no and  fc.fab_combo_id = qcc.fab_combo_id and qc.ppo_item_id=pi.ppo_item_id and pi.ppo_item_id=pic.ppo_item_id and pi.quality_code=qm.quality_code and " +
        //             " pic.fab_combo_id=fc.fab_combo_id and qc.ppo_qc_id=qcc.ppo_qc_id and ph.customer_cd=c.customer_cd  and QCC.STATUS='Approved' and qm.quality_code=@QC and  rownum<=1");
        //            css.AddInputParameter("QC", DbType.String, m.QualityCode);
        //            ds = css.ToDataSet();

        //            dt = ds.Tables[0];
        //            for (int i = 0; i < dt.Rows.Count; i++)
        //            {
        //                m.ApprovedFromSPPO = m.ApprovedFromSPPO + dt.Rows[i]["PPO"].ToString() + "(" + dt.Rows[i]["FABRIC_TYPE_CD"].ToString() + ");";
        //            }

        //            m.CreateDate = sdr.GetDateTime(table.CreateDate);
        //            m.Creator = sdr.GetString(table.Creator);
        //            m.ApproveDate = sdr.GetDateTime(table.ApproveDate);
        //            m.Approver = sdr.GetString(table.Approver);
        //            m.Status = sdr.GetString(table.Status);
        //            if (m.Status == "NEW")
        //                m.Status = "New";
        //            m.Sourcing = sdr.GetString(table.Sourcing);
        //            m.MaterialGroup = sdr.GetString(table.MaterialGroup);
        //            m.AnalysisNo = sdr.GetString(table.AnalysisNo);
        //            m.RefQualityCode = sdr.GetString(table.RefQualityCode);
        //            m.Pattern = sdr.GetString(table.Pattern);
        //            m.DyeMethod = sdr.GetString(table.DyeMethod);
        //            m.ReplaceBy = sdr.GetString(table.ReplaceBy);
        //            m.Repeat = sdr.GetString(table.REPEAT);
        //            m.BfGmmm = sdr.GetInt32(table.BfGmmm);
        //            m.AfGmmm = sdr.GetInt32(table.AfGmmm);
        //            m.Shrinkage = sdr.GetString(table.Shrinkage);
        //            m.ShrinkageTestingMethod = sdr.GetString(table.ShrinkageTestingMethod);
        //            m.GmtWashing = sdr.GetString(table.GmtWashing);
        //            m.Layout = sdr.GetString(table.Layout);
        //            m.YarnLength = sdr.GetString(table.YarnLength);
        //            m.TappingType = sdr.GetString(table.TappingType);
        //            m.Measurement = sdr.GetString(table.Measurement);
        //            m.Remark = sdr.GetString(table.Remark);
        //            m.SpecialType = sdr.GetString(table.SpecialType);
        //            m.LastUpdateTime = sdr.GetDateTime(table.LastUpdateTime);
        //            m.LastUpdateBy = sdr.GetString(table.LastUpdateBy);

        //            m.GK_NO = sdr.GetString(table.GK_NO);
        //            m.QC_Ref_PPO = sdr.GetString(table.QC_Ref_PPO);
        //            m.HF_Ref_PPO = sdr.GetString(table.HF_Ref_PPO);
        //            m.QC_Ref_GP = sdr.GetString(table.QC_Ref_GP);
        //            m.HF_Ref_GP = sdr.GetString(table.HF_Ref_GP);


        //            result.Add(m);
        //        }
        //        return result;
        //    }
        //}

        public void AddModel(QC_HF_ChangeLogModel model, DbTransaction tran)
        {
            QC_HF_ChangeLogTable table     = new QC_HF_ChangeLogTable();
            InsertSqlSection     insertSql = DataAccess.DefaultDB.Insert(table);

            if (tran != null)
            {
                insertSql.SetTransaction(tran);
            }
            int iden = DataAccess.DefaultDB.CustomSql("select SEQ_NO.nextval from dual").ToScalar <int>();

            insertSql.AddColumn(table.QUALITY_CODE, model.QualityCode)
            .AddColumn(table.CREATE_DATE, model.CreateDate)
            .AddColumn(table.CREATOR, model.Creator)
            .AddColumn(table.QC_Ref_PPO_Old, model.QC_Ref_PPO_Old)
            .AddColumn(table.QC_Ref_GP_Old, model.QC_Ref_GP_Old)
            .AddColumn(table.HF_Ref_PPO_Old, model.HF_Ref_PPO_Old)
            .AddColumn(table.HF_Ref_GP_Old, model.HF_Ref_GP_Old)
            .AddColumn(table.QC_Ref_PPO_New, model.QC_Ref_PPO_New)
            .AddColumn(table.QC_Ref_GP_New, model.QC_Ref_GP_New)
            .AddColumn(table.HF_Ref_PPO_New, model.HF_Ref_PPO_New)
            .AddColumn(table.HF_Ref_GP_New, model.HF_Ref_GP_New)
            .AddColumn(table.Iden, iden)
            .Execute();
        }
Ejemplo n.º 3
0
        public void CheckModel(QC_HF_ChangeLogModel model, bool isNew)
        {
            Validator v = new Validator();

            //Check model's data here.
            if (!v.IsValid)
            {
                throw new ValidationException(v);
            }
        }
Ejemplo n.º 4
0
        public void DeleteModel(QC_HF_ChangeLogModel model, DbTransaction tran)
        {
            QC_HF_ChangeLogTable table = new QC_HF_ChangeLogTable();
            DeleteSqlSection     sql   = DataAccess.DefaultDB.Delete(table);

            if (tran != null)
            {
                sql.SetTransaction(tran);
            }
            sql.Where(table.QUALITY_CODE == model.QualityCode)
            .Execute();
        }
Ejemplo n.º 5
0
        public void UpdateModel(QC_HF_ChangeLogModel model, DbTransaction tran)
        {
            QC_HF_ChangeLogTable table = new QC_HF_ChangeLogTable();
            UpdateSqlSection     sql   = DataAccess.DefaultDB.Update(table);

            if (tran != null)
            {
                sql.SetTransaction(tran);
            }
            sql.AddColumn(table.QUALITY_CODE, model.QualityCode)
            .AddColumn(table.CREATE_DATE, model.CreateDate)
            .AddColumn(table.CREATOR, model.Creator)
            .AddColumn(table.QC_Ref_PPO_Old, model.QC_Ref_PPO_Old)
            .AddColumn(table.QC_Ref_GP_Old, model.QC_Ref_GP_Old)
            .AddColumn(table.HF_Ref_PPO_Old, model.HF_Ref_PPO_Old)
            .AddColumn(table.HF_Ref_GP_Old, model.HF_Ref_GP_Old)
            .AddColumn(table.QC_Ref_PPO_New, model.QC_Ref_PPO_New)
            .AddColumn(table.QC_Ref_GP_New, model.QC_Ref_GP_New)
            .AddColumn(table.HF_Ref_PPO_New, model.HF_Ref_PPO_New)
            .AddColumn(table.HF_Ref_GP_New, model.HF_Ref_GP_New).Where(table.QUALITY_CODE == model.QualityCode)
            .Execute();
        }