Beispiel #1
0
        public void UpdateItemWarehous(St_ItemWarehouse ObjUpdate)
        {
            var ObjToUpdate = _context.St_ItemWarehouses.FirstOrDefault(m => m.CompanyID == ObjUpdate.CompanyID && m.StockCode == ObjUpdate.StockCode && m.ItemCode == ObjUpdate.ItemCode);

            if (ObjToUpdate != null)
            {
                ObjToUpdate.StockMaximumItemNo = ObjUpdate.StockMaximumItemNo;
                ObjToUpdate.StockMinimumItemNo = ObjUpdate.StockMinimumItemNo;
            }
        }
Beispiel #2
0
        public JsonResult UpdateDetermineWarehouseQuantities(St_ItemCardVM ObjUpdate)
        {
            MsgUnit Msg = new MsgUnit();

            try
            {
                var userId   = User.Identity.GetUserId();
                var UserInfo = _unitOfWork.User.GetMyInfo(userId);
                var ObjUpdateSt_ItemWarehouse = new St_ItemWarehouse();
                ObjUpdateSt_ItemWarehouse.CompanyID          = UserInfo.fCompanyId;
                ObjUpdateSt_ItemWarehouse.StockCode          = ObjUpdate.StockCode;
                ObjUpdateSt_ItemWarehouse.ItemCode           = ObjUpdate.UpdateItemCode;
                ObjUpdateSt_ItemWarehouse.StockMinimumItemNo = ObjUpdate.StockMinimumItemNo;
                ObjUpdateSt_ItemWarehouse.StockMaximumItemNo = ObjUpdate.StockMaximumItemNo;
                if (!ModelState.IsValid)
                {
                    string Err    = " ";
                    var    errors = ModelState.Values.SelectMany(v => v.Errors);
                    foreach (ModelError error in errors)
                    {
                        Err = Err + error.ErrorMessage + " * ";
                    }

                    Msg.Msg  = Resources.Resource.SomthingWentWrong + " : " + Err;
                    Msg.Code = 0;
                    return(Json(Msg, JsonRequestBehavior.AllowGet));
                }
                _unitOfWork.St_ItemCard.UpdateItemWarehous(ObjUpdateSt_ItemWarehouse);
                _unitOfWork.Complete();

                Msg.Code = 1;
                Msg.Msg  = Resources.Resource.UpdatedSuccessfully;
                return(Json(Msg, JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                Msg.Msg  = Resources.Resource.SomthingWentWrong + " : " + ex.Message.ToString();
                Msg.Code = 0;
                return(Json(Msg, JsonRequestBehavior.AllowGet));
            }
        }
Beispiel #3
0
 public void AddItemWarehous(St_ItemWarehouse ObjSave)
 {
     _context.St_ItemWarehouses.Add(ObjSave);
 }