public int Insert(Company_DTO entity) { companyRep.AddInputParameters("@companyName", entity.companyName); companyRep.AddInputParameters("@director", entity.director); companyRep.AddInputParameters("@fulladdress", entity.fulladdress); return(companyRep.IUD("sp_Company_Insert", CommandType.StoredProcedure)); }
public ActionResult SaveChanges(Company_DTO entity) { if (ModelState.IsValid) { companyServ.Update(entity); return(Json(new { success = true, mesaj = "Redaktə edildi" }, JsonRequestBehavior.AllowGet)); } else { return(Json(new { success = false, mesaj = "Məlumatları doldurun!!!" }, JsonRequestBehavior.AllowGet)); } }
public ActionResult SaveRecord(Company_DTO entity) { if (ModelState.IsValid) { companyServ.Insert(entity); return(Json(new { success = true, mesaj = "Əlavə olundu" }, JsonRequestBehavior.AllowGet)); } else { return(Json(new { success = false, mesaj = "Məlumatları doldurun!!!" }, JsonRequestBehavior.AllowGet)); } }
public Company_DTO GetSingleRecord(int id) { companyRep.AddInputParameters("@id", id); DataTable dt = companyRep.GetList("sp_Company_GetByID", CommandType.StoredProcedure); Company_DTO singleRow = new Company_DTO(); singleRow.id = Convert.ToInt32(dt.Rows[0]["id"]); singleRow.companyName = dt.Rows[0]["companyName"].ToString(); singleRow.director = dt.Rows[0]["director"].ToString(); singleRow.fulladdress = dt.Rows[0]["fulladdress"].ToString(); return(singleRow); }
public int Delete(Company_DTO entity) { companyRep.AddInputParameters("@id", entity.id); return(companyRep.IUD("sp_Company_DeleteByID", CommandType.StoredProcedure)); }