/// <summary>
        /// This function insert a new packing rule.
        /// </summary>
        /// <param name="model"></param>
        public void InsertPackingRule(StyleSkuCase model)
        {
            const string QUERY = @"

 MERGE INTO <proxy />PACKING_RULE S
                USING DUAL
                ON (S.STYLE = :STYLE AND S.CASE_ID = :CASE_ID)
                WHEN MATCHED THEN
                  UPDATE
                     SET S.IGNORE_FLAG         = :IGNORE_FLAG,
                         S.MODIFIED_BY         = :CREATED_BY,
                         S.MODIFIED_DATE       = SYSDATE
                   WHERE S.CASE_ID = :CASE_ID
                        AND S.STYLE   =  :STYLE
                WHEN NOT MATCHED THEN
                  INSERT
                    (PACKING_RULE_ID,STYLE, 
                      CASE_ID, 
                      IGNORE_FLAG,
                      CREATED_BY,
                      DATE_CREATED)
                   VALUES
                     (SEQ_PACKING_RULE.NEXTVAL,
                       :STYLE,
                       :CASE_ID,
                       :IGNORE_FLAG,
                       :CREATED_BY,
                        SYSDATE)
            ";

            var binder = SqlBinder.Create().Parameter("STYLE", model.Style)
                         .Parameter("CASE_ID", model.CaseId)
                         .Parameter("IGNORE_FLAG", model.IgnoreFlag ? "Y" : "")
                         .Parameter("CREATED_BY", HttpContext.Current.User.Identity.Name);

            _db.ExecuteNonQuery(QUERY, binder);
        }
Пример #2
0
 public void InsertPackingRule(StyleSkuCase model)
 {
     _repos.InsertPackingRule(model);
 }