public HttpResponseMessage ModifyHod_Allocation(ModifyHod_AllocationDTO obj) { HttpResponseMessage message; try { Hod_AllocationDAL dal = new Hod_AllocationDAL(); var dynobj = new { result = dal.ModifyHod_Allocation(obj) }; message = Request.CreateResponse(HttpStatusCode.OK, dynobj); } catch (Exception ex) { message = Request.CreateResponse(HttpStatusCode.BadRequest, new { msgText = "something Wrong.Try Again!" }); } return(message); }
public bool ModifyHod_Allocation(ModifyHod_AllocationDTO obj) { bool res = false; obj.ModifiedBy = "1002"; SqlCommand cmd = new SqlCommand("sp_ModifyHod_Allocation"); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@p_HodAllocationId", obj.HodAllocationId); cmd.Parameters.AddWithValue("@p_departmentId", obj.DepartmentId); cmd.Parameters.AddWithValue("@p_EmployeeId", obj.EmployeeId); cmd.Parameters.AddWithValue("@p_ActionBy", obj.ModifiedBy); int result = new DBlayer().ExecuteNonQuery(cmd); if (result != Int32.MaxValue) { res = true; } return(res); }