Exemplo n.º 1
0
        public override ValueObject Execute(TransactionContext trxContext, ValueObject vo)
        {
            ProductionControllerNCVCVo inVo = (ProductionControllerNCVCVo)vo;
            StringBuilder sql = new StringBuilder();
            ValueObjectList <ProductionControllerNCVCVo> voList = new ValueObjectList <ProductionControllerNCVCVo>();
            //create command
            DbCommandAdaptor sqlCommandAdapter = base.GetDbCommandAdaptor(trxContext, sql.ToString());

            //create parameter
            DbParameterList sqlParameter = sqlCommandAdapter.CreateParameterList();

            sql.Append(@"select Case When times between '06:00:00' and '23:59:00' then dates when ");
            sql.Append("times between '00:00:00' and '05:59:00' then dates+1 end datesss, model_cd,'All Line' line_cd, sum(ba_bm_brush_deform_scracth) ba_bm_brush_deform_scracth, sum(ba_bm_metal_deform_scracth) ba_bm_metal_deform_scracth,  sum(ba_bm_ba_deform) ba_bm_ba_deform, sum(ba_bm_endplay_deform_scracth) ba_bm_endplay_deform_scracth from ");

            sql.Append("(select i2.dates,i2.times,i2.model_cd,i2.line_cd, ba_bm_brush_deform_scracth, ba_bm_metal_deform_scracth, ba_bm_ba_deform, ba_bm_endplay_deform_scracth from t_ncvc_pdc_ba i2 left join (select dates, line_cd, Case when idca3 is null then idca1 else idca3 end id  from(select tblca1.dates, tblca1.line_cd, idca1, idca3  from(select line_cd, o.dates, max(o.ba_id) idca1  from t_ncvc_pdc_ba o where o.times > '06:00:00' and o.times <= '23:59:00' and o.dates >= :datefrom and o.dates <= :dateto group by o.dates, line_cd order by dates) tblca1 left join(select line_cd, (o.dates - 1) dates, max(o.ba_id) idca3  from t_ncvc_pdc_ba o  where o.times > '00:00:00' and o.times <= '05:30:00' and o.dates > :datefrom and o.dates - 1 <= :dateto group by line_cd, o.dates order by idca3) tblca3 on tblca1.dates = tblca3.dates and tblca1.line_cd = tblca3.line_cd) tbl  order by dates, line_cd) l on l.line_cd = i2.line_cd  where i2.ba_id = l.id order by i2.dates,i2.line_cd ) t where model_cd = :model_cd group by datesss,model_cd order by datesss");


            sqlParameter.AddParameterDateTime("datefrom", DateTime.Parse(inVo.DateFrom));
            sqlParameter.AddParameterDateTime("dateto", DateTime.Parse(inVo.DateTo));
            sqlParameter.AddParameterString("model_cd", inVo.ProModel);

            sqlCommandAdapter = base.GetDbCommandAdaptor(trxContext, sql.ToString());

            //execute SQL
            IDataReader dataReader = sqlCommandAdapter.ExecuteReader(trxContext, sqlParameter);

            while (dataReader.Read())
            {
                ProductionControllerNCVCVo outVo = new ProductionControllerNCVCVo
                {
                    TimeHour = DateTime.Parse(dataReader["datesss"].ToString()),
                    ProModel = dataReader["model_cd"].ToString(),
                    ProLine  = dataReader["line_cd"].ToString(),

                    BA_bm_brush_deform_scracth = int.Parse(dataReader["ba_bm_brush_deform_scracth"].ToString()),
                    BA_bm_metal_deform_scracth = int.Parse(dataReader["ba_bm_metal_deform_scracth"].ToString()),
                    BA_bm_deform = int.Parse(dataReader["ba_bm_ba_deform"].ToString()),
                    BA_bm_endplay_deform_scracth = int.Parse(dataReader["ba_bm_endplay_deform_scracth"].ToString()),
                };
                voList.add(outVo);
            }
            dataReader.Close();
            return(voList);
        }
        public override ValueObject Execute(TransactionContext trxContext, ValueObject arg)
        {
            ItemProcessWorkVo inVo = (ItemProcessWorkVo)arg;

            StringBuilder sqlQuery = new StringBuilder();

            sqlQuery.Append("Insert into m_item_process_work");
            sqlQuery.Append(" ( ");
            sqlQuery.Append(" item_id, ");
            sqlQuery.Append(" process_work_id, ");
            sqlQuery.Append(" process_work_sequence, ");
            sqlQuery.Append(" is_optional_process, ");
            sqlQuery.Append(" skip_prevention_flg, ");
            sqlQuery.Append(" work_order, ");
            sqlQuery.Append(" process_flow_rule_id, ");
            sqlQuery.Append(" registration_user_cd, ");
            sqlQuery.Append(" registration_date_time, ");
            sqlQuery.Append(" factory_cd ");
            sqlQuery.Append(" ) ");
            sqlQuery.Append("VALUES	");
            sqlQuery.Append(" ( ");
            sqlQuery.Append(" :itemid ,");
            sqlQuery.Append(" :processworkid ,");
            sqlQuery.Append(" :processworkseq ,");
            sqlQuery.Append(" :optionalflg ,");
            sqlQuery.Append(" :skippreventionflg ,");
            sqlQuery.Append(" :workorder ,");
            sqlQuery.Append(" :processflowruleid ,");
            sqlQuery.Append(" :registrationusercode ,");
            sqlQuery.Append(" :registrationdatetime ,");
            sqlQuery.Append(" :factorycd ");
            sqlQuery.Append(" ); ");

            //create command
            DbCommandAdaptor sqlCommandAdapter = base.GetDbCommandAdaptor(trxContext, sqlQuery.ToString());

            //create parameter
            DbParameterList sqlParameter = sqlCommandAdapter.CreateParameterList();

            sqlParameter.AddParameterInteger("itemid", inVo.ItemId);
            sqlParameter.AddParameterInteger("processworkid", inVo.ProcessWorkId);
            sqlParameter.AddParameterInteger("processworkseq", inVo.ProcessWorkSeq);
            sqlParameter.AddParameterString("optionalflg", inVo.OptionalProcessFlag);
            sqlParameter.AddParameterString("skippreventionflg", inVo.SkipPreventionFlag);
            sqlParameter.AddParameterInteger("workorder", inVo.WorkOrder);
            sqlParameter.AddParameterInteger("processflowruleid", inVo.ProcessFlowRuleId);
            sqlParameter.AddParameterString("registrationusercode", UserData.GetUserData().UserCode);
            sqlParameter.AddParameterDateTime("registrationdatetime", trxContext.ProcessingDBDateTime);
            sqlParameter.AddParameterString("factorycd", UserData.GetUserData().FactoryCode);

            ItemProcessWorkVo outVo = new ItemProcessWorkVo {
                AffectedCount = sqlCommandAdapter.ExecuteNonQuery(sqlParameter)
            };

            return(outVo);
        }
Exemplo n.º 3
0
        public override ValueObject Execute(TransactionContext trxContext, ValueObject vo)
        {
            ProductionControllerVo inVo = (ProductionControllerVo)vo;
            StringBuilder          sql  = new StringBuilder();
            ValueObjectList <ProductionControllerVo> voList = new ValueObjectList <ProductionControllerVo>();
            //create command
            DbCommandAdaptor sqlCommandAdapter = base.GetDbCommandAdaptor(trxContext, sql.ToString());

            //create parameter
            DbParameterList sqlParameter = sqlCommandAdapter.CreateParameterList();

            sql.Append(@"select Case When times between '06:00:00' and '23:59:00' then dates when ");
            sql.Append("times between '00:00:00' and '05:59:00' then dates+1 end datesss,'LA459' model_cd,'All Line' line_cd, sum(fd_fundou_deform) fd_fundou_deform, sum(fd_ng_beat_point) fd_ng_beat_point from ");

            sql.Append("(select i2.dates,i2.times,i2.line_cd, fd_ng_beat_point, fd_fundou_deform from t_productioncontroller_output02 i2 left join (select dates, line_cd, Case when idca3 is null then idca1 else idca3 end id  from(select tblca1.dates, tblca1.line_cd, idca1, idca3  from(select line_cd, o.dates, max(o.output02_id) idca1  from t_productioncontroller_output02 o where o.times > '06:00:00' and o.times <= '23:59:00' and o.dates >= :datefrom and o.dates <= :dateto group by o.dates, line_cd order by dates) tblca1 left join(select line_cd, (o.dates - 1) dates, max(o.output02_id) idca3  from t_productioncontroller_output02 o  where o.times > '00:00:00' and o.times <= '05:30:00' and o.dates > :datefrom and o.dates - 1 <= :dateto group by line_cd, o.dates order by idca3) tblca3 on tblca1.dates = tblca3.dates and tblca1.line_cd = tblca3.line_cd) tbl  order by dates, line_cd) l on l.line_cd = i2.line_cd  where i2.output02_id = l.id order by i2.dates,i2.line_cd ) t group by datesss order by datesss");


            sqlParameter.AddParameterDateTime("datefrom", DateTime.Parse(inVo.DateFrom));
            sqlParameter.AddParameterDateTime("dateto", DateTime.Parse(inVo.DateTo));
            //sqlParameter.AddParameterString("model_cd", inVo.ProModel);

            sqlCommandAdapter = base.GetDbCommandAdaptor(trxContext, sql.ToString());

            //execute SQL
            IDataReader dataReader = sqlCommandAdapter.ExecuteReader(trxContext, sqlParameter);

            while (dataReader.Read())
            {
                ProductionControllerVo outVo = new ProductionControllerVo
                {
                    //StartDay = DateTime.Parse(dataReader["dates"].ToString()),
                    TimeHour = DateTime.Parse(dataReader["datesss"].ToString()),
                    ProModel = dataReader["model_cd"].ToString(),
                    ProLine  = dataReader["line_cd"].ToString(),

                    Fd_ng_beat_point = int.Parse(dataReader["fd_ng_beat_point"].ToString()),
                    Fd_fundou_deform = int.Parse(dataReader["fd_fundou_deform"].ToString()),
                };
                voList.add(outVo);
            }
            dataReader.Close();
            return(voList);
        }
