public int InsertCustomerSupport(CustomerSupport customerSupport) { ExceptionLogServices exceptionLog = new ExceptionLogServices(); int _result; DateTime submitTime = DateTime.Now; //=============User for Expection Log======= string userId = customerSupport.UserID; string siteId = customerSupport.SiteID; string HCOID = (customerSupport.HCOID == 0) ? "null" : customerSupport.HCOID.ToString(); string subject = customerSupport.Subject; string body = customerSupport.Body; string productId = customerSupport.EProductID.ToString(); string programId = customerSupport.ProgramID.ToString(); //========================================== using (var db = new DBAMPContext()) { try { _result = db.ApiInsertCustomerSupport(Convert.ToInt32(customerSupport.UserID), Convert.ToInt32(customerSupport.SiteID), (customerSupport.HCOID == 0) ? null : customerSupport.HCOID, submitTime, customerSupport.Subject, customerSupport.Body, customerSupport.EProductID, customerSupport.ProgramID); } catch (Exception ex) { string sqlParam = "ApiInsertCustomerSupport(" + userId + "," + siteId + "," + HCOID + "," + submitTime.ToString() + "," + subject + "," + body + "," + productId + "," + programId + ")"; string methodName = "JCRAPI/Business/CustomerSupportEmailServices/InsertCustomerSupport"; exceptionLog.ExceptionLogInsert(ex.Message.ToString(), "", methodName, Convert.ToInt32(userId), Convert.ToInt32(siteId), sqlParam, string.Empty); return(0); } } return(_result); }