public bool InsertServiceMaster(ServiceMasterInsertDTO objServiceMater) { bool res = false; SqlCommand SqlCmd = new SqlCommand("spInsertServices"); SqlCmd.CommandType = CommandType.StoredProcedure; SqlCmd.Parameters.AddWithValue("@Name", objServiceMater.Name); SqlCmd.Parameters.AddWithValue("@SACCode", objServiceMater.SACCode); SqlCmd.Parameters.AddWithValue("@EmployeeType", objServiceMater.EmployeeType); SqlCmd.Parameters.AddWithValue("@CreatedBy", objServiceMater.CreatedBy); int result = new DbLayer().ExecuteNonQuery(SqlCmd); if (result != Int32.MaxValue) { res = true; } return(res); }
public HttpResponseMessage CreateServiceMaster(ServiceMasterInsertDTO objServiceMaster) { HttpResponseMessage message; try { // ServiceMasterDataAccessLayer dal = new ServiceMasterDataAccessLayer(); var dynObj = new { result = _Service.InsertServiceMaster(objServiceMaster) }; message = Request.CreateResponse(HttpStatusCode.OK, dynObj); } catch (Exception ex) { message = Request.CreateResponse(HttpStatusCode.BadRequest, new { msgText = "Something wrong. Try Again!" }); ErrorLog.CreateErrorMessage(ex, "ServiceMaster", "CreateRequirementDetail"); } return(message); }