Exemplo n.º 4
0
        public override ValueObject Execute(TransactionContext trxContext, ValueObject arg)
        {
            InspectionFormatVo inVo = (InspectionFormatVo)arg;

            StringBuilder sqlQuery = new StringBuilder();

            sqlQuery.Append("Insert into m_inspection_format");
            sqlQuery.Append(" ( ");
            sqlQuery.Append(" inspection_format_cd, ");
            sqlQuery.Append(" inspection_format_name, ");
            sqlQuery.Append(" registration_user_cd, ");
            sqlQuery.Append(" registration_date_time, ");
            sqlQuery.Append(" is_deleted, ");
            sqlQuery.Append(" factory_cd ");
            sqlQuery.Append(" ) ");
            sqlQuery.Append("VALUES	");
            sqlQuery.Append(" ( ");
            sqlQuery.Append(" :inspectionformatcd ,");
            sqlQuery.Append(" :inspectionformatname ,");
            sqlQuery.Append(" :registrationusercode ,");
            sqlQuery.Append(" :regdatetime ,");
            sqlQuery.Append(" :isdeleted, ");
            sqlQuery.Append(" :factorycode ");
            sqlQuery.Append(" ) ");
            sqlQuery.Append("RETURNING  inspection_format_id;");

            //create command
            DbCommandAdaptor sqlCommandAdapter = base.GetDbCommandAdaptor(trxContext, sqlQuery.ToString());

            //create parameter
            DbParameterList sqlParameter = sqlCommandAdapter.CreateParameterList();

            sqlParameter.AddParameterString("inspectionformatcd", inVo.InspectionFormatCode);
            sqlParameter.AddParameterString("inspectionformatname", inVo.InspectionFormatName);

            UserData userdata = trxContext.UserData;

            sqlParameter.AddParameterString("registrationusercode", userdata.UserCode);
            sqlParameter.AddParameterDateTime("regdatetime", trxContext.ProcessingDBDateTime);
            sqlParameter.AddParameterString("factorycode", userdata.FactoryCode);
            sqlParameter.AddParameterString("isdeleted", GlobalMasterDataTypeEnum.FLAG_OFF.GetValue().ToString());

            IDataReader dataReader = sqlCommandAdapter.ExecuteReader(trxContext, sqlParameter);

            InspectionFormatVo outVo = null;

            while (dataReader.Read())
            {
                outVo = new InspectionFormatVo();
                outVo.InspectionFormatId = ConvertDBNull <int>(dataReader, "inspection_format_id");
            }
            dataReader.Close();

            return(outVo);
        }
        public override ValueObject Execute(TransactionContext trxContext, ValueObject arg)
        {
            EquipmentVo inVo = (EquipmentVo)arg;

            StringBuilder sqlQuery = new StringBuilder();

            sqlQuery.Append("Insert into m_equipment");
            sqlQuery.Append(" ( ");
            sqlQuery.Append(" equipment_cd, ");
            sqlQuery.Append(" equipment_name, ");
            sqlQuery.Append(" instration_dt, ");
            sqlQuery.Append(" asset_no, ");
            sqlQuery.Append(" manufacturer, ");
            sqlQuery.Append(" model_name, ");
            sqlQuery.Append(" model_cd, ");
            sqlQuery.Append(" registration_user_cd, ");
            sqlQuery.Append(" registration_date_time, ");
            sqlQuery.Append(" factory_cd ");
            sqlQuery.Append(" ) ");
            sqlQuery.Append("VALUES	");
            sqlQuery.Append(" ( ");
            sqlQuery.Append(" :equipmentcd ,");
            sqlQuery.Append(" :equipmentname ,");
            sqlQuery.Append(" :instrationdt ,");
            sqlQuery.Append(" :assetno ,");
            sqlQuery.Append(" :manufacturer ,");
            sqlQuery.Append(" :modelname ,");
            sqlQuery.Append(" :modelcd ,");
            sqlQuery.Append(" :registrationusercd ,");
            sqlQuery.Append(" now(),");
            sqlQuery.Append(" :factorycd ");
            sqlQuery.Append(" ); ");

            //create command
            DbCommandAdaptor sqlCommandAdapter = base.GetDbCommandAdaptor(trxContext, sqlQuery.ToString());

            DbParameterList sqlParameter = sqlCommandAdapter.CreateParameterList();

            sqlParameter.AddParameterString("equipmentcd", inVo.EquipmentCode);
            sqlParameter.AddParameterString("equipmentname", inVo.EquipmentName);
            sqlParameter.AddParameterDateTime("instrationdt", inVo.InstrationDate);
            sqlParameter.AddParameterString("assetno", inVo.AssetNo);
            sqlParameter.AddParameterString("manufacturer", inVo.Manufacturer);
            sqlParameter.AddParameterString("modelname", inVo.ModelName);
            sqlParameter.AddParameterString("modelcd", inVo.ModelCode);
            sqlParameter.AddParameterString("registrationusercd", inVo.RegistrationUserCode);
            //sqlParameter.AddParameterDateTime("registrationdt", inVo.RegistrationDateTime);
            sqlParameter.AddParameterString("factorycd", inVo.FactoryCode);

            EquipmentVo outVo = new EquipmentVo {
                AffectedCount = sqlCommandAdapter.ExecuteNonQuery(sqlParameter)
            };

            return(outVo);
        }
Exemplo n.º 6
0
        public override ValueObject Execute(TransactionContext trxContext, ValueObject vo)
        {
            AssetInfoVo   inVo = (AssetInfoVo)vo;
            StringBuilder sql  = new StringBuilder();

            sql.Append(@"INSERT INTO m_asset(
            asset_no, asset_cd, asset_name, asset_model, asset_serial, asset_supplier, asset_invoice, asset_life, acquistion_date,
            acquistion_cost, asset_type, registration_user_cd, registration_date_time, factory_cd, label_status, asset_po)
            VALUES(:asset_no, :asset_cd, :asset_name, :asset_model, :asset_serial, :asset_supplier, 
            :asset_invoice, :asset_life, :acquistion_date, :acquistion_cost, :asset_type, :registration_user_cd, 
            :registration_date_time, :factory_cd, :label_status, :asset_po)");

            //CREATE SQL ADAPTER AND PARAMETER LIST
            DbCommandAdaptor sqlCommandAdapter = base.GetDbCommandAdaptor(trxContext, sql.ToString());
            DbParameterList  sqlParameter      = sqlCommandAdapter.CreateParameterList();

            sqlParameter.AddParameterInteger("asset_no", inVo.asset_no);
            sqlParameter.AddParameterString("asset_cd", inVo.asset_cd);
            sqlParameter.AddParameterString("asset_name", inVo.asset_name);
            sqlParameter.AddParameterString("asset_model", inVo.asset_model);
            sqlParameter.AddParameterString("asset_serial", inVo.asset_serial);
            sqlParameter.AddParameterString("asset_supplier", inVo.asset_supplier);
            sqlParameter.AddParameterString("asset_invoice", inVo.asset_invoice);
            sqlParameter.AddParameter("asset_life", inVo.asset_life);
            sqlParameter.AddParameterDateTime("acquistion_date", inVo.acquistion_date);
            sqlParameter.AddParameter("acquistion_cost", inVo.acquistion_cost);
            sqlParameter.AddParameterString("asset_type", inVo.asset_type);
            sqlParameter.AddParameterString("registration_user_cd", UserData.GetUserData().UserCode);
            sqlParameter.AddParameterDateTime("registration_date_time", DateTime.Now);
            sqlParameter.AddParameterString("factory_cd", UserData.GetUserData().FactoryCode);
            sqlParameter.AddParameterString("label_status", inVo.label_status);
            sqlParameter.AddParameterString("asset_po", inVo.asset_po);
            sql.Clear();

            //EXECUTE READER FROM COMMAND
            AssetMaster2019Vo outVo = new AssetMaster2019Vo
            {
                executeInt = sqlCommandAdapter.ExecuteNonQuery(sqlParameter)
            };

            return(outVo);
        }
