Ejemplo n.º 1
0
        public ActionResult AddItemUOM(int currentOffset)
        {
            IngredientUOMModels itemUOM = new IngredientUOMModels();

            itemUOM.OffSet = currentOffset;
            return(PartialView("_ItemUOM", itemUOM));
        }
Ejemplo n.º 2
0
        public bool Update(IngredientUOMModels model, ref string msg)
        {
            bool result = true;

            using (NuWebContext cxt = new NuWebContext())
            {
                try
                {
                    var itemUpdate = (from tb in cxt.I_Ingredient_UOM
                                      where tb.Id == model.Id
                                      select tb).FirstOrDefault();

                    itemUpdate.IngredientId = model.IngredientId;
                    itemUpdate.UOMId        = model.UOMId;
                    itemUpdate.BaseUOM      = model.BaseUOM;
                    itemUpdate.ReceivingQty = model.ReceivingQty;

                    itemUpdate.CreatedBy   = model.CreatedBy;
                    itemUpdate.CreatedDate = model.CreatedDate;
                    itemUpdate.UpdatedBy   = model.UpdatedBy;
                    itemUpdate.UpdatedDate = model.UpdatedDate;
                    itemUpdate.IsActived   = model.IsActived;

                    cxt.SaveChanges();
                }
                catch (Exception ex)
                {
                    _logger.Error(ex);
                    result = false;
                }
                finally
                {
                    if (cxt != null)
                    {
                        cxt.Dispose();
                    }
                }
            }
            return(result);
        }