public JsonResult EditTemplateApiCall(ReconsileTemplate templateDetail) { bool isSuccessStatusCode = false; var templateInfoResult = CustomUtility.PostDataOfType("api/UpdateTemplate", templateDetail, out isSuccessStatusCode); if (!isSuccessStatusCode) { Response.StatusCode = (int)HttpStatusCode.InternalServerError; return(Json(templateInfoResult.ToString())); } return(Json("Success")); }
public ActionResult Addrecord(ReconsileTemplate templateDetail) { bool isSuccessStatusCode = false; if (ModelState.IsValid) { var roleInfoResult = CustomUtility.PostDataOfType("api/SaveReconsileTemplate", templateDetail, out isSuccessStatusCode); } if (!isSuccessStatusCode) { // throw new CustomException(responseString); } return(RedirectToAction("Index", "ReconsileTemplateMaster")); }
public void SaveReconsileTemplate([FromBody] ReconsileTemplate templateDetail) { try { var template = new DataTable(); template.Columns.Add("TemplateId", typeof(int)); template.Columns.Add("TemplateName", typeof(string)); template.Columns.Add("SourceFolder", typeof(string)); template.Columns.Add("SourceExtention", typeof(string)); template.Columns.Add("SourceCompletionPath", typeof(string)); template.Columns.Add("SourceSubstringValue", typeof(string)); template.Columns.Add("SourceDelimiter", typeof(string)); template.Columns.Add("SourceHasHeader", typeof(bool)); template.Columns.Add("NumberOfParameters", typeof(int)); template.Columns.Add("TemplateGroupId", typeof(int)); template.Columns.Add("TemplateGroupStatus", typeof(bool)); template.Columns.Add("IsActive", typeof(bool)); template.Columns.Add("IsPrimary", typeof(bool)); template.Columns.Add("ConditionQuery", typeof(string)); template.Columns.Add("AmoutWithDecimal", typeof(bool)); DataRow newRow = template.Rows.Add(); newRow["TemplateId"] = 0; newRow["TemplateName"] = templateDetail.TemplateName; newRow["SourceFolder"] = templateDetail.SourceFolder; newRow["SourceExtention"] = templateDetail.SourceExtention; newRow["SourceCompletionPath"] = templateDetail.SourceCompletionPath; newRow["SourceSubstringValue"] = templateDetail.SourceSubstringValue; newRow["SourceDelimiter"] = templateDetail.SourceDelimiter; newRow["SourceHasHeader"] = templateDetail.SourceHasHeader; newRow["NumberOfParameters"] = templateDetail.NumberOfParameters; newRow["TemplateGroupId"] = templateDetail.TemplateGroupId; newRow["TemplateGroupStatus"] = templateDetail.TemplateGroupStatus == null ? true : (bool)templateDetail.TemplateGroupStatus; newRow["IsActive"] = templateDetail.IsActive; newRow["IsPrimary"] = templateDetail.IsPrimary; newRow["ConditionQuery"] = templateDetail.ConditionQuery; newRow["AmoutWithDecimal"] = templateDetail.AmoutWithDecimal; _template.SaveTemplate(template); } catch (Exception ex) { throw new CustomException(ex.Message.ToString()); } }