Exemplo n.º 7
0
        public override ValueObject Execute(TransactionContext trxContext, ValueObject arg)
        {
            CustomerVo inVo = (CustomerVo)arg;

            StringBuilder sqlQuery = new StringBuilder();

            sqlQuery.Append("Insert into m_customer");
            sqlQuery.Append(" ( ");
            sqlQuery.Append(" customer_cd, ");
            sqlQuery.Append(" customer_name,");
            sqlQuery.Append(" address1, ");
            sqlQuery.Append(" address2, ");
            sqlQuery.Append(" phone_no, ");
            sqlQuery.Append(" email, ");
            sqlQuery.Append(" remarks, ");
            sqlQuery.Append(" registration_user_cd, ");
            sqlQuery.Append(" registration_date_time, ");
            sqlQuery.Append(" factory_cd");
            sqlQuery.Append(" ) ");
            sqlQuery.Append("VALUES	");
            sqlQuery.Append(" ( ");
            sqlQuery.Append(" :cucode ,");
            sqlQuery.Append(" :cuname ,");
            sqlQuery.Append(" :add1 ,");
            sqlQuery.Append(" :add2 ,");
            sqlQuery.Append(" :phno ,");
            sqlQuery.Append(" :email ,");
            sqlQuery.Append(" :rem ,");
            sqlQuery.Append(" :registrationusercode ,");
            sqlQuery.Append(" :registrationdatetime ,");
            sqlQuery.Append(" :factorycode ");
            sqlQuery.Append(" ); ");

            DbCommandAdaptor sqlCommandAdapter = base.GetDbCommandAdaptor(trxContext, sqlQuery.ToString());

            DbParameterList sqlParameter = sqlCommandAdapter.CreateParameterList();

            sqlParameter.AddParameterString("cucode", inVo.CustomerCode);
            sqlParameter.AddParameterString("cuname", inVo.CustomerName);
            sqlParameter.AddParameterString("add1", inVo.Address1);
            sqlParameter.AddParameterString("add2", inVo.Address2);
            sqlParameter.AddParameterString("email", inVo.EmailId);
            sqlParameter.AddParameterString("rem", inVo.Remarks);
            sqlParameter.AddParameterString("phno ", inVo.PhoneNo);
            sqlParameter.AddParameterString("registrationusercode ", UserData.GetUserData().UserCode);
            sqlParameter.AddParameterDateTime("registrationdatetime ", trxContext.ProcessingDBDateTime);
            sqlParameter.AddParameterString("factorycode ", UserData.GetUserData().FactoryCode);

            CustomerVo outVo = new CustomerVo {
                AffectedCount = sqlCommandAdapter.ExecuteNonQuery(sqlParameter)
            };

            return(outVo);
        }
        public override ValueObject Execute(TransactionContext trxContext, ValueObject arg)
        {
            DefectiveReasonVo inVo = (DefectiveReasonVo)arg;

            StringBuilder sqlQuery = new StringBuilder();

            sqlQuery.Append("Insert into m_defective_reason");
            sqlQuery.Append(" ( ");
            sqlQuery.Append(" defective_reason_cd, ");
            sqlQuery.Append(" defective_reason_name, ");
            sqlQuery.Append(" defective_category_id, ");
            sqlQuery.Append(" display_order, ");
            sqlQuery.Append(" registration_user_cd, ");
            sqlQuery.Append(" registration_date_time, ");
            sqlQuery.Append(" factory_cd ");
            sqlQuery.Append(" ) ");
            sqlQuery.Append("VALUES	");
            sqlQuery.Append(" ( ");
            sqlQuery.Append(" :defectivereasoncd ,");
            sqlQuery.Append(" :defectivereasonname ,");
            sqlQuery.Append(" :defectivecategoryid ,");
            sqlQuery.Append(" :displayorder,");
            sqlQuery.Append(" :registrationusercode ,");
            sqlQuery.Append(" :registrationdatetime ,");
            sqlQuery.Append(" :factorycode ");
            sqlQuery.Append(" ) ");
            sqlQuery.Append(" RETURNING defective_reason_id;");

            //create command
            DbCommandAdaptor sqlCommandAdapter = base.GetDbCommandAdaptor(trxContext, sqlQuery.ToString());

            //create parameter
            DbParameterList sqlParameter = sqlCommandAdapter.CreateParameterList();

            sqlParameter.AddParameterString("defectivereasoncd", inVo.DefectiveReasonCode);
            sqlParameter.AddParameterString("defectivereasonname", inVo.DefectiveReasonName);
            sqlParameter.AddParameterInteger("defectivecategoryid", inVo.DefectiveCategoryId);
            sqlParameter.AddParameterInteger("displayorder", inVo.DisplayOrder);
            sqlParameter.AddParameterString("registrationusercode", UserData.GetUserData().UserCode);
            sqlParameter.AddParameterDateTime("registrationdatetime", trxContext.ProcessingDBDateTime);
            sqlParameter.AddParameterString("factorycode", UserData.GetUserData().FactoryCode);

            //return outVo;
            DefectiveReasonVo outVo = new DefectiveReasonVo();

            outVo.DefectiveReasonId = (int?)sqlCommandAdapter.ExecuteScalar(sqlParameter) ?? 0;

            if (outVo != null && outVo.DefectiveReasonId > 0)
            {
                outVo.AffectedCount = 1;
            }

            return(outVo);
        }
Exemplo n.º 9
0
        public override ValueObject Execute(TransactionContext trxContext, ValueObject arg)
        {
            MoldVo inVo = (MoldVo)arg;

            StringBuilder sqlQuery = new StringBuilder();

            sqlQuery.Append("Update m_mold");
            sqlQuery.Append(" Set ");
            sqlQuery.Append(" mold_name = :moldname, ");
            sqlQuery.Append(" mold_type_id = :moldtypeid, ");
            sqlQuery.Append(" width = :width ,");
            sqlQuery.Append(" depth = :depth ,");
            sqlQuery.Append(" height = :height ,");
            sqlQuery.Append(" weight = :weight ,");
            sqlQuery.Append(" production_date_time = :pdt ,");
            sqlQuery.Append(" life_shot_count = :lfscount ,");
            sqlQuery.Append(" comment = :comment");
            sqlQuery.Append(" Where	");
            sqlQuery.Append(" mold_id = :moldid");
            sqlQuery.Append(" and factory_cd = :faccd;");

            //create command
            DbCommandAdaptor sqlCommandAdapter = base.GetDbCommandAdaptor(trxContext, sqlQuery.ToString());

            //create parameter
            DbParameterList sqlParameter = sqlCommandAdapter.CreateParameterList();

            sqlParameter.AddParameterInteger("moldid", inVo.MoldId);
            sqlParameter.AddParameterString("moldname", inVo.MoldName);
            sqlParameter.AddParameterInteger("moldtypeid", inVo.MoldTypeId);
            sqlParameter.AddParameter("width", inVo.Width);
            sqlParameter.AddParameter("depth", inVo.Depth);
            sqlParameter.AddParameter("height", inVo.Height);
            sqlParameter.AddParameter("weight", inVo.Weight);
            sqlParameter.AddParameterString("faccd", UserData.GetUserData().FactoryCode);

            if (inVo.ProductionDate != System.DateTime.MinValue)
            {
                sqlParameter.AddParameterDateTime("pdt", inVo.ProductionDate);
            }
            else
            {
                sqlParameter.AddParameter("pdt", System.DBNull.Value);
            }

            sqlParameter.AddParameter("lfscount", inVo.LifeShotCount);
            sqlParameter.AddParameterString("comment", inVo.Comment);

            MoldVo outVo = new MoldVo {
                AffectedCount = sqlCommandAdapter.ExecuteNonQuery(sqlParameter)
            };

            return(outVo);
        }
Exemplo n.º 10
0
        public override ValueObject Execute(TransactionContext trxContext, ValueObject vo)
        {
            ReportDownTimeVo inVo = (ReportDownTimeVo)vo;
            StringBuilder    sql  = new StringBuilder();

            sql.Append(@"insert into t_downtime_report(time_from,time_to,prodution_work_content_id,line_id,model_id,
                machine_id,defective_reason_id,remarks,registration_user_cd,registration_date_time,factory_cd)");
            sql.Append(@" values(:time_from,:time_to,:prodution_work_content_id,:line_id,:model_id,
                :machine_id,:defective_reason_id,:remarks,:registration_user_cd,now(),:factory_cd)");



            //create command
            DbCommandAdaptor sqlCommandAdapter = base.GetDbCommandAdaptor(trxContext, sql.ToString());

            //create parameter
            DbParameterList sqlParameter = sqlCommandAdapter.CreateParameterList();

            sqlParameter.AddParameterInteger("downtime_report_id", inVo.DowntimeReportId);
            sqlParameter.AddParameterDateTime("time_to", inVo.TimeTo);
            sqlParameter.AddParameterDateTime("time_from", inVo.TimeFrom);
            sqlParameter.AddParameterString("remarks", inVo.Remakes);

            sqlParameter.AddParameterInteger("line_id", inVo.LineId);
            sqlParameter.AddParameterInteger("machine_id", inVo.MachineId);
            sqlParameter.AddParameterInteger("model_id", inVo.ModelId);
            sqlParameter.AddParameterInteger("prodution_work_content_id", inVo.ProductionWorkContentId);
            sqlParameter.AddParameterInteger("defective_reason_id", inVo.DefectiveReasonId);

            sqlParameter.AddParameterString("registration_user_cd", inVo.RegistrationUserCode);
            sqlParameter.AddParameterString("factory_cd", inVo.FactoryCode);

            //execute SQL

            ReportDownTimeVo outVo = new ReportDownTimeVo
            {
                AffectedCount = sqlCommandAdapter.ExecuteNonQuery(sqlParameter)
            };

            return(outVo);
        }
Exemplo n.º 11
0
        public override ValueObject Execute(TransactionContext trxContext, ValueObject vo)
        {
            PersonVo      inVo = (PersonVo)vo;
            StringBuilder sql  = new StringBuilder();

            sql.Append("insert into t_productioncontroller_person(model_cd, line_cd,datetimes,factory_cd,building_cd, ");
            sql.Append("lot_numbers, leader_name, shift, plan_pro, plan_st,  actual_st, doing_co, absent_co, doing_ra,");
            sql.Append("absent_ra,doing_ca, absent_ca, doing_ba, absent_ba,doing_ma,  absent_ma, timeover,  timeoffset,  sum_timedoing, registration_user_cd )");

            sql.Append("values(:model_cd,:line_cd, :datetimes,:factory_cd,:building_cd,");
            sql.Append(":lot_numbers, :leader_name, :shift, :plan_pro,:plan_st,:actual_st,:doing_co,:absent_co,:doing_ra,");
            sql.Append(":absent_ra, :doing_ca,:absent_ca,:doing_ba, :absent_ba, :doing_ma, :absent_ma, :timeover, :timeoffset, :sum_timedoing, :registration_user_cd)");

            //create command
            DbCommandAdaptor sqlCommandAdapter = base.GetDbCommandAdaptor(trxContext, sql.ToString());

            //create parameter
            DbParameterList sqlParameter = sqlCommandAdapter.CreateParameterList();

            sqlParameter.AddParameterString("model_cd", inVo.Model);
            sqlParameter.AddParameterString("line_cd", inVo.Line);
            sqlParameter.AddParameterDateTime("datetimes", inVo.DateTimes);
            sqlParameter.AddParameterString("factory_cd", inVo.FactoryCode);
            sqlParameter.AddParameterString("building_cd", inVo.BuildingCode);
            sqlParameter.AddParameterString("lot_numbers", inVo.LotNumber);
            sqlParameter.AddParameterString("leader_name", inVo.LeaderName);
            sqlParameter.AddParameterInteger("shift", inVo.Shift);
            sqlParameter.AddParameterInteger("plan_pro", inVo.PlanPro);
            sqlParameter.AddParameter("plan_st", inVo.PlanST);
            sqlParameter.AddParameter("actual_st", inVo.ActualSt);
            sqlParameter.AddParameter("doing_co", inVo.DoCo);
            sqlParameter.AddParameter("doing_ra", inVo.DoRa);
            sqlParameter.AddParameter("doing_ca", inVo.DoCa);
            sqlParameter.AddParameter("doing_ba", inVo.DoBa);
            sqlParameter.AddParameter("doing_ma", inVo.DoMa);
            sqlParameter.AddParameter("absent_co", inVo.AbsentCo);
            sqlParameter.AddParameter("absent_ra", inVo.AbsentRa);
            sqlParameter.AddParameter("absent_ca", inVo.AbsentCa);
            sqlParameter.AddParameter("absent_ba", inVo.AbsentBa);
            sqlParameter.AddParameter("absent_ma", inVo.AbsentMa);
            sqlParameter.AddParameter("timeover", inVo.TimeOver);
            sqlParameter.AddParameter("timeoffset", inVo.TimeOffset);
            sqlParameter.AddParameter("sum_timedoing", inVo.TimeTotal);
            sqlParameter.AddParameter("registration_user_cd", inVo.RegistrationUserCode);
            //execute SQL

            PersonVo outVo = new PersonVo
            {
                AffectedCount = sqlCommandAdapter.ExecuteNonQuery(sqlParameter)
            };

            return(outVo);
        }
