public dynamic AddEditSupportUpdate(SupportUpdateType supportDetails) { string Status = ""; try { using (var connection = new SqlConnection(connectionString)) { connection.Execute(@"SupportUpdateDetails", new { SupportUpdateID = (int)supportDetails.SupportUpdateID, //supportDetails.SupportUpdateID == null ? null : (int)supportDetails.SupportUpdateID, ZD_ID = (int)supportDetails.ZD_ID, ZD_Descr = (string)supportDetails.ZD_Descr, PriorityID = (int)supportDetails.PriorityID, CurrentStatusID = (int)supportDetails.CurrentStatusID, TimeSpent = (int)supportDetails.TimeSpent, DateWorked = (DateTime?)supportDetails.DateWorked, /*.ToString("yyyy-MM-dd"),*/ ClientID = (int)supportDetails.ClientID, StaffID = (int)supportDetails.StaffID }, commandType: CommandType.StoredProcedure); } Status = "Success"; return(Status); } catch (Exception ex) { Status = "Internal server error"; return(Status); } }
public IActionResult Post([FromBody] SupportUpdateType support) { return(Ok(_supportProvider.AddEditSupportUpdate(support))); }