Ejemplo n.º 1
0
        public override ValueObject Execute(TransactionContext trxContext, ValueObject arg)
        {
            InventoryReasonVo inVo = (InventoryReasonVo)arg;

            StringBuilder sqlQuery = new StringBuilder();

            sqlQuery.Append("Insert into m_inventory_reason");
            sqlQuery.Append(" ( ");
            sqlQuery.Append(" inventory_reason_cd, ");
            sqlQuery.Append(" inventory_reason_name, ");
            sqlQuery.Append(" registration_user_cd, ");
            sqlQuery.Append(" registration_date_time, ");
            sqlQuery.Append(" factory_cd ");
            sqlQuery.Append(" ) ");
            sqlQuery.Append("VALUES	");
            sqlQuery.Append(" ( ");
            sqlQuery.Append(" :inventoryreasoncd ,");
            sqlQuery.Append(" :inventoryreasonname ,");
            sqlQuery.Append(" :registrationusercode ,");
            sqlQuery.Append(" now() ,");
            sqlQuery.Append(" :factorycode ");
            sqlQuery.Append(" ); ");

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

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

            sqlParameter.AddParameterString("inventoryreasoncd", inVo.InventoryReasonCode);
            sqlParameter.AddParameterString("inventoryreasonname", inVo.InventoryReasonName);
            sqlParameter.AddParameterString("registrationusercode", inVo.RegistrationUserCode);
            //sqlParameter.AddParameterDateTime("registrationdatetime", inVo.RegistrationDateTime);
            sqlParameter.AddParameterString("factorycode", inVo.FactoryCode);

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

            return(outVo);
        }
Ejemplo n.º 2
0
        public override ValueObject Execute(TransactionContext trxContext, ValueObject arg)
        {
            ProcessVo inVo = (ProcessVo)arg;

            StringBuilder sqlQuery = new StringBuilder();

            sqlQuery.Append("Select Count(*) as ProcessCount from m_process ");
            sqlQuery.Append(" where factory_cd = :factcd ");

            if (inVo.ProcessCode != null)
            {
                sqlQuery.Append(" and UPPER(process_cd) = UPPER(:processcd)");
            }
                        
            //create command
            DbCommandAdaptor sqlCommandAdapter = base.GetDbCommandAdaptor(trxContext, sqlQuery.ToString());

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

            sqlParameter.AddParameterString("factcd", UserData.GetUserData().FactoryCode);

            if (inVo.ProcessCode != null)
            {
                sqlParameter.AddParameterString("processcd", inVo.ProcessCode);
            }

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

            ProcessVo outVo = new ProcessVo();

            while (dataReader.Read())
            {
                outVo.AffectedCount = Convert.ToInt32(dataReader["ProcessCount"]);
            }

            dataReader.Close();

            return outVo;
        } 
Ejemplo n.º 3
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);
        }
        public override ValueObject Execute(TransactionContext trxContext, ValueObject arg)
        {
            UserLineBuildingVo inVo = (UserLineBuildingVo)arg;

            StringBuilder sqlQuery = new StringBuilder();

            sqlQuery.Append("Delete from m_user_line_building");
            sqlQuery.Append(" where factory_cd = :faccd ");

            if (inVo.LineBuildingId > 0)
            {
                sqlQuery.Append(" AND line_building_id = :linebuildingid");
            }
            if (inVo.UserCode != null)
            {
                sqlQuery.Append(" AND user_cd = :usercd");
            }

            if (inVo.LineBuildingidList.Count > 0)
            {
                sqlQuery.Append(" AND line_building_id = ANY(:idlist) ");
            }

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

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

            sqlParameter.AddParameterString("faccd", UserData.GetUserData().FactoryCode);

            sqlParameter.AddParameterInteger("linebuildingid", inVo.LineBuildingId);
            sqlParameter.AddParameterString("usercd", inVo.UserCode);
            sqlParameter.AddParameter("idlist", inVo.LineBuildingidList);

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

            return(outVo);
        }