Exemplo n.º 12
0
        public override ValueObject Execute(TransactionContext trxContext, ValueObject arg)
        {
            MoldDetailVo inVo = (MoldDetailVo)arg;

            StringBuilder sqlQuery = new StringBuilder();

            sqlQuery.Append("Insert into m_mold_detail");
            sqlQuery.Append(" ( ");
            sqlQuery.Append("   mold_id, ");
            sqlQuery.Append("   mold_category_id, ");
            sqlQuery.Append("   life_alarm_shot_count, ");
            sqlQuery.Append("   periodic_mnt_alarm_shot_count1, ");
            sqlQuery.Append("   periodic_mnt_alarm_shot_count2, ");
            sqlQuery.Append("   periodic_mnt_alarm_shot_count3, ");
            sqlQuery.Append("   registration_user_cd, ");
            sqlQuery.Append("   registration_date_time, ");
            sqlQuery.Append("   factory_cd ) ");
            sqlQuery.Append(" values (");
            sqlQuery.Append("   :moldid , ");
            sqlQuery.Append("   :moldcategoryid , ");
            sqlQuery.Append("   :lfacount , ");
            sqlQuery.Append("   :pascount1 , ");
            sqlQuery.Append("   :pascount2 , ");
            sqlQuery.Append("   :pascount3 , ");
            sqlQuery.Append("   :registrationusercode , ");
            sqlQuery.Append("   :registrationdatetime , ");
            sqlQuery.Append("   :factorycode );  ");

            //create command
            DbCommandAdaptor sqlCommandAdapter = base.GetDbCommandAdaptor(trxContext, sqlQuery.ToString());

            //create parameter
            DbParameterList sqlParameter = sqlCommandAdapter.CreateParameterList();

            sqlParameter.AddParameterInteger("moldid", inVo.MoldId);
            sqlParameter.AddParameter("moldcategoryid", inVo.MoldCategoryId);
            sqlParameter.AddParameter("lfacount", inVo.LifeAlarmShotCount);
            sqlParameter.AddParameter("pascount1", inVo.PeriodicAlarmShotCount1);
            sqlParameter.AddParameter("pascount2", inVo.PeriodicAlarmShotCount2);
            sqlParameter.AddParameter("pascount3", inVo.PeriodicAlarmShotCount3);

            UserData userdata = trxContext.UserData;

            sqlParameter.AddParameterString("registrationusercode", userdata.UserCode);
            sqlParameter.AddParameterDateTime("registrationdatetime", trxContext.ProcessingDBDateTime);
            sqlParameter.AddParameterString("factorycode", userdata.FactoryCode);

            MoldDetailVo outVo = new MoldDetailVo {
                AffectedCount = sqlCommandAdapter.ExecuteNonQuery(sqlParameter)
            };

            return(outVo);
        }
        public override ValueObject Execute(TransactionContext trxContext, ValueObject vo)
        {
            ProductionControllerNCVCVo inVo = (ProductionControllerNCVCVo)vo;
            StringBuilder sql = new StringBuilder();
            ValueObjectList <ProductionControllerNCVCVo> voList = new ValueObjectList <ProductionControllerNCVCVo>();
            //create command
            DbCommandAdaptor sqlCommandAdapter = base.GetDbCommandAdaptor(trxContext, sql.ToString());

            //create parameter
            DbParameterList sqlParameter = sqlCommandAdapter.CreateParameterList();

            sql.Append(@"select tblout.datetimes, model_cd,h, tblout.line_cd,ba_input, output,( final_app+ en2 + en1+case_assy+ case_mg+ case_bonding+ trust_gap+ rotor+ bracket_assy +bracket_metal) sum_ng, final_app, en2, en1,case_assy, case_mg, case_bonding, trust_gap, rotor, bracket_assy ,bracket_metal
 from(select min, t.dates + min datetimes, h, fc.model_cd, t.line_cd, ba_input, output, (fc_endplay_small + fc_endplay_big + fc_shaft_scracth + fc_terminal_low + fc_case_scracth_dirty + fc_pinion_worm_ng + fc_shaft_lock + fc_ba_deform + fc_tape_hole_deform + fc_brush_rust + fc_metal_deform_scracth + fc_washer_tape_hole) final_app, (en2_insulation_resistance_ng + en2_cut_coil_wire + en2_no_load_current_hight + en2_ripple + en2_chattering + en2_lock + en2_open + en2_no_load_speed_low + en2_starting_voltage + en2_no_load_speed_high + en2_rotor_mix + en2_surge_volt_max + en2_wrong_post_of_pole + en2_err + en2_noise) en2, (en1_insulation_resistace_ng + en1_cut_coil_wire + en1_lock + en1_wareform_ma_abnormal + en1_shaft_bent + en1_ripple + en1_short + en1_chattering + en1_no_load_current_high + en1_vibration_ng + en1_open + en1_rotor_mix) en1, (ca_app_metal_dirty + ca_app_tape_hole_deform + ca_app_metal_high + ca_app_case_deform_scracth + ca_app_metal_deform_scratch + ca_app_magnet_broken) as case_assy, (ca_mg_metal_deform_scratch + ca_mg_case_deform_scratch) as case_mg, (ca_bonding_metal_deform_scratch + ca_bonding_case_deform_scracth) case_bonding, (ba_tc_endplay_big + ba_tc_endplay_small + ba_tc_brush_bent + ba_tc_shaft_mix) as trust_gap, (ba_rto_ng + ba_rto_mix) as rotor, (ba_app_metal_deform_scracth + ba_app_ba_deform + ba_app_endplate_deform_scracth + ba_app_error_other) as bracket_assy, (ba_bm_brush_deform_scracth + ba_bm_metal_deform_scracth + ba_bm_ba_deform + ba_bm_endplay_deform_scracth) as bracket_metal
from t_ncvc_pdc_fc fc left join t_ncvc_pdc_en2 e2 on fc.fc_id = e2.en2_id left join t_ncvc_pdc_en1 e1 on e1.en1_id = fc.fc_id left join t_ncvc_pdc_ca ca on ca.ca_id = fc.fc_id left join t_ncvc_pdc_ba ba on ba.ba_id = fc.fc_id left join (select dates, '06:00' h, min(times), line_cd from t_ncvc_pdc_fc where dates = :dates and times between '06:00:00' and '06:55:00' group by line_cd, dates union select dates, '07:00' h, max(times), line_cd from t_ncvc_pdc_fc where dates = :dates  and times between '06:00:00' and '07:05:00' group by line_cd, dates union select dates, '08:00' h, max(times), line_cd from t_ncvc_pdc_fc where dates = :dates  and times between '07:00:00' and '08:05:00' group by line_cd, dates union select dates, '09:00' h, max(times), line_cd from t_ncvc_pdc_fc where dates = :dates  and times between '08:00:00' and '09:05:00' group by line_cd, dates union select dates, '10:00' h, max(times), line_cd from t_ncvc_pdc_fc where dates = :dates  and times between '09:00:00' and '10:05:00' group by line_cd, dates union select dates, '11:00' h, max(times), line_cd from t_ncvc_pdc_fc where dates = :dates  and times between '10:00:00' and '11:05:00' group by line_cd, dates union select dates, '12:00' h, max(times), line_cd from t_ncvc_pdc_fc where dates = :dates  and times between '11:00:00' and '12:05:00' group by line_cd, dates union select dates, '13:00' h, max(times), line_cd from t_ncvc_pdc_fc where dates = :dates  and times between '12:00:00' and '13:05:00' group by line_cd, dates union select dates, '14:00' h, max(times), line_cd from t_ncvc_pdc_fc where dates = :dates  and times between '13:00:00' and '14:05:00' group by line_cd, dates union select dates, '15:00' h, max(times), line_cd from t_ncvc_pdc_fc where dates = :dates  and times between '14:00:00' and '15:05:00' group by line_cd, dates union select dates, '16:00' h, max(times), line_cd from t_ncvc_pdc_fc where dates = :dates  and times between '15:00:00' and '16:05:00' group by line_cd, dates union select dates, '17:00' h, max(times), line_cd from t_ncvc_pdc_fc where dates = :dates  and times between '16:00:00' and '17:05:00' group by line_cd, dates union select dates, '18:00' h, max(times), line_cd from t_ncvc_pdc_fc where dates = :dates  and times between '17:00:00' and '18:05:00' group by line_cd, dates union select dates, '19:00' h, max(times), line_cd from t_ncvc_pdc_fc where dates = :dates  and times between '18:00:00' and '19:05:00' group by line_cd, dates union select dates, '20:00' h, max(times), line_cd from t_ncvc_pdc_fc where dates = :dates  and times between '19:00:00' and '20:05:00' group by line_cd, dates union select dates, '21:00' h, max(times), line_cd from t_ncvc_pdc_fc where dates = :dates  and times between '20:00:00' and '21:05:00' group by line_cd, dates union select dates, '22:00' h, max(times), line_cd from t_ncvc_pdc_fc where dates = :dates  and times between '21:00:00' and '22:05:00' group by line_cd, dates union select dates, '23:00' h, max(times), line_cd from t_ncvc_pdc_fc where dates = :dates  and times between '22:00:00' and '23:05:00' group by line_cd, dates
union select dates, '00:00' h, min(times), line_cd from t_ncvc_pdc_fc where dates - 1 = :dates  and times between '00:00:00' and '01:05:00' group by line_cd, dates union select dates, '01:00' h, max(times), line_cd from t_ncvc_pdc_fc where dates - 1 = :dates  and times between '00:00:00' and '01:05:00' group by line_cd, dates union select dates, '02:00' h, max(times), line_cd from t_ncvc_pdc_fc where dates - 1 = :dates  and times between '01:00:00' and '02:05:00' group by line_cd, dates union select dates, '03:00' h, max(times), line_cd from t_ncvc_pdc_fc where dates - 1 = :dates  and times between '02:00:00' and '03:05:00' group by line_cd, dates union select dates, '04:00' h, max(times), line_cd from t_ncvc_pdc_fc where dates - 1 = :dates  and times between '03:00:00' and '04:05:00' group by line_cd, dates union select dates, '05:00' h, max(times), line_cd from t_ncvc_pdc_fc where dates - 1 = :dates  and times between '04:00:00' and '05:05:00' group by line_cd, dates union select dates, '05:55' h, max(times), line_cd from t_ncvc_pdc_fc where dates - 1 = :dates  and times between '05:00:00' and '05:55:00' group by line_cd, dates) t on fc.line_cd = t.line_cd and fc.times = t.min where fc.line_cd = t.line_cd and fc.times = t.min order by line_cd, ca.times) tblout order by line_cd,datetimes");

            sqlParameter.AddParameterDateTime("dates", inVo.StartDay);
            //sqlParameter.AddParameterDateTime("datesto", inVo.EndDay);

            sqlCommandAdapter = base.GetDbCommandAdaptor(trxContext, sql.ToString());

            //execute SQL
            IDataReader dataReader = sqlCommandAdapter.ExecuteReader(trxContext, sqlParameter);

            while (dataReader.Read())
            {
                ProductionControllerNCVCVo outVo = new ProductionControllerNCVCVo
                {
                    //StartDay = DateTime.Parse(dataReader["datetimes"].ToString()),
                    TimeHour  = DateTime.Parse(dataReader["datetimes"].ToString()),
                    ProModel  = dataReader["model_cd"].ToString(),
                    ProLine   = dataReader["line_cd"].ToString(),
                    TotalNG   = int.Parse(dataReader["sum_ng"].ToString()),
                    ProInput  = int.Parse(dataReader["ba_input"].ToString()),
                    ProOutput = int.Parse(dataReader["output"].ToString()),

                    Final_App   = int.Parse(dataReader["final_app"].ToString()),
                    En2NG       = int.Parse(dataReader["en2"].ToString()),
                    Case_Assy   = int.Parse(dataReader["case_assy"].ToString()),
                    En1NG       = int.Parse(dataReader["en1"].ToString()),
                    Case_MG     = int.Parse(dataReader["case_mg"].ToString()),
                    MG_Bongding = int.Parse(dataReader["case_bonding"].ToString()),

                    TrustGap      = int.Parse(dataReader["trust_gap"].ToString()),
                    Rotor         = int.Parse(dataReader["rotor"].ToString()),
                    Braket        = int.Parse(dataReader["bracket_assy"].ToString()),
                    Bracket_Metal = int.Parse(dataReader["bracket_metal"].ToString()),
                };
                voList.add(outVo);
            }
            dataReader.Close();
            return(voList);
        }
        public override ValueObject Execute(TransactionContext trxContext, ValueObject vo)
        {
            ReportDownTimeVo inVo = (ReportDownTimeVo)vo;
            StringBuilder    sql  = new StringBuilder();

            sql.Append(@"update t_downtime_report set time_from=:time_from,time_to=:time_to,
                prodution_work_content_id=:prodution_work_content_id,line_id=:line_id,
                model_id=:model_id,machine_id=:machine_id,defective_reason_id=:defective_reason_id,
                process_work_id=:process_work_id,remarks=:remarks");
            sql.Append(" where downtime_report_id =:downtime_report_id");



            //create command
            DbCommandAdaptor sqlCommandAdapter = base.GetDbCommandAdaptor(trxContext, sql.ToString());

            //create parameter
            DbParameterList sqlParameter = sqlCommandAdapter.CreateParameterList();

            sqlParameter.AddParameterInteger("downtime_report_id", inVo.DowntimeReportId);
            sqlParameter.AddParameterDateTime("time_to", inVo.TimeTo);
            sqlParameter.AddParameterDateTime("time_from", inVo.TimeFrom);
            sqlParameter.AddParameterString("remarks", inVo.Remakes);

            sqlParameter.AddParameterInteger("downtime_report_id", inVo.GroupProcessWorkId);
            sqlParameter.AddParameterInteger("line_id", inVo.LineId);
            sqlParameter.AddParameterInteger("machine_id", inVo.MachineId);
            sqlParameter.AddParameterInteger("model_id", inVo.ModelId);
            sqlParameter.AddParameterInteger("process_work_id", inVo.ProcessWorkId);
            sqlParameter.AddParameterInteger("prodution_work_content_id", inVo.ProductionWorkContentId);
            sqlParameter.AddParameterInteger("defective_reason_id", inVo.DefectiveReasonId);
            //execute SQL

            ReportDownTimeVo outVo = new ReportDownTimeVo
            {
                AffectedCount = sqlCommandAdapter.ExecuteNonQuery(sqlParameter)
            };

            return(outVo);
        }
Exemplo n.º 15
0
        public override ValueObject Execute(TransactionContext trxContext, ValueObject arg)
        {
            MoldCategoryVo inVo = (MoldCategoryVo)arg;

            StringBuilder sqlQuery = new StringBuilder();

            sqlQuery.Append("Insert into m_mold_category");
            sqlQuery.Append(" ( ");
            sqlQuery.Append(" mold_category_cd, ");
            sqlQuery.Append(" mold_category_name, ");
            sqlQuery.Append(" display_order, ");
            sqlQuery.Append(" registration_user_cd, ");
            sqlQuery.Append(" registration_date_time, ");
            sqlQuery.Append(" factory_cd ");
            sqlQuery.Append(" ) ");
            sqlQuery.Append("VALUES	");
            sqlQuery.Append(" ( ");
            sqlQuery.Append(" :moldcategorycd ,");
            sqlQuery.Append(" :moldcategoryname ,");
            sqlQuery.Append(" :displayorder ,");
            sqlQuery.Append(" :registrationusercode ,");
            sqlQuery.Append(" :registrationdatetime ,");
            sqlQuery.Append(" :factorycode ");
            sqlQuery.Append(" ) ");
            sqlQuery.Append("RETURNING  mold_category_id;");

            //create command
            DbCommandAdaptor sqlCommandAdapter = base.GetDbCommandAdaptor(trxContext, sqlQuery.ToString());

            //create parameter
            DbParameterList sqlParameter = sqlCommandAdapter.CreateParameterList();

            sqlParameter.AddParameterString("moldcategorycd", inVo.MoldCategoryCode);
            sqlParameter.AddParameterString("moldcategoryname", inVo.MoldCategoryName);
            sqlParameter.AddParameterInteger("displayorder", inVo.DisplayOrder);
            sqlParameter.AddParameterString("registrationusercode", trxContext.UserData.UserCode);
            sqlParameter.AddParameterDateTime("registrationdatetime", trxContext.ProcessingDBDateTime);
            sqlParameter.AddParameterString("factorycode", trxContext.UserData.FactoryCode);

            //execute SQL
            int outId = (int?)sqlCommandAdapter.ExecuteScalar(sqlParameter) ?? 0;

            MoldCategoryVo outVo = null;

            if (outId > 0)
            {
                outVo = new MoldCategoryVo();
                outVo.MoldCategoryId = outId;
            }

            return(outVo);
        }
Exemplo n.º 16
0
        public override ValueObject Execute(TransactionContext trxContext, ValueObject vo)
        {
            AssetVo       inVo = (AssetVo)vo;
            StringBuilder sql  = new StringBuilder();

            sql.Append("insert into m_asset(asset_id, asset_cd,asset_no, asset_name, asset_model, asset_supplier, asset_invoice, asset_life,acquistion_date, acquistion_cost, asset_serial, asset_type, registration_user_cd, registration_date_time, factory_cd, label_status, asset_po) ");
            sql.Append(@"values((select max(asset_id)+1 from m_asset),:asset_cd,:asset_no, :asset_name, :asset_model, :asset_supplier,:asset_invoice, :asset_life, :acquistion_date, :acquistion_cost, :asset_serial, :asset_type, :registration_user_cd, now(), :factory_cd, :label_status, :asset_po)");

            //create command
            DbCommandAdaptor sqlCommandAdapter = base.GetDbCommandAdaptor(trxContext, sql.ToString());

            //create parameter
            DbParameterList sqlParameter = sqlCommandAdapter.CreateParameterList();

            sqlParameter.AddParameterString("asset_cd", inVo.AssetCode);
            sqlParameter.AddParameterInteger("asset_no", inVo.AssetNo);
            sqlParameter.AddParameterString("asset_name", inVo.AssetName);
            sqlParameter.AddParameterString("asset_model", inVo.AssetModel);
            sqlParameter.AddParameterString("asset_supplier", inVo.AssetSuppiler);
            sqlParameter.AddParameterString("asset_invoice", inVo.AssetInvoice);
            sqlParameter.AddParameterString("asset_serial", inVo.AssetSerial);
            sqlParameter.AddParameter("asset_life", inVo.AssetLife);
            sqlParameter.AddParameterDateTime("acquistion_date", inVo.AcquistionDate);
            sqlParameter.AddParameter("acquistion_cost", inVo.AcquistionCost);
            sqlParameter.AddParameterString("asset_type", inVo.AssetType);
            sqlParameter.AddParameterString("factory_cd", inVo.FactoryCode);
            sqlParameter.AddParameterString("registration_user_cd", inVo.RegistrationUserCode);
            sqlParameter.AddParameterDateTime("registration_date_time", inVo.RegistrationDateTime);
            sqlParameter.AddParameterString("label_status", inVo.LabelStatus);
            sqlParameter.AddParameterString("asset_po", inVo.AssetPO);
            //execute SQL

            AssetVo outVo = new AssetVo
            {
                AffectedCount = sqlCommandAdapter.ExecuteNonQuery(sqlParameter)
            };

            return(outVo);
        }
Exemplo n.º 17
0
        public override ValueObject Execute(TransactionContext trxContext, ValueObject arg)
        {
            InspectionProcessVo inVo = (InspectionProcessVo)arg;

            StringBuilder sqlQuery = new StringBuilder();

            sqlQuery.Append("Insert into m_inspection_process");
            sqlQuery.Append(" ( ");
            sqlQuery.Append(" inspection_process_cd,");
            sqlQuery.Append(" inspection_process_name,");
            sqlQuery.Append(" inspection_format_id,");
            sqlQuery.Append(" display_order,");
            sqlQuery.Append(" registration_user_cd,");
            sqlQuery.Append(" registration_date_time,");
            sqlQuery.Append(" factory_cd");
            sqlQuery.Append(" ) ");
            sqlQuery.Append("VALUES	");
            sqlQuery.Append(" ( ");
            sqlQuery.Append(" :inspectionprocesscd,");
            sqlQuery.Append(" :inspectionprocessname,");
            sqlQuery.Append(" :inspectionformatid,");
            sqlQuery.Append(" :displayorder,");
            sqlQuery.Append(" :registrationusercode,");
            sqlQuery.Append(" :regdatetime,");
            sqlQuery.Append(" :factorycode");
            sqlQuery.Append(" ) ");
            sqlQuery.Append(" RETURNING inspection_process_id;");

            //create command
            DbCommandAdaptor sqlCommandAdapter = base.GetDbCommandAdaptor(trxContext, sqlQuery.ToString());

            //create parameter
            DbParameterList sqlParameter = sqlCommandAdapter.CreateParameterList();

            sqlParameter.AddParameterString("inspectionprocesscd", inVo.InspectionProcessCode);
            sqlParameter.AddParameterString("inspectionprocessname", inVo.InspectionProcessName);
            sqlParameter.AddParameterInteger("inspectionformatid", inVo.InspectionFormatId);
            sqlParameter.AddParameterInteger("displayorder", inVo.DisplayOrder);

            UserData userdata = trxContext.UserData;

            sqlParameter.AddParameterString("registrationusercode", userdata.UserCode);
            sqlParameter.AddParameterDateTime("regdatetime", trxContext.ProcessingDBDateTime);
            sqlParameter.AddParameterString("factorycode", userdata.FactoryCode);

            InspectionProcessVo outVo = new InspectionProcessVo();

            outVo.InspectionProcessId = (int?)sqlCommandAdapter.ExecuteScalar(sqlParameter) ?? 0;

            return(outVo);
        }
Exemplo n.º 18
0
        public override ValueObject Execute(TransactionContext trxContext, ValueObject arg)
        {
            InspectionTestInstructionVo inVo = (InspectionTestInstructionVo)arg;

            StringBuilder sqlQuery = new StringBuilder();

            sqlQuery.Append("Insert into m_inspection_test_instruction_detail");
            sqlQuery.Append(" ( ");
            sqlQuery.Append(" inspection_test_instruction_detail_cd,");
            sqlQuery.Append(" inspection_test_instruction_detail_text,");
            sqlQuery.Append(" inspection_test_instruction_detail_result_count,");
            sqlQuery.Append(" inspection_test_instruction_detail_machine_text, ");
            sqlQuery.Append(" inspection_test_instruction_id,");
            sqlQuery.Append(" registration_user_cd,");
            sqlQuery.Append(" registration_date_time,");
            sqlQuery.Append(" factory_cd");
            sqlQuery.Append(" ) ");
            sqlQuery.Append("VALUES	");
            sqlQuery.Append(" ( ");
            sqlQuery.Append(" :inspectiontestinstructiondetailcd,");
            sqlQuery.Append(" :inspectiontestinstructiondetailtext,");
            sqlQuery.Append(" :inspectiontestinstructiondetailresultcount,");
            sqlQuery.Append(" :inspectiontestinstructiondetailmachine,");
            sqlQuery.Append(" :inspectiontestinstructionid,");
            sqlQuery.Append(" :registrationusercode,");
            sqlQuery.Append(" :regdatetime,");
            sqlQuery.Append(" :factorycode");
            sqlQuery.Append(" ); ");

            //create command
            DbCommandAdaptor sqlCommandAdapter = base.GetDbCommandAdaptor(trxContext, sqlQuery.ToString());

            //create parameter
            DbParameterList sqlParameter = sqlCommandAdapter.CreateParameterList();

            sqlParameter.AddParameterString("inspectiontestinstructiondetailcd", inVo.InspectionTestInstructionDetailCode);
            sqlParameter.AddParameterString("inspectiontestinstructiondetailtext", inVo.InspectionTestInstructionDetailText);
            sqlParameter.AddParameterInteger("inspectiontestinstructiondetailresultcount", inVo.InspectionTestInstructionDetailResultCount);
            sqlParameter.AddParameterInteger("inspectiontestinstructionid", inVo.InspectionTestInstructionId);
            sqlParameter.AddParameterString("inspectiontestinstructiondetailmachine", inVo.InspectionTestInstructionDetailMachine);
            sqlParameter.AddParameterString("registrationusercode", UserData.GetUserData().UserCode);
            sqlParameter.AddParameterDateTime("regdatetime", trxContext.ProcessingDBDateTime);
            sqlParameter.AddParameterString("factorycode", UserData.GetUserData().FactoryCode);

            UpdateResultVo outVo = new UpdateResultVo {
                AffectedCount = sqlCommandAdapter.ExecuteNonQuery(sqlParameter)
            };

            return(outVo);
        }
Exemplo n.º 19
0
        public override ValueObject Execute(TransactionContext trxContext, ValueObject vo)
        {
            ProductionControllerVo inVo = (ProductionControllerVo)vo;
            StringBuilder          sql  = new StringBuilder();
            ValueObjectList <ProductionControllerVo> voList = new ValueObjectList <ProductionControllerVo>();
            //create command
            DbCommandAdaptor sqlCommandAdapter = base.GetDbCommandAdaptor(trxContext, sql.ToString());

            //create parameter
            DbParameterList sqlParameter = sqlCommandAdapter.CreateParameterList();

            sql.Append(@"select case when max(output_data) is null then 0 else max(output_data) end output from t_productioncontroller_output04 ");
            sql.Append(" where 1=1  ");

            sql.Append(@" and dates =:dates");
            sqlParameter.AddParameterDateTime("dates", DateTime.Parse(inVo.Date));



            if (!String.IsNullOrEmpty(inVo.ProModel))
            {
                sql.Append(" and   model_cd  =:model_cd");
                sqlParameter.AddParameterString("model_cd", inVo.ProModel);
            }
            if (!String.IsNullOrEmpty(inVo.ProLine))
            {
                sql.Append(" and line_cd  =:line_cd");
                sqlParameter.AddParameterString("line_cd", inVo.ProLine);
            }


            //sql.Append(" order by datetimes");
            sqlCommandAdapter = base.GetDbCommandAdaptor(trxContext, sql.ToString());

            //execute SQL
            IDataReader dataReader = sqlCommandAdapter.ExecuteReader(trxContext, sqlParameter);

            while (dataReader.Read())
            {
                ProductionControllerVo outVo = new ProductionControllerVo
                {
                    //  , h., i., k., o.prodution_work_content_name

                    ProOutput = int.Parse(dataReader["output"].ToString()),
                };
                voList.add(outVo);
            }
            dataReader.Close();
            return(voList);
        }
Exemplo n.º 20
0
        public override ValueObject Execute(TransactionContext trxContext, ValueObject arg)
        {
            GlobalItemVo inVo = (GlobalItemVo)arg;

            GlobalItemVo outVo = null;

            StringBuilder sqlQuery = new StringBuilder();

            sqlQuery.Append("Insert into m_global_item");
            sqlQuery.Append(" ( ");
            sqlQuery.Append(" global_item_cd, ");
            sqlQuery.Append(" global_item_name, ");
            sqlQuery.Append(" registration_user_cd, ");
            sqlQuery.Append(" registration_date_time, ");
            sqlQuery.Append(" factory_cd ");
            sqlQuery.Append(" ) ");
            sqlQuery.Append(" VALUES	");
            sqlQuery.Append(" ( ");
            sqlQuery.Append(" :globalitemcd, ");
            sqlQuery.Append(" :globalitemname, ");
            sqlQuery.Append(" :registrationusercode, ");
            sqlQuery.Append(" :registrationdatetime, ");
            sqlQuery.Append(" :factorycode ");
            sqlQuery.Append(" ) ");
            sqlQuery.Append(" RETURNING global_item_id;");
            //create command
            DbCommandAdaptor sqlCommandAdapter = base.GetDbCommandAdaptor(trxContext, sqlQuery.ToString());

            //create parameter
            DbParameterList sqlParameter = sqlCommandAdapter.CreateParameterList();

            sqlParameter.AddParameterString("globalitemcd", inVo.GlobalItemCode);
            sqlParameter.AddParameterString("globalitemname", inVo.GlobalItemName);
            sqlParameter.AddParameterString("registrationusercode", UserData.GetUserData().UserCode);
            sqlParameter.AddParameterDateTime("registrationdatetime", trxContext.ProcessingDBDateTime);
            sqlParameter.AddParameterString("factorycode", UserData.GetUserData().FactoryCode);


            //execute SQL
            int outId = (int?)sqlCommandAdapter.ExecuteScalar(sqlParameter) ?? 0;

            if (outId > 0)
            {
                outVo = new GlobalItemVo();
                outVo.GlobalItemId = outId;
            }

            return(outVo);
        }
Exemplo n.º 21
0
        public override ValueObject Execute(TransactionContext trxContext, ValueObject arg)
        {
            ItemVo inVo = (ItemVo)arg;

            ItemVo outVo = new ItemVo();

            StringBuilder sqlQuery = new StringBuilder();

            sqlQuery.Append("Insert into m_local_item");
            sqlQuery.Append(" ( ");
            sqlQuery.Append(" item_cd, ");
            sqlQuery.Append(" item_name, ");
            sqlQuery.Append(" unit_type,");
            sqlQuery.Append(" registration_user_cd, ");
            sqlQuery.Append(" registration_date_time, ");
            sqlQuery.Append(" factory_cd ");
            sqlQuery.Append(" ) ");
            sqlQuery.Append("VALUES	");
            sqlQuery.Append(" ( ");
            sqlQuery.Append(" :itemcode ,");
            sqlQuery.Append(" :itemname ,");
            sqlQuery.Append(" :unittype ,");
            sqlQuery.Append(" :registrationusercode ,");
            sqlQuery.Append(" :registrationdatetime ,");
            sqlQuery.Append(" :factorycode ");
            sqlQuery.Append(" ) returning item_id ");

            //create command
            DbCommandAdaptor sqlCommandAdapter = base.GetDbCommandAdaptor(trxContext, sqlQuery.ToString());

            //create parameter
            DbParameterList sqlParameter = sqlCommandAdapter.CreateParameterList();

            sqlParameter.AddParameterString("itemcode", inVo.ItemCode);
            sqlParameter.AddParameterString("itemname", inVo.ItemName);
            sqlParameter.AddParameterInteger("unittype", inVo.UnitType);
            sqlParameter.AddParameterString("registrationusercode", UserData.GetUserData().UserCode);
            sqlParameter.AddParameterDateTime("registrationdatetime", trxContext.ProcessingDBDateTime);
            sqlParameter.AddParameterString("factorycode", UserData.GetUserData().FactoryCode);

            outVo.ItemId = (int?)sqlCommandAdapter.ExecuteScalar(sqlParameter) ?? 0;

            if (outVo.ItemId > 0)
            {
                outVo.AffectedCount = 1;
            }

            return(outVo);
        }
Exemplo n.º 22
0
        public override ValueObject Execute(TransactionContext trxContext, ValueObject arg)
        {
            MoldItemVo inVo  = (MoldItemVo)arg;
            MoldItemVo outVo = new MoldItemVo();

            // Building SQL
            StringBuilder sql = new StringBuilder();

            sql.Append("Insert into m_mold_item");
            sql.Append("(");
            sql.Append(" mold_id,");
            sql.Append(" global_item_id,");
            sql.Append(" std_cycle_time,");
            sql.Append(" model_id,");
            sql.Append(" drawing_no,");
            sql.Append(" registration_user_cd,");
            sql.Append(" registration_date_time,");
            sql.Append(" factory_cd");
            sql.Append(") values (");
            sql.Append(" :moldid,");
            sql.Append(" :globalitemid,");
            sql.Append(" :stdcycletime,");
            sql.Append(" :modelid,");
            sql.Append(" :drawingno,");
            sql.Append(" :registrationusercd,");
            sql.Append(" :registrationdatetime,");
            sql.Append(" :factrycode ");
            sql.Append(" ) ");
            sql.Append("RETURNING mold_item_id;");

            //create command
            DbCommandAdaptor sqlCommandAdapter = base.GetDbCommandAdaptor(trxContext, sql.ToString());

            //create parameter
            DbParameterList sqlParameter = sqlCommandAdapter.CreateParameterList();

            sqlParameter.AddParameterInteger("moldid", inVo.MoldId);
            sqlParameter.AddParameterInteger("globalitemid", inVo.GlobalItemId);
            sqlParameter.AddParameterDecimal("stdcycletime", inVo.StdCycleTime);
            sqlParameter.AddParameterInteger("modelid", inVo.ModelId);
            sqlParameter.AddParameterString("drawingno", inVo.DrawingNo);
            sqlParameter.AddParameterString("registrationusercd", trxContext.UserData.UserCode);
            sqlParameter.AddParameterDateTime("registrationdatetime", trxContext.ProcessingDBDateTime);
            sqlParameter.AddParameterString("factrycode", trxContext.UserData.FactoryCode);

            outVo.AffectedCount = sqlCommandAdapter.ExecuteNonQuery(sqlParameter);

            return(outVo);
        }
Exemplo n.º 23
0
        public override ValueObject Execute(TransactionContext trxContext, ValueObject arg)
        {
            MoldItemVo inVo = (MoldItemVo)arg;

            // Building SQL
            StringBuilder sql = new StringBuilder();

            sql.Append("Insert into m_gtrs_global_item_sap_item");
            sql.Append("(");
            sql.Append(" global_item_id,");
            sql.Append(" sap_item_cd,");
            sql.Append(" registration_user_cd,");
            sql.Append(" registration_date_time,");
            sql.Append(" factory_cd");
            sql.Append(") values (");
            sql.Append(" :globalitemid,");
            sql.Append(" :sapitemcd,");
            sql.Append(" :registrationusercd,");
            sql.Append(" :registrationdatetime,");
            sql.Append(" :factrycode ");
            sql.Append(" ) ");
            sql.Append("RETURNING global_item_sap_item_id;");

            //create command
            DbCommandAdaptor sqlCommandAdapter = base.GetDbCommandAdaptor(trxContext, sql.ToString());

            //create parameter
            DbParameterList sqlParameter = sqlCommandAdapter.CreateParameterList();

            sqlParameter.AddParameterInteger("globalitemid", inVo.GlobalItemId);
            sqlParameter.AddParameterString("sapitemcd", inVo.LocalItemCode);
            sqlParameter.AddParameterString("registrationusercd", trxContext.UserData.UserCode);
            sqlParameter.AddParameterDateTime("registrationdatetime", trxContext.ProcessingDBDateTime);
            sqlParameter.AddParameterString("factrycode", trxContext.UserData.FactoryCode);

            //execute SQL
            int outId = (int?)sqlCommandAdapter.ExecuteScalar(sqlParameter) ?? 0;

            MoldItemVo outVo = null;

            if (outId > 0)
            {
                outVo = new MoldItemVo();
                outVo.GlobalLocalItemId = outId;
            }


            return(outVo);
        }
        public override ValueObject Execute(TransactionContext trxContext, ValueObject arg)
        {
            InspectionItemSelectionDatatypeValueVo inVo = (InspectionItemSelectionDatatypeValueVo)arg;

            StringBuilder sqlQuery = new StringBuilder();

            sqlQuery.Append("Insert into m_inspection_item_selection_datatype_value");
            sqlQuery.Append(" ( ");
            sqlQuery.Append(" inspection_item_selection_datatype_value_cd, ");
            sqlQuery.Append(" inspection_item_selection_datatype_value_text, ");
            sqlQuery.Append(" display_order,");
            sqlQuery.Append(" inspection_item_id, ");
            sqlQuery.Append(" registration_user_cd, ");
            sqlQuery.Append(" registration_date_time, ");
            sqlQuery.Append(" factory_cd ");
            sqlQuery.Append(" ) ");
            sqlQuery.Append("VALUES	");
            sqlQuery.Append(" ( ");
            sqlQuery.Append(" :datatypevaluecd ,");
            sqlQuery.Append(" :datatypevaluetext ,");
            sqlQuery.Append(" :displayorder,");
            sqlQuery.Append(" :itemid,");
            sqlQuery.Append(" :registrationusercode ,");
            sqlQuery.Append(" :registrationdatetime, ");
            sqlQuery.Append(" :factorycode ");
            sqlQuery.Append(" ); ");

            //create command
            DbCommandAdaptor sqlCommandAdapter = base.GetDbCommandAdaptor(trxContext, sqlQuery.ToString());

            //create parameter
            DbParameterList sqlParameter = sqlCommandAdapter.CreateParameterList();

            sqlParameter.AddParameterString("datatypevaluecd", inVo.InspectionItemSelectionDatatypeValueCode);
            sqlParameter.AddParameterString("datatypevaluetext", inVo.InspectionItemSelectionDatatypeValueText);
            sqlParameter.AddParameterInteger("displayorder", inVo.DisplayOrder);
            sqlParameter.AddParameterInteger("itemid", inVo.InspectionItemId);
            sqlParameter.AddParameterString("registrationusercode", UserData.GetUserData().UserCode);
            sqlParameter.AddParameterDateTime("registrationdatetime", trxContext.ProcessingDBDateTime);
            sqlParameter.AddParameterString("factorycode", UserData.GetUserData().FactoryCode);

            UpdateResultVo outVo = new UpdateResultVo
            {
                AffectedCount = sqlCommandAdapter.ExecuteNonQuery(sqlParameter)
            };

            return(outVo);
        }
Exemplo n.º 25
0
        public override ValueObject Execute(TransactionContext trxContext, ValueObject arg)
        {
            EmployeeVo inVo = (EmployeeVo)arg;

            StringBuilder sqlQuery = new StringBuilder();


            sqlQuery.Append("Insert into m_employee");
            sqlQuery.Append(" ( ");
            sqlQuery.Append(" employee_cd, ");
            sqlQuery.Append(" employee_name, ");
            sqlQuery.Append(" department, ");
            sqlQuery.Append(" is_active, ");
            sqlQuery.Append(" registration_user_cd, ");
            sqlQuery.Append(" registration_date_time, ");
            sqlQuery.Append(" factory_cd ");
            sqlQuery.Append(" ) ");
            sqlQuery.Append("VALUES	");
            sqlQuery.Append(" ( ");
            sqlQuery.Append(" :empcd ,");
            sqlQuery.Append(" :empname ,");
            sqlQuery.Append(" :department ,");
            sqlQuery.Append(" :isactive ,");
            sqlQuery.Append(" :registrationusercode ,");
            sqlQuery.Append(" :registrationdatetime ,");
            sqlQuery.Append(" :factorycode ");
            sqlQuery.Append(" ); ");

            //create command
            DbCommandAdaptor sqlCommandAdapter = base.GetDbCommandAdaptor(trxContext, sqlQuery.ToString());

            //create parameter
            DbParameterList sqlParameter = sqlCommandAdapter.CreateParameterList();

            sqlParameter.AddParameterString("empcd", inVo.EmployeeCode);
            sqlParameter.AddParameterString("empname", inVo.EmployeeName);
            sqlParameter.AddParameterString("department", inVo.Department);
            sqlParameter.AddParameterInteger("isactive", inVo.IsActive);
            sqlParameter.AddParameterString("registrationusercode", inVo.RegistrationUserCode);
            sqlParameter.AddParameterDateTime("registrationdatetime", trxContext.ProcessingDBDateTime);
            sqlParameter.AddParameterString("factorycode", inVo.FactoryCode);

            EmployeeVo outVo = new EmployeeVo {
                AffectedCount = sqlCommandAdapter.ExecuteNonQuery(sqlParameter)
            };

            return(outVo);
        }
Exemplo n.º 26
0
        public override ValueObject Execute(TransactionContext trxContext, ValueObject arg)
        {
            CavityVo inVo = (CavityVo)arg;

            StringBuilder sqlQuery = new StringBuilder();

            sqlQuery.Append("Insert into m_cavity");
            sqlQuery.Append(" ( ");
            sqlQuery.Append(" cavity_cd, ");
            sqlQuery.Append(" cavity_name, ");
            sqlQuery.Append(" mold_id, ");
            sqlQuery.Append(" registration_user_cd, ");
            sqlQuery.Append(" registration_date_time, ");
            sqlQuery.Append(" factory_cd ");
            sqlQuery.Append(" ) ");
            sqlQuery.Append("VALUES	");
            sqlQuery.Append(" ( ");
            sqlQuery.Append(" :cavitycd ,");
            sqlQuery.Append(" :cavityname ,");
            sqlQuery.Append(" :moldid ,");
            sqlQuery.Append(" :registrationusercode ,");
            sqlQuery.Append(" :regdatetime ,");
            sqlQuery.Append(" :factorycode ");
            sqlQuery.Append(" ); ");

            //create command
            DbCommandAdaptor sqlCommandAdapter = base.GetDbCommandAdaptor(trxContext, sqlQuery.ToString());

            //create parameter
            DbParameterList sqlParameter = sqlCommandAdapter.CreateParameterList();

            sqlParameter.AddParameterString("cavitycd", inVo.CavityCode);
            sqlParameter.AddParameterString("cavityname", inVo.CavityName);
            sqlParameter.AddParameterInteger("moldid", inVo.MoldId);

            UserData userdata = trxContext.UserData;

            sqlParameter.AddParameterString("registrationusercode", userdata.UserCode);
            sqlParameter.AddParameterDateTime("regdatetime", trxContext.ProcessingDBDateTime);
            sqlParameter.AddParameterString("factorycode", userdata.FactoryCode);

            CavityVo outVo = new CavityVo {
                AffectedCount = sqlCommandAdapter.ExecuteNonQuery(sqlParameter)
            };

            return(outVo);
        }
Exemplo n.º 27
0
        public override ValueObject Execute(TransactionContext trxContext, ValueObject arg)
        {
            ItemLineInspectionFormatVo inVo = (ItemLineInspectionFormatVo)arg;

            StringBuilder sqlQuery = new StringBuilder();

            sqlQuery.Append("Insert into m_item_line_inspection_format");
            sqlQuery.Append(" ( ");
            sqlQuery.Append(" sap_matnr_item_cd,");
            sqlQuery.Append(" line_id,");
            sqlQuery.Append(" inspection_format_id,");
            sqlQuery.Append(" registration_user_cd,");
            sqlQuery.Append(" registration_date_time,");
            sqlQuery.Append(" factory_cd");
            sqlQuery.Append(" ) ");
            sqlQuery.Append("VALUES	");
            sqlQuery.Append(" ( ");
            sqlQuery.Append(" :sapitemcd,");
            sqlQuery.Append(" :lineid,");
            sqlQuery.Append(" :inspectionformatid,");
            sqlQuery.Append(" :registrationusercode,");
            sqlQuery.Append(" :regdatetime,");
            sqlQuery.Append(" :factorycode");
            sqlQuery.Append(" ); ");

            //create command
            DbCommandAdaptor sqlCommandAdapter = base.GetDbCommandAdaptor(trxContext, sqlQuery.ToString());

            //create parameter
            DbParameterList sqlParameter = sqlCommandAdapter.CreateParameterList();

            sqlParameter.AddParameterString("sapitemcd", inVo.SapItemCode);
            sqlParameter.AddParameterInteger("lineid", inVo.LineId);
            sqlParameter.AddParameterInteger("inspectionformatid", inVo.InspectionFormatId);

            UserData userdata = trxContext.UserData;

            sqlParameter.AddParameterString("registrationusercode", userdata.UserCode);
            sqlParameter.AddParameterDateTime("regdatetime", trxContext.ProcessingDBDateTime);
            sqlParameter.AddParameterString("factorycode", userdata.FactoryCode);

            ItemLineInspectionFormatVo outVo = new ItemLineInspectionFormatVo {
                AffectedCount = sqlCommandAdapter.ExecuteNonQuery(sqlParameter)
            };

            return(outVo);
        }
        public override ValueObject Execute(TransactionContext trxContext, ValueObject arg)
        {
            InspectionTestInstructionVo inVo = (InspectionTestInstructionVo)arg;

            StringBuilder sqlQuery = new StringBuilder();

            sqlQuery.Append("Insert into m_inspection_test_instruction");
            sqlQuery.Append(" ( ");
            sqlQuery.Append(" inspection_test_instruction_cd,");
            sqlQuery.Append(" inspection_test_instruction_text,");
            sqlQuery.Append(" inspection_item_id,");
            sqlQuery.Append(" registration_user_cd,");
            sqlQuery.Append(" registration_date_time,");
            sqlQuery.Append(" factory_cd");
            sqlQuery.Append(" ) ");
            sqlQuery.Append("VALUES	");
            sqlQuery.Append(" ( ");
            sqlQuery.Append(" :inspectiontestinstructioncd,");
            sqlQuery.Append(" :inspectiontestinstructiontext,");
            sqlQuery.Append(" :inspectionitemid,");
            sqlQuery.Append(" :registrationusercode,");
            sqlQuery.Append(" :regdatetime,");
            sqlQuery.Append(" :factorycode");
            sqlQuery.Append(" ) ");
            sqlQuery.Append(" RETURNING inspection_test_instruction_id;");
            //create command
            DbCommandAdaptor sqlCommandAdapter = base.GetDbCommandAdaptor(trxContext, sqlQuery.ToString());

            //create parameter
            DbParameterList sqlParameter = sqlCommandAdapter.CreateParameterList();

            sqlParameter.AddParameterString("inspectiontestinstructioncd", inVo.InspectionTestInstructionCode);
            sqlParameter.AddParameterString("inspectiontestinstructiontext", inVo.InspectionTestInstructionText);
            sqlParameter.AddParameterInteger("inspectionitemid", inVo.InspectionItemId);

            UserData userdata = trxContext.UserData;

            sqlParameter.AddParameterString("registrationusercode", userdata.UserCode);
            sqlParameter.AddParameterDateTime("regdatetime", trxContext.ProcessingDBDateTime);
            sqlParameter.AddParameterString("factorycode", userdata.FactoryCode);

            InspectionTestInstructionVo outVo = new InspectionTestInstructionVo();

            outVo.InspectionTestInstructionId = (int?)sqlCommandAdapter.ExecuteScalar(sqlParameter) ?? 0;
            return(outVo);
        }
Exemplo n.º 29
0
        public override ValueObject Execute(TransactionContext trxContext, ValueObject arg)
        {
            LineRestTimeVo inVo = (LineRestTimeVo)arg;

            StringBuilder sqlQuery = new StringBuilder();

            sqlQuery.Append(" Insert into");
            sqlQuery.Append(" m_line_rest_time ");
            sqlQuery.Append(" ( ");
            sqlQuery.Append(" line_id, ");
            sqlQuery.Append(" shift, ");
            sqlQuery.Append(" plan_rest_minutes, ");
            sqlQuery.Append(" registration_user_cd, ");
            sqlQuery.Append(" registration_date_time, ");
            sqlQuery.Append(" factory_cd ");
            sqlQuery.Append(" ) ");
            sqlQuery.Append(" Values ");
            sqlQuery.Append(" ( ");
            sqlQuery.Append(" :lineid, ");
            sqlQuery.Append(" :shift, ");
            sqlQuery.Append(" :planrestminutes, ");
            sqlQuery.Append(" :registrationusercd, ");
            sqlQuery.Append(" :registrationdatetime, ");
            sqlQuery.Append(" :factorycd ");
            sqlQuery.Append(" ); ");

            //create command
            DbCommandAdaptor sqlCommandAdapter = base.GetDbCommandAdaptor(trxContext, sqlQuery.ToString());

            //create parameter
            DbParameterList sqlParameter = sqlCommandAdapter.CreateParameterList();

            sqlParameter.AddParameterInteger("lineid", inVo.LineId);
            sqlParameter.AddParameterInteger("shift", inVo.Shift);
            sqlParameter.AddParameter("planrestminutes", inVo.PlanRestMinutes);
            sqlParameter.AddParameterString("registrationusercd", trxContext.UserData.UserCode);
            sqlParameter.AddParameterDateTime("registrationdatetime", trxContext.ProcessingDBDateTime);
            sqlParameter.AddParameterString("factorycd", trxContext.UserData.FactoryCode);

            UpdateResultVo outVo = new UpdateResultVo {
                AffectedCount = sqlCommandAdapter.ExecuteNonQuery(sqlParameter)
            };

            return(outVo);
        }
        public override ValueObject Execute(TransactionContext trxContext, ValueObject arg)
        {
            LineItemCycleTimeVo inVo = (LineItemCycleTimeVo)arg;

            StringBuilder sqlQuery = new StringBuilder();

            sqlQuery.Append(" Insert into");
            sqlQuery.Append(" m_line_sap_item ");
            sqlQuery.Append(" ( ");
            sqlQuery.Append(" sap_matnr_item_cd, ");
            sqlQuery.Append(" line_id, ");
            sqlQuery.Append(" cycle_time, ");
            sqlQuery.Append(" registration_user_cd, ");
            sqlQuery.Append(" registration_date_time, ");
            sqlQuery.Append(" factory_cd ");
            sqlQuery.Append(" ) ");
            sqlQuery.Append(" Values ");
            sqlQuery.Append(" ( ");
            sqlQuery.Append(" :sapitemcd, ");
            sqlQuery.Append(" :lineid, ");
            sqlQuery.Append(" :cycletime, ");
            sqlQuery.Append(" :registrationusercd, ");
            sqlQuery.Append(" :registrationdatetime, ");
            sqlQuery.Append(" :factorycd ");
            sqlQuery.Append(" ); ");

            //create command
            DbCommandAdaptor sqlCommandAdapter = base.GetDbCommandAdaptor(trxContext, sqlQuery.ToString());

            //create parameter
            DbParameterList sqlParameter = sqlCommandAdapter.CreateParameterList();

            sqlParameter.AddParameterString("sapitemcd", inVo.SapItemCode);
            sqlParameter.AddParameterInteger("lineid", inVo.LineId);
            sqlParameter.AddParameterDecimal("cycletime", inVo.StdCycleTime);
            sqlParameter.AddParameterString("registrationusercd", trxContext.UserData.UserCode);
            sqlParameter.AddParameterDateTime("registrationdatetime", trxContext.ProcessingDBDateTime);
            sqlParameter.AddParameterString("factorycd", trxContext.UserData.FactoryCode);

            UpdateResultVo outVo = new UpdateResultVo {
                AffectedCount = sqlCommandAdapter.ExecuteNonQuery(sqlParameter)
            };

            return(outVo);
        }