/// <summary>
 /// This function maps from SkuCAse entity to SelectListItem
 /// </summary>
 /// <param name="skuCase"></param>
 /// <returns></returns>
 private SelectListItem Map(SkuCase skuCase)
 {
     return(new SelectListItem
     {
         Text = skuCase.CaseId + ":" + skuCase.Description,
         Value = skuCase.CaseId
     });
 }
Example #2
0
 internal SkuCaseModel(SkuCase entity)
 {
     this.CaseId           = entity.CaseId;
     this.Description      = entity.Description;
     this.EmptyWeight      = entity.EmptyWeight;
     this.IsAvailable      = entity.IsAvailable;
     this.MaxContentVolume = entity.MaxContentVolume;
     this.OuterCubeVolume  = entity.OuterCubeVolume;
 }
        /// <summary>
        /// This function update property of passed SKU case.
        /// </summary>
        public void AddorUpdateSkuCase(SkuCase skuCase)
        {
            const string QUERY  = @"
                MERGE INTO <proxy />SKUCASE S
                USING DUAL
                ON (S.CASE_ID = :CASE_ID)
                WHEN MATCHED THEN
                  UPDATE
                     SET S.SHORT_DESCRIPTION   = :SHORT_DESCRIPTION,
                         S.EMPTY_WT            = :EMPTY_WT,
                         S.MAX_CONTENT_VOLUME  = :MAX_CONTENT_VOLUME,
                         S.UNAVAILABILITY_FLAG = :UNAVAILABILITY_FLAG,
                         S.OUTER_CUBE_VOLUME   = :OUTER_CUBE_VOLUME,
                         S.MODIFIED_BY         = :MODIFIED_BY,
                         S.DATE_MODIFIED       = SYSDATE
                   WHERE S.CASE_ID = :CASE_ID
                WHEN NOT MATCHED THEN
                  INSERT
                    (CASE_ID,
                     SHORT_DESCRIPTION,
                     EMPTY_WT,
                     MAX_CONTENT_VOLUME,
                     UNAVAILABILITY_FLAG,
                     DATE_CREATED,
                     CREATED_BY,
                     OUTER_CUBE_VOLUME)
                  VALUES
                    (:CASE_ID,
                     :SHORT_DESCRIPTION,
                     :EMPTY_WT,
                     :MAX_CONTENT_VOLUME,
                     :UNAVAILABILITY_FLAG,
                      SYSDATE,
                     :CREATED_BY,
                     :OUTER_CUBE_VOLUME)
            ";
            var          binder = SqlBinder.Create().Parameter("SHORT_DESCRIPTION", skuCase.Description)
                                  .Parameter("EMPTY_WT", skuCase.EmptyWeight)
                                  .Parameter("MAX_CONTENT_VOLUME", skuCase.MaxContentVolume)
                                  .Parameter("UNAVAILABILITY_FLAG", skuCase.IsAvailable ? "" : "Y")
                                  .Parameter("CASE_ID", skuCase.CaseId)
                                  .Parameter("OUTER_CUBE_VOLUME", skuCase.OuterCubeVolume)
                                  .Parameter("MODIFIED_BY", HttpContext.Current.User.Identity.Name)
                                  .Parameter("CREATED_BY", HttpContext.Current.User.Identity.Name);

            _db.ExecuteNonQuery(QUERY, binder);
        }
Example #4
0
 /// <summary>
 /// This function updates an SKU case property.
 /// </summary>
 /// <param name="skuCase"> </param>
 public void AddorUpdateSkuCase(SkuCase skuCase)
 {
     _repos.AddorUpdateSkuCase(skuCase);
 }