Ejemplo n.º 5
0
        public override ValueObject Execute(TransactionContext trxContext, ValueObject vo)
        {
            JigResponseVo    inVo = (JigResponseVo)vo;
            StringBuilder    sql  = new StringBuilder();
            DbCommandAdaptor sqlCommandAdapter = base.GetDbCommandAdaptor(trxContext, string.Empty);
            DbParameterList  sqlParameter      = sqlCommandAdapter.CreateParameterList();

            sql.Append("delete from public.m_ncvp_jig_response Where 1=1 ");
            if (!String.IsNullOrEmpty(inVo.FactoryCode))
            {
                sql.Append(" and factory_cd = :factory_cd ");
                sqlParameter.AddParameterString("factory_cd", inVo.FactoryCode);
            }
            if (inVo.JigResponseId > 0)
            {
                sql.Append(" and jig_response_id = :jig_response_id ");
                sqlParameter.AddParameterInteger("jig_response_id", inVo.JigResponseId);
            }
            if (!string.IsNullOrEmpty(inVo.JigResponseCode))
            {
                sql.Append(" and jig_response_cd = :jig_response_cd ");
                sqlParameter.AddParameterString("jig_response_cd", inVo.JigResponseCode);
            }
            if (!string.IsNullOrEmpty(inVo.JigResponseName))
            {
                sql.Append(" and jig_response_name = :jig_response_name ");
                sqlParameter.AddParameterString("jig_response_name", inVo.JigResponseName);
            }

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

            //execute SQL

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

            return(outVo);
        }
Ejemplo n.º 6
0
        public override ValueObject Execute(TransactionContext trxContext, ValueObject vo)
        {
            ModelVo          inVo = (ModelVo)vo;
            StringBuilder    sql  = new StringBuilder();
            DbCommandAdaptor sqlCommandAdapter = base.GetDbCommandAdaptor(trxContext, string.Empty);
            DbParameterList  sqlParameter      = sqlCommandAdapter.CreateParameterList();

            sql.Append("Select Count(*) as ModelCount ");
            sql.Append(" from  public.m_model");
            sql.Append(" Where 1=1 ");

            if (!String.IsNullOrEmpty(inVo.FactoryCode))
            {
                sql.Append(" and factory_cd = :factory_cd ");
                sqlParameter.AddParameterString("factory_cd", inVo.FactoryCode);
            }
            if (!string.IsNullOrEmpty(inVo.ModelCode))
            {
                sql.Append(" and UPPER(model_cd) = UPPER(:model_cd) ");
                sqlParameter.AddParameterString("model_cd", inVo.ModelCode);
            }
            if (inVo.ModelId > 0)
            {
                sql.Append(" and model_id != :model_id "); ///?????
                sqlParameter.AddParameterInteger("model_id", inVo.ModelId);
            }


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

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

            while (dataReader.Read())
            {
                outVo.AffectedCount = Convert.ToInt32(dataReader["ModelCount"].ToString());
            }
            dataReader.Close();
            return(outVo);
        }
Ejemplo n.º 7
0
        public override ValueObject Execute(TransactionContext trxContext, ValueObject arg)
        {
            MoldVo inVo = (MoldVo)arg;

            StringBuilder sqlQuery = new StringBuilder();

            sqlQuery.Append("select count(cv.cavity_cd) as CavityCount from m_mold mo");
            sqlQuery.Append(" inner join m_cavity cv on cv.mold_id = mo.mold_id");
            sqlQuery.Append(" where mo.factory_cd = :faccd ");

            if (inVo.MoldCode != null)
            {
                sqlQuery.Append(" and UPPER(mold_cd) = UPPER(:moldcd) ");
            }

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

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

            sqlParameter.AddParameterString("faccd", UserData.GetUserData().FactoryCode);

            if (inVo.MoldCode != null)
            {
                sqlParameter.AddParameterString("moldcd", inVo.MoldCode);
            }

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

            MoldVo outVo = new MoldVo();

            while (dataReader.Read())
            {
                outVo.AffectedCount = Convert.ToInt32("0" + dataReader["CavityCount"]);
            }
            dataReader.Close();

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

            StringBuilder sqlQuery = new StringBuilder();

            sqlQuery.Append("Insert into m_process_stocklocation ");
            sqlQuery.Append(" ( ");
            sqlQuery.Append(" process_id, ");
            sqlQuery.Append(" stock_location_id, ");
            sqlQuery.Append(" registration_user_cd, ");
            sqlQuery.Append(" registration_date_time, ");
            sqlQuery.Append(" factory_cd ");
            sqlQuery.Append(" ) ");
            sqlQuery.Append("VALUES	");
            sqlQuery.Append(" ( ");
            sqlQuery.Append(" :processid ,");
            sqlQuery.Append(" :stocklocationid ,");
            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.AddParameterInteger("processid", inVo.ProcessId);
            sqlParameter.AddParameterInteger("stocklocationid", inVo.StockLocationId);
            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);
        }
