Exemple #1
0
        public ActionResult DeletesupplierTypeConfirmed(int id)
        {
            SupplierTypeMaster suppliertype = db.SupplierTypeMasters.Find(id);

            db.SupplierTypeMasters.Remove(suppliertype);
            db.SaveChanges();
            ViewBag.SuccessMsg = "You have successfully deleted Supplier Type.";
            return(View("SupplierType", db.SupplierTypeMasters.ToList()));
        }
Exemple #2
0
        public ActionResult EditSupplierType(int id = 0)
        {
            SupplierTypeMaster Supmaster = db.SupplierTypeMasters.Find(id);

            if (Supmaster == null)
            {
                return(HttpNotFound());
            }
            return(View(Supmaster));
        }
Exemple #3
0
        public IHttpActionResult UpdateSupplierTypeMaster(SupplierTypeMaster supplierTypeMaster)
        {
            var isupdate = _supplierTypeRepository.UpdateSupplierType(supplierTypeMaster);

            if (isupdate == true)
            {
                return(Ok(isupdate));
            }
            return(BadRequest());
        }
Exemple #4
0
        public IHttpActionResult CreateSupplierType(SupplierTypeMaster supplierTypeMaster)
        {
            var isSave = _supplierTypeRepository.CreatedSupplierType(supplierTypeMaster);

            if (isSave == true)
            {
                return(Ok(isSave));
            }
            return(BadRequest());
        }
Exemple #5
0
 public ActionResult EditSupplierType(SupplierTypeMaster SupplierTypemaster)
 {
     if (ModelState.IsValid)
     {
         db.Entry(SupplierTypemaster).State = EntityState.Modified;
         db.SaveChanges();
         ViewBag.SuccessMsg = "You have successfully updated Role.";
         return(View("SupplierType", db.SupplierTypeMasters.ToList()));
     }
     return(View(SupplierTypemaster));
 }
        public bool UpdateSupplierType(SupplierTypeMaster supplierTypeMaster)
        {
            DateTime now = DateTime.Now;

            supplierTypeMaster.ModifiedDate = now;
            int rowsAffected = this._db.Execute("UPDATE SupplierTypeMaster SET Name = @Name ,Description = @Description,ModifiedBy=1, ModifiedDate = @ModifiedDate WHERE Id = " +
                                                supplierTypeMaster.Id, supplierTypeMaster);

            if (rowsAffected > 0)
            {
                return(true);
            }

            return(false);
        }
        public bool CreatedSupplierType(SupplierTypeMaster supplierTypeMaster)
        {
            DateTime now = DateTime.Now;

            supplierTypeMaster.CreatedDate  = now;
            supplierTypeMaster.ModifiedDate = now;

            int rowsAffected = this._db.Execute(@"INSERT SupplierTypeMaster(Name,Description,IsActive,CreatedBy,CreatedDate,ModifiedBy,ModifiedDate) values (@Name,@Description,1,1,@CreatedDate,1,@ModifiedDate)",

                                                new { Name = supplierTypeMaster.Name, Description = supplierTypeMaster.Description, IsActive = 1, CreatedBy = 1, CreatedDate = supplierTypeMaster.CreatedDate, ModifiedBy = 1, ModifiedDate = supplierTypeMaster.ModifiedDate });

            if (rowsAffected > 0)
            {
                return(true);
            }
            return(false);
        }
Exemple #8
0
        public ActionResult CreateSupplierType(SupplierTypeMaster suppliertypemaster)
        {
            if (ModelState.IsValid)
            {
                var query = (from t in db.SupplierTypeMasters where t.SupplierType == suppliertypemaster.SupplierType select t).ToList();

                if (query.Count > 0)
                {
                    ViewBag.SuccessMsg = "Supplier Type already exist";
                    return(View());
                }
                db.SupplierTypeMasters.Add(suppliertypemaster);
                db.SaveChanges();
                ViewBag.SuccessMsg = "You have successfully added SupplierType.";
                return(View("SupplierType", db.SupplierTypeMasters.ToList()));
            }

            return(View(suppliertypemaster));
        }