Esempio n. 1
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(Mod_TPB_STA_WH model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update TPB_STA_WH set ");
            strSql.Append("C_ID=:C_ID,");
            strSql.Append("C_LINE_CODE=:C_LINE_CODE,");
            strSql.Append("C_SLABWH_CODE=:C_SLABWH_CODE,");
            strSql.Append("D_START_DATE=:D_START_DATE,");
            strSql.Append("D_END_DATE=:D_END_DATE,");
            strSql.Append("N_STATUS=:N_STATUS,");
            strSql.Append("C_REMARK=:C_REMARK,");
            strSql.Append("C_EMP_ID=:C_EMP_ID,");
            strSql.Append("D_MOD_DT=:D_MOD_DT");
            strSql.Append(" where ");
            OracleParameter[] parameters =
            {
                new OracleParameter(":C_ID",          OracleDbType.Varchar2, 100),
                new OracleParameter(":C_LINE_CODE",   OracleDbType.Varchar2, 100),
                new OracleParameter(":C_SLABWH_CODE", OracleDbType.Varchar2, 100),
                new OracleParameter(":D_START_DATE",  OracleDbType.Date),
                new OracleParameter(":D_END_DATE",    OracleDbType.Date),
                new OracleParameter(":N_STATUS",      OracleDbType.Decimal,    1),
                new OracleParameter(":C_REMARK",      OracleDbType.Varchar2, 200),
                new OracleParameter(":C_EMP_ID",      OracleDbType.Varchar2, 100),
                new OracleParameter(":D_MOD_DT",      OracleDbType.Date)
            };
            parameters[0].Value = model.C_ID;
            parameters[1].Value = model.C_LINE_CODE;
            parameters[2].Value = model.C_SLABWH_CODE;
            parameters[3].Value = model.D_START_DATE;
            parameters[4].Value = model.D_END_DATE;
            parameters[5].Value = model.N_STATUS;
            parameters[6].Value = model.C_REMARK;
            parameters[7].Value = model.C_EMP_ID;
            parameters[8].Value = model.D_MOD_DT;

            int rows = DbHelperOra.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Mod_TPB_STA_WH DataRowToModel(DataRow row)
        {
            Mod_TPB_STA_WH model = new Mod_TPB_STA_WH();

            if (row != null)
            {
                if (row["C_ID"] != null)
                {
                    model.C_ID = row["C_ID"].ToString();
                }
                if (row["C_LINE_CODE"] != null)
                {
                    model.C_LINE_CODE = row["C_LINE_CODE"].ToString();
                }
                if (row["C_SLABWH_CODE"] != null)
                {
                    model.C_SLABWH_CODE = row["C_SLABWH_CODE"].ToString();
                }
                if (row["D_START_DATE"] != null && row["D_START_DATE"].ToString() != "")
                {
                    model.D_START_DATE = DateTime.Parse(row["D_START_DATE"].ToString());
                }
                if (row["D_END_DATE"] != null && row["D_END_DATE"].ToString() != "")
                {
                    model.D_END_DATE = DateTime.Parse(row["D_END_DATE"].ToString());
                }
                if (row["N_STATUS"] != null && row["N_STATUS"].ToString() != "")
                {
                    model.N_STATUS = decimal.Parse(row["N_STATUS"].ToString());
                }
                if (row["C_REMARK"] != null)
                {
                    model.C_REMARK = row["C_REMARK"].ToString();
                }
                if (row["C_EMP_ID"] != null)
                {
                    model.C_EMP_ID = row["C_EMP_ID"].ToString();
                }
                if (row["D_MOD_DT"] != null && row["D_MOD_DT"].ToString() != "")
                {
                    model.D_MOD_DT = DateTime.Parse(row["D_MOD_DT"].ToString());
                }
            }
            return(model);
        }
Esempio n. 3
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public bool Add(Mod_TPB_STA_WH model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into TPB_STA_WH(");
            strSql.Append("C_LINE_CODE,C_SLABWH_CODE,D_START_DATE,D_END_DATE,N_STATUS,C_REMARK,C_EMP_ID,D_MOD_DT)");
            strSql.Append(" values (");
            strSql.Append(":C_LINE_CODE,:C_SLABWH_CODE,:D_START_DATE,:D_END_DATE,:N_STATUS,:C_REMARK,:C_EMP_ID,:D_MOD_DT)");
            OracleParameter[] parameters =
            {
                new OracleParameter(":C_LINE_CODE",   OracleDbType.Varchar2, 100),
                new OracleParameter(":C_SLABWH_CODE", OracleDbType.Varchar2, 100),
                new OracleParameter(":D_START_DATE",  OracleDbType.Date),
                new OracleParameter(":D_END_DATE",    OracleDbType.Date),
                new OracleParameter(":N_STATUS",      OracleDbType.Decimal,    1),
                new OracleParameter(":C_REMARK",      OracleDbType.Varchar2, 200),
                new OracleParameter(":C_EMP_ID",      OracleDbType.Varchar2, 100),
                new OracleParameter(":D_MOD_DT",      OracleDbType.Date)
            };
            parameters[0].Value = model.C_LINE_CODE;
            parameters[1].Value = model.C_SLABWH_CODE;
            parameters[2].Value = model.D_START_DATE;
            parameters[3].Value = model.D_END_DATE;
            parameters[4].Value = model.N_STATUS;
            parameters[5].Value = model.C_REMARK;
            parameters[6].Value = model.C_EMP_ID;
            parameters[7].Value = model.D_MOD_DT;

            int rows = DbHelperOra.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Esempio n. 4
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Mod_TPB_STA_WH GetModel()
        {
            //该表无主键信息,请自定义主键/条件字段
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select C_ID,C_LINE_CODE,C_SLABWH_CODE,D_START_DATE,D_END_DATE,N_STATUS,C_REMARK,C_EMP_ID,D_MOD_DT from TPB_STA_WH ");
            strSql.Append(" where ");
            OracleParameter[] parameters =
            {
            };

            Mod_TPB_STA_WH model = new Mod_TPB_STA_WH();
            DataSet        ds    = DbHelperOra.Query(strSql.ToString(), parameters);

            if (ds.Tables[0].Rows.Count > 0)
            {
                return(DataRowToModel(ds.Tables[0].Rows[0]));
            }
            else
            {
                return(null);
            }
        }
Esempio n. 5
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(Mod_TPB_STA_WH model)
 {
     return(dal.Update(model));
 }
Esempio n. 6
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public bool Add(Mod_TPB_STA_WH model)
 {
     return(dal.Add(model));
 }