Ejemplo n.º 1
0
        public int Update(Data.Models.Indent Indent)
        {
            Data.Models.Indent oldIn = _IndentRepository.Table.FirstOrDefault(w => w.Id == Indent.Id);

            if (oldIn != null)
            {
                //oldIn.PlantId = Indent.PlantId;
                //oldIn.ItemName = Indent.ItemName;
                //oldIn.Description = Indent.Description;
                //oldIn.Specification = Indent.Specification;
                //oldIn.QtyInStock = Indent.QtyInStock;
                //oldIn.QtyNeeded = Indent.QtyNeeded;
                //oldIn.UnitPrice = Indent.UnitPrice;
                //oldIn.TotalAmount = Indent.TotalAmount;
                //oldIn.Priority = Indent.Priority;
                //oldIn.PreferredVendorId = Indent.PreferredVendorId;


                _IndentRepository.Update(oldIn);
                return(oldIn.Id);
            }
            else
            {
                return(0);
            }
        }
Ejemplo n.º 2
0
        public JsonResult GetIndentById(int IndentId)
        {
            GenerateIndentViewModel model = new GenerateIndentViewModel();

            Data.Models.Indent objIn = this._IndentsServices.GetForId(IndentId);

            if (objIn != null)
            {
                model.Id              = objIn.Id;
                model.IndentNo        = objIn.IndentNo;
                model.Priority        = objIn.Priority;
                model.BudgetType      = objIn.IndentBudget.BudgetType;
                model.BudgetId        = objIn.BudgetId;
                model.Note            = objIn.Note;
                model.Subject         = objIn.Subject;
                model.RequisitionType = objIn.RequisitionType;
                model.BudgetHead      = objIn.BudgetHead;
                model.StatusId        = objIn.StatusId;
                model.PoDate          = objIn.PoDate;
                model.DeliveryDate    = objIn.DeliveryDate;
                model.PoNo            = objIn.PoNo;
                model.PoAmount        = objIn.PoAmount;
            }
            return(Json(model, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 3
0
        public int[] Delete(int[] ids)
        {
            List <int> indentIds = new List <int>();

            foreach (int id in ids)
            {
                Data.Models.Indent Indent = _IndentRepository.Table.FirstOrDefault(w => w.Id == id);
                _IndentRepository.Delete(Indent);
            }
            return(indentIds.ToArray());
        }
Ejemplo n.º 4
0
        public JsonResult GetPOById(int Id)
        {
            IndentsViewModel model = new IndentsViewModel();

            Data.Models.Indent objPO = this._indentService.GetForId(Id);

            if (objPO != null)
            {
                model.ItemName      = objPO.ItemName;
                model.Specification = objPO.Specification;
                model.QtyInStock    = objPO.QtyInStock;
                model.Priority      = objPO.Priority;
                model.PlantId       = objPO.PlantId;
                model.UnitPrice     = objPO.UnitPrice;
                model.UnitPrice     = objPO.TotalAmount;
                model.QtyNeeded     = objPO.QtyNeeded;
                model.IndentNo      = objPO.IndentNo;
            }
            return(Json(model, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 5
0
        public JsonResult GetIndentById(int Id)
        {
            IndentsViewModel model = new IndentsViewModel();

            Data.Models.Indent objIn = this._indentService.GetForId(Id);

            if (objIn != null)
            {
                model.SiteId = 1;
                // model.PlantId = objIn.PlantId;
                //model.ItemName = objIn.ItemName;
                //model.Specification = objIn.Specification;
                //model.Description = objIn.Description;
                //model.QtyInStock = objIn.QtyInStock;
                //model.QtyNeeded = objIn.QtyNeeded;
                //model.UnitPrice = objIn.UnitPrice;
                //model.TotalAmount = objIn.TotalAmount;
                //model.Priority = objIn.Priority;
                //model.PreferredVendorId = objIn.PreferredVendorId;
                //model.VendorCategoryId = objIn.Vendor.CategoryId;
            }
            return(Json(model, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 6
0
        public JsonResult SaveIndent(Indent Indent)
        {
            var result = new { Success = "true", Message = "Success" };

            try
            {
                Indent Indentobj = new Data.Models.Indent();

                if (Indent.Id == 0)
                {
                    this._indentService.Add(Indent);
                }
                else
                {
                    this._indentService.Update(Indent);
                }
            }
            catch (Exception ex)
            {
                result = new { Success = "false", Message = "Problem in adding Indent.Please contact Admin." };
            }

            return(Json(result, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 7
0
 public int Add(Data.Models.Indent Indent)
 {
     _IndentRepository.Insert(Indent);
     return(Indent.Id);
 }