My update phase in #dal
public int UpdateOrEditEmployee(string propertyName,string value, int empid)
{
try
{
using (AdventureWorksEntities empDbentity = new AdventureWorksEntities())
{
var status = false;
var message = "";
var users = empDbentity.tblEmployees.Find(empid);
if(users!=null)
{
empDbentity.Entry(users).Property(propertyName).CurrentValue = value;
empDbentity.SaveChanges();
status = true;
}
else
{
message = "Error!";
}
#bal
 
public int UpdateOrEditEmployee(string value,int empid,string propertyName)
{
try
{
return empdata.UpdateOrEditEmployee(propertyName, value, empid);
}
catch(Exception ex)
{
throw ex;
}
}
#controller
[HttpPost]
public ActionResult UpdateOrEditEmployee(string propertyName,string value, int id)
{
var status=false;
var message="";
try
{
EmployeeBusiness EmpBusiness = new EmployeeBusiness();
var empid = EmpBusiness.UpdateOrEditEmployee(propertyName, id, value);
var response = new { value = value, status = status, message = message };
JObject o = JObject.FromObject(response);
return Content(o.ToString());
return View();
}
 
 
 
#View for the grid
 
@using PagedList;
@using PagedList.Mvc;
@model IPagedList
@{
Layout = null;
ViewBag.Title = "EmployeeDetails";
}
EmployeeForm
Registered Employess
@foreach (var item in Model)
{
@*
*@
}
EmpLoyee IDEmployee NameDesignationEmployee ImageSalaryEmailDepartment
@Html.DisplayFor(model => item.Empid, new { data_id = "@item.Empid", data_propertyname = "EmpId", @class = "edit" }) @Html.DisplayFor(model => item.Empname, new { data_id = "@item.Empid", data_propertyname = "EmpName", @class = "edit" }) @Html.DisplayFor(model => item.Designation, new { data_id = "@item.Empid", data_propertyname = "Designation", @class = "edit" })
@{
var base64 = Convert.ToBase64String(item.ImageData);
var imagesrc = string.Format("data:image/jpeg;base64,{0}", base64);
}
@Html.DisplayFor(model => item.Salary, new { data_id = "@item.Empid", data_propertyname = "Salary", @class = "edit" }) @Html.DisplayFor(model => item.Email, new { data_id = "@item.Empid", data_propertyname = "Email", @class = "edit" })@Html.DisplayFor(model => item.Department, new { data_id = "@item.Empid", data_propertyname = "Department", @class = "edit" })
@Html.PagedListPager(Model, page => Url.Action("EmployeeDetails", new { page }))
@section scripts{--------this is the section iam using for editing the cell but its not hitting can anyone help?
}