private CertainValueCertainProductDiscountDTO Map(tblCertainValueCertainProductDiscount tbl) { var dto = new CertainValueCertainProductDiscountDTO { MasterId = tbl.id, DateCreated = tbl.IM_DateCreated, DateLastUpdated = tbl.IM_DateLastUpdated, StatusId = tbl.IM_Status, InitialValue = tbl.Value, CertainValueCertainProductDiscountItems = new List<CertainValueCertainProductDiscountItemDTO>() }; foreach (var item in tbl.tblCertainValueCertainProductDiscountItem.Where(n => n.IM_Status == (int)EntityStatus.Active)) { var dtoitem = new CertainValueCertainProductDiscountItemDTO { CertainValueCertainProductDiscountId = item.CertainValueCertainDiscountID, MasterId = item.id, DateCreated = item.IM_DateCreated, DateLastUpdated = item.IM_DateLastUpdated, StatusId = item.IM_Status, CertainValue = item.Value, EffectiveDate = item.EffectiveDate, EndDate = item.EndDate ?? DateTime.Now, Quantity = item.Quantity, ProductMasterId = item.Product }; dto.CertainValueCertainProductDiscountItems.Add(dtoitem); } return dto; }
/// <summary> /// Create a new tblCertainValueCertainProductDiscount object. /// </summary> /// <param name="id">Initial value of the id property.</param> /// <param name="value">Initial value of the Value property.</param> /// <param name="iM_DateCreated">Initial value of the IM_DateCreated property.</param> /// <param name="iM_DateLastUpdated">Initial value of the IM_DateLastUpdated property.</param> /// <param name="iM_Status">Initial value of the IM_Status property.</param> public static tblCertainValueCertainProductDiscount CreatetblCertainValueCertainProductDiscount(global::System.Guid id, global::System.Decimal value, global::System.DateTime iM_DateCreated, global::System.DateTime iM_DateLastUpdated, global::System.Int32 iM_Status) { tblCertainValueCertainProductDiscount tblCertainValueCertainProductDiscount = new tblCertainValueCertainProductDiscount(); tblCertainValueCertainProductDiscount.id = id; tblCertainValueCertainProductDiscount.Value = value; tblCertainValueCertainProductDiscount.IM_DateCreated = iM_DateCreated; tblCertainValueCertainProductDiscount.IM_DateLastUpdated = iM_DateLastUpdated; tblCertainValueCertainProductDiscount.IM_Status = iM_Status; return tblCertainValueCertainProductDiscount; }
/// <summary> /// Deprecated Method for adding a new object to the tblCertainValueCertainProductDiscount EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddTotblCertainValueCertainProductDiscount(tblCertainValueCertainProductDiscount tblCertainValueCertainProductDiscount) { base.AddObject("tblCertainValueCertainProductDiscount", tblCertainValueCertainProductDiscount); }