//------------------------------------------------------------------------------------- //---------------------------- Insert Grievance Details ------------------------------- public static int InsertGrievanceDetails(Grievance objGrievance) { int output = 0; string sql = ""; SqlConnection con = null; SqlCommand cmd = null; try { sql = "insert into grievance_table(customerId,grievanceDetail,grievanceID,title,status) values("; sql = sql + "'" + objGrievance.CustomerId + "',"; sql = sql + "'" + objGrievance.GrievanceDetail + "',"; sql = sql + "'" + objGrievance.GrievanceID + "',"; sql = sql + "'" + objGrievance.Title + "',"; sql = sql + "'" + objGrievance.Status + "')"; con = DBHelper.GetConnection(); con.Open(); cmd = new SqlCommand(sql, con); output = cmd.ExecuteNonQuery(); } catch (Exception ex) { Console.Out.WriteLine("Error : GrievanceDL : InsertGrievanceDetails() " + ex.Message.ToString()); } finally { con.Close(); cmd.Dispose(); } return(output); }
//------------------------------------------------------------------------------------------------ //------------------ Update Status of the Grievance Applied -------------------------------------- public static void InsertStatus(Grievance objectGrievane) { string sql = ""; SqlConnection con = null; SqlCommand cmd = null; try { sql = "update grievance_table set status=" + objectGrievane.Status + "where grievanceID=" + objectGrievane.GrievanceID; con = DBHelper.GetConnection(); con.Open(); cmd = new SqlCommand(sql, con); } catch (Exception ex) { Console.Out.WriteLine("Error : GrievanceDL : InsertStatus() " + ex.Message.ToString()); } finally { con.Close(); cmd.Dispose(); string Title = "Grievance Status"; MessageBox.Show("Grievance Status is Updated", Title); } }
//------------------------------------------------------------------------------- //--------------------------- Insert Grievance Details -------------------------- private void buttonsubmit_Click(object sender, EventArgs e) { Grievance objGrievance = null; objGrievance = new Grievance(); int output = 0; try { objGrievance.GrievanceID = textBoxGrievanceID.Text; objGrievance.CustomerId = textBoxcustomerid.Text; objGrievance.GrievanceDetail = richTextBoxGrievance.Text; objGrievance.Title = textBoxTitle.Text; objGrievance.Status = "Submitted"; DateTime today = DateTime.Today; output = GrievanceBL.InsertGrievanceDetails(objGrievance); if (output > 0) { MessageBox.Show("DATA ADDED SUCCESSFULLY"); } else { MessageBox.Show("INSERTION FAILED"); } } catch (Exception ex) { Console.Out.WriteLine(ex.Message.ToString()); } }
private void comboBoxAction_SelectedIndexChanged(object sender, EventArgs e) { Grievance objectGrievance = new Grievance(); objectGrievance.Status = comboBoxAction.Text; objectGrievance.GrievanceID = textBoxGrievanceid.Text; GrievanceBL.InsertStatus(objectGrievance); }
//------------------------------------------------------------------------------------------------ //------------------ Update Status of the Grievance Applied -------------------------------------- public static void InsertStatus(Grievance objectGrievance) { try { GrievanceDL.InsertStatus(objectGrievance); } catch (Exception ex) { Console.WriteLine("Error : GrievanceBL : InsertStatus()" + ex.Message.ToString()); } }
public IActionResult Put(Grievance newGrievance) { try { _grevianceSubmissionService.UpdateMessages(newGrievance); } catch (Exception E) { _logger.AddLog(E.ToString(), E.GetType().ToString()); return(NotFound("Exception Occured.")); } return(Ok(newGrievance)); }
//------------------------------------------------------------------------------------- //---------------------------- Insert Grievance Details ------------------------------- public static int InsertGrievanceDetails(Grievance objGrievance) { int output = 0; try { output = GrievanceDL.InsertGrievanceDetails(objGrievance); } catch (Exception ex) { Console.WriteLine("Error : GrievanceBL : InsertGrievanceDetails()" + ex.Message.ToString()); } return(output); }
public IActionResult PostGrievance([FromBody] Grievance grievanceRequest) { if (!ModelState.IsValid) { _logger.AddLog(BadRequest(ModelState).ToString(), BadRequest().GetType().ToString()); return(BadRequest(ModelState)); } try { _grevianceSubmissionService.AddGrievance(grievanceRequest); } catch (Exception E) { _logger.AddLog(E.ToString(), E.GetType().ToString()); return(StatusCode(StatusCodes.Status406NotAcceptable)); } return(StatusCode(StatusCodes.Status201Created)); }