Ejemplo n.º 9
0
        public override ValueObject Execute(TransactionContext trxContext, ValueObject arg)
        {
            GlobalLocalItemVo inVo = (GlobalLocalItemVo)arg;

            GlobalLocalItemVo outVo = new GlobalLocalItemVo();

            StringBuilder sqlQuery = new StringBuilder();

            sqlQuery.Append("Insert into m_global_local_item");
            sqlQuery.Append(" ( ");
            sqlQuery.Append(" global_item_id, ");
            sqlQuery.Append(" local_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(" :globalitemid, ");
            sqlQuery.Append(" :localitemid, ");
            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.AddParameterInteger("globalitemid", inVo.GlobalItemId);
            sqlParameter.AddParameterInteger("localitemid", inVo.LocalItemId);
            sqlParameter.AddParameterString("registrationusercode", UserData.GetUserData().UserCode);
            sqlParameter.AddParameterDateTime("registrationdatetime", trxContext.ProcessingDBDateTime);
            sqlParameter.AddParameterString("factorycode", UserData.GetUserData().FactoryCode);

            outVo.AffectedCount = sqlCommandAdapter.ExecuteNonQuery(sqlParameter);

            return(outVo);
        }
Ejemplo n.º 10
0
        public override ValueObject Execute(TransactionContext trxContext, ValueObject arg)
        {
            LineWorkContentVo inVo  = (LineWorkContentVo)arg;
            UpdateResultVo    outVo = new UpdateResultVo();

            StringBuilder sqlQuery = new StringBuilder();

            sqlQuery.Append("Insert into m_line_work_content");
            sqlQuery.Append(" ( ");
            sqlQuery.Append(" work_content_id, ");
            sqlQuery.Append(" line_id, ");
            sqlQuery.Append(" registration_user_cd, ");
            sqlQuery.Append(" registration_date_time, ");
            sqlQuery.Append(" factory_cd ");
            sqlQuery.Append(" ) ");
            sqlQuery.Append("VALUES	");
            sqlQuery.Append(" ( ");
            sqlQuery.Append(" :workContid ,");
            sqlQuery.Append(" :lineid ,");
            sqlQuery.Append(" :registrationusercd ,");
            sqlQuery.Append(" :registrationdatetime ,");
            sqlQuery.Append(" :factrycode ");
            sqlQuery.Append(" ); ");


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

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

            sqlParameter.AddParameterInteger("lineid", inVo.LineId);
            sqlParameter.AddParameterInteger("workContid", inVo.WorkContentId);
            sqlParameter.AddParameterString("registrationusercd", UserData.GetUserData().UserCode);
            sqlParameter.AddParameterDateTime("registrationdatetime", trxContext.ProcessingDBDateTime);
            sqlParameter.AddParameterString("factrycode", UserData.GetUserData().FactoryCode);

            outVo.AffectedCount += sqlCommandAdapter.ExecuteNonQuery(sqlParameter);

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

            StringBuilder sqlQuery = new StringBuilder();

            sqlQuery.Append("Insert into m_process_work_defective_reason");
            sqlQuery.Append(" ( ");
            sqlQuery.Append(" defective_reason_id, ");
            sqlQuery.Append(" process_work_id, ");
            sqlQuery.Append(" registration_user_cd, ");
            sqlQuery.Append(" registration_date_time, ");
            sqlQuery.Append(" factory_cd ");
            sqlQuery.Append(" ) ");
            sqlQuery.Append("VALUES	");
            sqlQuery.Append(" ( ");
            sqlQuery.Append(" :defrid ,");
            sqlQuery.Append(" :processworkid ,");
            sqlQuery.Append(" :registrationusercd ,");
            sqlQuery.Append(" :registrationdatetime ,");
            sqlQuery.Append(" :factrycode ");
            sqlQuery.Append(" ); ");


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

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

            sqlParameter.AddParameterInteger("processworkid", inVo.ProcessWorkId);
            sqlParameter.AddParameterInteger("defrid", inVo.DefectiveReasonId);
            sqlParameter.AddParameterString("registrationusercd", UserData.GetUserData().UserCode);
            sqlParameter.AddParameterDateTime("registrationdatetime", trxContext.ProcessingDBDateTime);
            sqlParameter.AddParameterString("factrycode", UserData.GetUserData().FactoryCode);

            outVo.AffectedCount += sqlCommandAdapter.ExecuteNonQuery(sqlParameter);

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

            StringBuilder sqlQuery = new StringBuilder();

            sqlQuery.Append("Insert into m_process_flow_rule");
            sqlQuery.Append(" ( ");
            sqlQuery.Append(" process_flow_rule_cd, ");
            sqlQuery.Append(" comment, ");
            sqlQuery.Append(" registration_user_cd, ");
            sqlQuery.Append(" registration_date_time, ");
            sqlQuery.Append(" factory_cd ");
            sqlQuery.Append(" ) ");
            sqlQuery.Append("VALUES	");
            sqlQuery.Append(" ( ");
            sqlQuery.Append(" :processflowrulecd ,");
            sqlQuery.Append(" :comment ,");
            sqlQuery.Append(" :registrationusercode ,");
            sqlQuery.Append(" now() ,");
            sqlQuery.Append(" :factorycode ");
            sqlQuery.Append(" ); ");

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

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

            sqlParameter.AddParameterString("processflowrulecd", inVo.ProcessFlowRuleCode);
            sqlParameter.AddParameterString("comment", inVo.Comment);
            sqlParameter.AddParameterString("registrationusercode", inVo.RegistrationUserCode);
            //sqlParameter.AddParameterDateTime("registrationdatetime", inVo.RegistrationDateTime);
            sqlParameter.AddParameterString("factorycode", inVo.FactoryCode);

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

            return(outVo);
        }
Ejemplo n.º 13
0
        public override ValueObject Execute(TransactionContext trxContext, ValueObject arg)
        {
            SapUserVo inVo = (SapUserVo)arg;

            StringBuilder sqlQuery = new StringBuilder();

            sqlQuery.Append("Insert into m_sap_user");
            sqlQuery.Append(" ( ");
            sqlQuery.Append(" mes_user_cd, ");
            sqlQuery.Append(" sap_user, ");
            sqlQuery.Append(" sap_password, ");
            sqlQuery.Append(" registration_user_cd, ");
            sqlQuery.Append(" registration_date_time, ");
            sqlQuery.Append(" factory_cd");
            sqlQuery.Append(" ) ");
            sqlQuery.Append("VALUES	");
            sqlQuery.Append(" ( ");
            sqlQuery.Append(" :mesusercd ,");
            sqlQuery.Append(" :sapuser ,");
            sqlQuery.Append(" :sappassword  ,");
            sqlQuery.Append(" :registrationusercode ,");
            sqlQuery.Append(" now() ,");
            sqlQuery.Append(" :registrationfactorycode ");
            sqlQuery.Append(" ); ");

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

            DbParameterList sqlParameter = sqlCommandAdapter.CreateParameterList();

            sqlParameter.AddParameterString("mesusercd", inVo.MesUserCode);
            sqlParameter.AddParameterString("sapuser ", inVo.SapUser);
            sqlParameter.AddParameterString("sappassword ", inVo.SapPassWord);
            sqlParameter.AddParameterString("registrationusercode ", UserData.GetUserData().UserCode);
            sqlParameter.AddParameterString("registrationfactorycode ", UserData.GetUserData().FactoryCode);

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

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

            StringBuilder sqlQuery = new StringBuilder();

            sqlQuery.Append("Update m_mes_user");
            sqlQuery.Append(" Set ");
            sqlQuery.Append(" user_name = :username, ");
            //sqlQuery.Append(" country = :country, ");
            //sqlQuery.Append(" language = :language, ");
            sqlQuery.Append(" locale_id = :locid, ");
            sqlQuery.Append(" multi_login_flag = :multiloginflag, ");
            sqlQuery.Append(" registrated_factory_cd = :registrationfactorycode ");
            sqlQuery.Append(" Where	");
            sqlQuery.Append(" user_cd = :usercode ");

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

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

            sqlParameter.AddParameterString("usercode", inVo.UserCode);
            sqlParameter.AddParameterString("username", inVo.UserName);
            //sqlParameter.AddParameterString("country", inVo.Country);
            //sqlParameter.AddParameterString("language ", inVo.Language);
            sqlParameter.AddParameterString("multiloginflag ", inVo.MultiLoginFlag);
            sqlParameter.AddParameterString("registrationfactorycode ", inVo.RegistrationFactoryCode);
            sqlParameter.AddParameterInteger("locid ", inVo.LocaleId);

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

            // outVo.TableName = "m_mes_user";

            //outVo.LogContents = sqlQuery.ToString();

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

            StringBuilder sqlQuery = new StringBuilder();

            sqlQuery.Append("Insert into m_gtrs_mold_drawing");
            sqlQuery.Append(" ( ");
            sqlQuery.Append("   mold_id, ");
            sqlQuery.Append("   drawing_no, ");
            sqlQuery.Append("   registration_user_cd, ");
            sqlQuery.Append("   registration_date_time, ");
            sqlQuery.Append("   factory_cd ) ");
            sqlQuery.Append(" values (");
            sqlQuery.Append("   :moldid , ");
            sqlQuery.Append("   :drawingno , ");
            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.AddParameterString("drawingno", inVo.DrawingNo);

            UserData userdata = trxContext.UserData;

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

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

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

            StringBuilder sqlQuery = new StringBuilder();

            //create SQL
            sqlQuery.Append("Select Count(*) as paletteCount from m_palette ");

            sqlQuery.Append(" where 1 = 1 ");

            if (inVo.PaletteCode != null)
            {
                sqlQuery.Append(" and UPPER(palette_cd) = UPPER(:palettecd) ");
            }

            //if (inVo.AreaId > 0)
            //{
            //    sqlQuery.Append(" and area_id = :areaid ");
            //}

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

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

            if (inVo.PaletteCode != null)
            {
                sqlParameter.AddParameterString("palettecd", inVo.PaletteCode);
            }

            //if (inVo.AreaId > 0)
            //{
            //    sqlParameter.AddParameterInteger("areaid", inVo.AreaId);
            //}

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

            PaletteVo outVo = new PaletteVo {
                AffectedCount = 0
            };

            while (dataReader.Read())
            {
                outVo.AffectedCount = Convert.ToInt32(dataReader["paletteCount"]);
            }

            dataReader.Close();

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

            StringBuilder sqlQuery = new StringBuilder();

            //create SQL
            sqlQuery.Append("Select Count(*) as CavityCount from m_cavity ");

            sqlQuery.Append(" where 1 = 1 ");

            if (inVo.CavityCode != null)
            {
                sqlQuery.Append(" and UPPER(cavity_cd) = UPPER(:cavitycd) ");
            }

            if (inVo.MoldId > 0)
            {
                sqlQuery.Append(" and mold_id = :moldid ");
            }

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

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

            if (inVo.CavityCode != null)
            {
                sqlParameter.AddParameterString("cavitycd", inVo.CavityCode);
            }

            if (inVo.MoldId > 0)
            {
                sqlParameter.AddParameterInteger("moldid", inVo.MoldId);
            }

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

            CavityVo outVo = new CavityVo {
                AffectedCount = 0
            };

            while (dataReader.Read())
            {
                outVo.AffectedCount = Convert.ToInt32(dataReader["CavityCount"]);
            }

            dataReader.Close();

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

            DbCommandAdaptor sqlCommandAdapter = base.GetDbCommandAdaptor(trxContext, string.Empty);
            DbParameterList  sqlParameter      = sqlCommandAdapter.CreateParameterList();

            sql.Append("Select Count(*) as CountNum ");
            sql.Append(" from m_work_content_type");
            sql.Append(" Where 1=1 ");
            if (!String.IsNullOrEmpty(inVo.FactoryCode))
            {
                sql.Append(" and factory_cd = :factory_cd ");
                sqlParameter.AddParameterString("factory_cd", inVo.FactoryCode);
            }
            if (!string.IsNullOrEmpty(inVo.ProdutionWorkContentTypeCode))
            {
                sql.Append(" and UPPER(work_content_type_cd) = UPPER(:prodution_work_content_type_cd) ");
                sqlParameter.AddParameterString("prodution_work_content_type_cd", inVo.ProdutionWorkContentTypeCode);
            }
            if (inVo.ProdutionWorkContentTypeId > 0)
            {
                sql.Append(" and work_content_type_id != :prodution_work_content_type_id ");
                sqlParameter.AddParameterInteger("prodution_work_content_type_id", inVo.ProdutionWorkContentTypeId);
            }

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

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

            while (dataReader.Read())
            {
                outVo.AffectedCount = Convert.ToInt32(dataReader["CountNum"].ToString());
            }
            dataReader.Close();
            return(outVo);
        }
Ejemplo n.º 19
0
        public override ValueObject Execute(TransactionContext trxContext, ValueObject arg)
        {
            ProcessWorkLineVo inVo = (ProcessWorkLineVo)arg;

            StringBuilder sqlQuery = new StringBuilder();

            sqlQuery.Append("Insert into m_processwork_line");
            sqlQuery.Append(" ( ");
            sqlQuery.Append(" process_work_id, ");
            sqlQuery.Append(" line_id, ");
            sqlQuery.Append(" registration_user_cd, ");
            sqlQuery.Append(" registration_date_time, ");
            sqlQuery.Append(" factory_cd ");
            sqlQuery.Append(" ) ");
            sqlQuery.Append("VALUES	");
            sqlQuery.Append(" ( ");
            sqlQuery.Append(" :processworkid ,");
            sqlQuery.Append(" :lineid ,");
            sqlQuery.Append(" :registrationusercode ,");
            sqlQuery.Append(" now() ,");
            sqlQuery.Append(" :factorycode ");
            sqlQuery.Append(" ); ");

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

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

            sqlParameter.AddParameterInteger("lineid", inVo.LineId);
            sqlParameter.AddParameterInteger("processworkid", inVo.ProcessWorkId);
            sqlParameter.AddParameterString("registrationusercode", inVo.RegistrationUserCode);
            sqlParameter.AddParameterString("factorycode", inVo.FactoryCode);

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

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

            sql.Append(@"update m_ovenmachine_range set range_lower=:range_lower,range_upper=:range_upper,registration_user_cd=:registration_user_cd,registration_date_time = now()");
            sql.Append(" where range_model=:range_model and range_line=:range_line and range_barcode=:range_barcode ");

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

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

            sqlParameter.AddParameter("ovenmachine_range_id", inVo.RangeId);
            sqlParameter.AddParameterString("range_model", inVo.Model);
            sqlParameter.AddParameterString("range_line", inVo.Line);
            sqlParameter.AddParameterString("range_barcode", inVo.Barcode);
            sqlParameter.AddParameterString("range_lower", inVo.Lower);
            sqlParameter.AddParameterString("range_upper", inVo.Upper);

            sqlParameter.AddParameterString("registration_user_cd", inVo.RegistrationUser);
            //execute SQL

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

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

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

            sql.Append("Insert into m_gtrs_process_work_mold");
            sql.Append("(");
            sql.Append(" process_work_id,");
            sql.Append(" mold_id,");
            sql.Append(" registration_user_cd,");
            sql.Append(" registration_date_time,");
            sql.Append(" factory_cd ");
            sql.Append(") values (");
            sql.Append(" :processworkid,");
            sql.Append(" :moldid,");
            sql.Append(" :registrationusercd,");
            sql.Append(" :registrationdatetime,");
            sql.Append(" :factrycode ");
            sql.Append(" ); ");

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

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

            sqlParameter.AddParameterInteger("processworkid", inVo.ProcessWorkId);
            sqlParameter.AddParameterInteger("moldid", inVo.MoldId);
            sqlParameter.AddParameterString("registrationusercd", UserData.GetUserData().UserCode);
            sqlParameter.AddParameterDateTime("registrationdatetime", trxContext.ProcessingDBDateTime);
            sqlParameter.AddParameterString("factrycode", UserData.GetUserData().FactoryCode);

            //outVo.ProcessWorkMoldId = (int?)sqlCommandAdapter.ExecuteScalar(sqlParameter) ?? 0;
            outVo.AffectedCount += sqlCommandAdapter.ExecuteNonQuery(sqlParameter);

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

            StringBuilder sqlQuery = new StringBuilder();

            sqlQuery.Append("Update m_equipment");
            sqlQuery.Append(" Set ");
            sqlQuery.Append(" equipment_name = :equipmentname , ");
            sqlQuery.Append(" instration_dt = :instrationdt , ");
            sqlQuery.Append(" asset_no = :assetno , ");
            sqlQuery.Append(" manufacturer = :manufacturer , ");
            sqlQuery.Append(" model_name = :modelname , ");
            sqlQuery.Append(" model_cd = :modelcd  ");
            sqlQuery.Append(" Where	");
            sqlQuery.Append(" equipment_id = :equipmentid ");
            sqlQuery.Append(" and factory_cd = :faccd ;");
            DbCommandAdaptor sqlCommandAdapter = base.GetDbCommandAdaptor(trxContext, sqlQuery.ToString());

            DbParameterList sqlParameter = sqlCommandAdapter.CreateParameterList();

            sqlParameter.AddParameterInteger("equipmentid", inVo.EquipmentId);
            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("faccd", UserData.GetUserData().FactoryCode);
            EquipmentVo outVo = new EquipmentVo {
                AffectedCount = sqlCommandAdapter.ExecuteNonQuery(sqlParameter)
            };

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

            sql.Append("insert into t_transfer_device(transfer_device_cd, transfer_content, transfer_dept, destination_dept, registration_user_cd, registration_date_time, factory_cd) ");
            sql.Append("values(:transfer_device_cd, :transfer_content, :transfer_dept, :destination_dept, :registration_user_cd, now(), :factory_cd)");

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

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

            sqlParameter.AddParameterString("transfer_device_cd", inVo.TransferDeviceCode);
            sqlParameter.AddParameterString("transfer_content", inVo.TransferContent);
            sqlParameter.AddParameterString("transfer_dept", inVo.TransferDept);
            sqlParameter.AddParameterString("destination_dept", inVo.DestinationDept);
            sqlParameter.AddParameterString("factory_cd", inVo.FactoryCode);
            sqlParameter.AddParameterString("registration_user_cd", inVo.RegistrationUserCode);
            //execute SQL

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

            return(outVo);
        }
Ejemplo n.º 24
0
        public override ValueObject Execute(TransactionContext trxContext, ValueObject arg)
        {
            ProcessWorkVo inVo = (ProcessWorkVo)arg;

            StringBuilder sqlQuery = new StringBuilder();

            sqlQuery.Append("Update m_process_work");
            sqlQuery.Append(" Set ");
            sqlQuery.Append(" process_work_name = :processworkname, ");
            sqlQuery.Append(" process_id = :processid, ");
            sqlQuery.Append(" is_phantom = :isphantom, ");
            sqlQuery.Append(" line_machine_selection  = :linemachineselection, ");
            sqlQuery.Append(" display_order  = :displayorder ");
            sqlQuery.Append(" Where	");
            sqlQuery.Append(" process_work_id = :processworkid");
            sqlQuery.Append(" and factory_cd = :faccd ;");



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

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

            sqlParameter.AddParameterInteger("processworkid", inVo.ProcessWorkId);
            sqlParameter.AddParameterString("processworkname", inVo.ProcessWorkName);
            sqlParameter.AddParameterInteger("processid", inVo.ProcessId);
            sqlParameter.AddParameterString("isphantom", inVo.IsPhantom);
            sqlParameter.AddParameterInteger("linemachineselection", inVo.LineMachineSelection);
            sqlParameter.AddParameterInteger("displayorder", inVo.DisplayOrder);
            sqlParameter.AddParameterString("faccd", UserData.GetUserData().FactoryCode);

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

            return(outVo);
        }
        public override ValueObject Execute(TransactionContext trxContext, ValueObject arg)
        {
            // arguments from Factory form
            FactoryVo inVo = (FactoryVo)arg;

            StringBuilder sqlQuery = new StringBuilder();

            sqlQuery.Clear();
            sqlQuery.Append("insert into m_factory");
            sqlQuery.Append(" ( ");
            sqlQuery.Append(" factory_cd, ");
            sqlQuery.Append(" factory_name, ");
            sqlQuery.Append(" registration_user_cd, ");
            sqlQuery.Append(" registration_date_time ");
            sqlQuery.Append(" ) ");
            sqlQuery.Append("VALUES	");
            sqlQuery.Append(" ( ");
            sqlQuery.Append(" :factcd,");
            sqlQuery.Append(" :factnm,");
            sqlQuery.Append(" :regusercd,");
            sqlQuery.Append(" now()");
            sqlQuery.Append(" ); ");

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

            DbParameterList sqlParameter = sqlCommandAdapter.CreateParameterList();

            sqlParameter.AddParameterString("factcd", inVo.FactoryCode);
            sqlParameter.AddParameterString("factnm", inVo.FactoryName);
            sqlParameter.AddParameterString("regusercd", inVo.RegistrationUserCode);
            //sqlParameter.AddParameterDateTime("regdt ", inVo.RegistrationDateTime);

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

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

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

            sql.Append(@"select case when count(*) = 0 then '110' else max(range_upper) end ca from  m_ovenmachine_range where 1=1 ");
            if (!String.IsNullOrEmpty(inVo.Model))
            {
                sql.Append(@" and range_model = :range_model ");
                sqlParameter.AddParameterString("range_model", inVo.Model);
            }
            if (!String.IsNullOrEmpty(inVo.Line))
            {
                sql.Append(@" and range_line = :range_line ");
                sqlParameter.AddParameterString("range_line", inVo.Line);
            }
            if (!String.IsNullOrEmpty(inVo.Barcode))
            {
                sql.Append(@" and range_barcode = :range_barcode ");
                sqlParameter.AddParameterString("range_barcode", inVo.Barcode);
            }
            sql.Append(" limit 1");

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

            //execute SQL
            dataReader = sqlCommandAdapter.ExecuteScalar(sqlParameter).ToString();

            von.Upper = dataReader;
            return(von);
        }
Ejemplo n.º 27
0
        public override ValueObject Execute(TransactionContext trxContext, ValueObject arg)
        {
            CountryLanguageVo inVo = (CountryLanguageVo)arg;

            StringBuilder sqlQuery = new StringBuilder();

            sqlQuery.Append("Insert into m_country_language");
            sqlQuery.Append(" ( ");
            sqlQuery.Append(" country, ");
            sqlQuery.Append(" language, ");
            sqlQuery.Append(" registration_user_cd, ");
            sqlQuery.Append(" registration_date_time ");
            sqlQuery.Append(" ) ");
            sqlQuery.Append("VALUES	");
            sqlQuery.Append(" ( ");
            sqlQuery.Append(" :country ,");
            sqlQuery.Append(" :language ,");
            sqlQuery.Append(" :registrationusercode ,");
            sqlQuery.Append(" now() ");
            sqlQuery.Append(" ); ");

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

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

            sqlParameter.AddParameterString("country", inVo.Country);
            sqlParameter.AddParameterString("language ", inVo.Language);
            sqlParameter.AddParameterString("registrationusercode ", inVo.RegistrationUserCode);
            //sqlParameter.AddParameterDateTime("registrationdatetime ", inVo.RegistrationDateTime);

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

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

            sql.Append(" insert into ");
            sql.Append(" m_work_content_type( ");
            sql.Append(" work_content_type_cd,  ");
            sql.Append(" work_content_type_name,  ");
            sql.Append(" registration_user_cd,  ");
            sql.Append(" registration_date_time,  ");
            sql.Append(" factory_cd) ");
            sql.Append(" values( ");
            sql.Append(" :prodution_work_content_type_cd, ");
            sql.Append(" :prodution_work_content_type_name, ");
            sql.Append(" :registration_user_cd, ");
            sql.Append(" :registrationdatetime, ");
            sql.Append(" :factorycd)");

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

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

            sqlParameter.AddParameterString("prodution_work_content_type_cd", inVo.ProdutionWorkContentTypeCode);
            sqlParameter.AddParameterString("prodution_work_content_type_name", inVo.ProdutionWorkContentTypeName);
            sqlParameter.AddParameterDateTime("registrationdatetime", trxContext.ProcessingDBDateTime);
            sqlParameter.AddParameterString("registration_user_cd", UserData.GetUserData().UserCode);
            sqlParameter.AddParameterString("factorycd", UserData.GetUserData().FactoryCode);
            //execute SQL

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

            return(outVo);
        }
        public override ValueObject Execute(TransactionContext trxContext, ValueObject arg)
        {
            StringBuilder sqlQuery = new StringBuilder();

            sqlQuery.Append("Select sapusr.mes_user_cd,sapusr.sap_user,sapusr.sap_password");
            sqlQuery.Append(" from m_sap_user sapusr");
            sqlQuery.Append(" inner join m_mes_user usr on usr.user_cd = sapusr.mes_user_cd");
            sqlQuery.Append(" inner join m_user_factory uf on usr.user_cd = uf.user_cd");
            sqlQuery.Append(" where usr.user_cd = :usercode ");
            sqlQuery.Append(" and uf.factory_cd = :factorycode ");

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

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

            sqlParameter.AddParameterString("usercode", trxContext.UserData.UserCode);

            sqlParameter.AddParameterString("factorycode", trxContext.UserData.FactoryCode);


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

            SapUserVo outVo = null;

            while (dataReader.Read())
            {
                outVo = new SapUserVo();

                outVo.MesUserCode = DBDataCheckHelper.ConvertDBNullToStringNull(dataReader["mes_user_cd"]);
                outVo.SapUser     = DBDataCheckHelper.ConvertDBNullToStringNull(dataReader["sap_user"]);
                outVo.SapPassWord = DBDataCheckHelper.ConvertDBNullToStringNull(dataReader["sap_password"]);
            }
            dataReader.Close();

            return(outVo);
        }
Ejemplo n.º 30
0
        public override ValueObject Execute(TransactionContext trxContext, ValueObject arg)
        {
            AuthorityControlVo inVo = (AuthorityControlVo)arg;

            StringBuilder sqlQuery = new StringBuilder();

            sqlQuery.Append("Update m_authority_control");
            sqlQuery.Append(" Set ");
            sqlQuery.Append(" authority_control_name = :authcontname ");

            if (inVo.ParentControlCode != null)
            {
                sqlQuery.Append(" , ");
                sqlQuery.Append(" parent_control_cd = :parentcontcd ");
            }
            sqlQuery.Append(" Where	");
            sqlQuery.Append(" authority_control_cd = :authcontcd ;");

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

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

            sqlParameter.AddParameterString("authcontcd", inVo.AuthorityControlCode);
            sqlParameter.AddParameterString("authcontname", inVo.AuthorityControlName);

            if (inVo.ParentControlCode != null)
            {
                sqlParameter.AddParameterString("parentcontcd", inVo.ParentControlCode);
            }

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

            return(outVo);
        }