//businees logic layer public string AddRecordFeedback(JObject RecordfdJsonvalue) { string Status = string.Empty; string Msg = string.Empty; string strResult = string.Empty; string strProjectKey = string.Empty, strSectionkey = string.Empty, strLeasekey = string.Empty, fkeyFeedbacksource = string.Empty, fkeyFeedbacktype = string.Empty, feedbackDescription = string.Empty, feedbackResponsecomments = string.Empty, strUserKey = string.Empty, Addedon = string.Empty, Modifiedby = string.Empty, Modifiedon = string.Empty, strReporteddate = string.Empty; List lstQuery = new List(); try { dynamic JSONValue = JArray.Parse("[" + RecordfdJsonvalue + "]"); DBConnection dbcMaster = new DBConnection(_configuration.GetSection("REmaapSettings").GetSection("MasterConnectionString").Value); if (JSONValue.Count > 0) { strProjectKey = Convert.ToString(JSONValue[0].strProjectKey); strSectionkey = Convert.ToString(JSONValue[0].strSectionkey); strLeasekey = Convert.ToString(JSONValue[0].strLeasekey); fkeyFeedbacksource = Convert.ToString(JSONValue[0].fkeyFeedbacksource); fkeyFeedbacktype = Convert.ToString(JSONValue[0].fkeyFeedbacktype); strReporteddate = Convert.ToString(JSONValue[0].strReporteddate); feedbackDescription = Convert.ToString(JSONValue[0].feedbackDescription); feedbackResponsecomments = Convert.ToString(JSONValue[0].feedbackResponsecomments); strUserKey = Convert.ToString(JSONValue[0].addedBy); //Addedon = Convert.ToString(JSONValue[0].Addedon); //Modifiedby = Convert.ToString(JSONValue[0].Modifiedby); //Modifiedon = Convert.ToString(JSONValue[0].Modifiedon); } if (!string.IsNullOrEmpty(strProjectKey) && !string.IsNullOrEmpty(strLeasekey) && !string.IsNullOrEmpty(strSectionkey) && !string.IsNullOrEmpty(feedbackDescription) && !string.IsNullOrEmpty(strUserKey) && !string.IsNullOrEmpty(strReporteddate)) { lstQuery.Add("INSERT INTO Report_Feedback_Details(FKEY_PROJECT,FKEY_SECTIONKEY,FKEY_LEASEKEY,FKEY_FEEDBACK_SOURCE,FKEY_FEEDBACK_TYPE,REPORTED_DATE,FEEDBACK_DESCRIPTION,FEEDBACK_RESPONSE_COMMENTS,Added_by,Added_On,Modified_By,Modified_On) " + "VALUES ('" + strProjectKey + "','" + strSectionkey + "','" + strLeasekey + "','" + fkeyFeedbacksource + "','" + fkeyFeedbacktype + "','" + strReporteddate + "','" + _DAL.stripQuotes(feedbackDescription) + "','" + _DAL.stripQuotes(feedbackResponsecomments) + "','" + strUserKey + "', NOW()," + "NULL," + "NULL" + ")"); if (lstQuery.Count > 0) { dbcMaster.executeNonQuery(lstQuery.ToArray()); } Status = "\"Status\" : " + "\"Success\""; Msg = "\"Message\" : \"\""; } else { Status = "\"Status\" : " + "\"Error\""; Msg = "\"Message\" : \"Insert values are empty\""; } } catch (Exception ex) { _logDetails.strprojkey = strProjectKey; Log.WriteLog(ex, _logDetails); Status = "\"Status\" : " + "\"Error\""; Msg = "\"Message\" : \"" + ex.Message.ToString() + "\""; } strResult = "{" + Status + "," + Msg + "}"; return strResult; } //controller code [Route("~/api/REmaapClassicView/AddRecordFeedback")] [HttpPost] public string AddRecordFeedback(JObject RecordfdJsonvalue) { string StrResult = string.Empty; strIPAddressError = IsallowedIPAddress(); try { if (strIPAddressError.ToUpper() == "TRUE") { StrResult = _BLL.AddRecordFeedback(RecordfdJsonvalue); } else { return strIPAddressError; } } catch (Exception ex) { Log.WriteLog(ex, _logdetails); } return StrResult; }