Ejemplo n.º 1
0
        /// <summary>
        /// 新增班次內工程準備工作額外項目時間記錄
        /// </summary>
        /// <param name="splID">班次內工程ID</param>
        /// <param name="model">model</param>
        /// <param name="tran">SqlTransaction</param>
        /// <returns></returns>
        public bool AddProjectPreJobExtraTime(Guid splID, ProjectPrepareJobExtraTime model, SqlTransaction tran)
        {
            try
            {
                MappingHelper.HandleNullProperty(model);

                StringBuilder strSql = new StringBuilder();
                strSql.Append("insert into ProjectPreJobExtraTime_ppet(");
                strSql.Append("ppet_SPLID, ppet_cExtraItemCode, ppet_cExtraItemName, ppet_iExtraItemTime)");
                strSql.Append(" values (");
                strSql.Append("@ppet_SPLID, @ppet_cExtraItemCode, @ppet_cExtraItemName, @ppet_iExtraItemTime)");
                SqlParameter[] parameters = {
                    DbHelperSQL.MakeInParam("@ppet_SPLID", SqlDbType.UniqueIdentifier,16, splID),
                    DbHelperSQL.MakeInParam("@ppet_cExtraItemCode", SqlDbType.VarChar,50, model.ExtraItemCode),
                    DbHelperSQL.MakeInParam("@ppet_cExtraItemName", SqlDbType.VarChar,50, model.ExtraItemName),
                    DbHelperSQL.MakeInParam("@ppet_iExtraItemTime", SqlDbType.Int,4, model.ExtraItemTime)};

                DbHelperSQL.ExecuteNonQuery(tran, CommandType.Text, strSql.ToString(), parameters);

                return true;
            }
            catch (Exception ex) { throw ex; }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 創建工程準備工作額外項目信息
        /// </summary>
        /// <param name="itemCode"></param>
        /// <param name="itemName"></param>
        /// <returns></returns>
        ProjectPrepareJobExtraTime CreateExtraItemInfo(string itemCode, string itemName)
        {
            ProjectPrepareJobExtraTime itemInfo = new ProjectPrepareJobExtraTime();
            itemInfo.ExtraItemCode = itemCode;
            itemInfo.ExtraItemName = itemName;

            return itemInfo;
        }