public ActionResult EditPermitFormField(FormDesignTemplateDetailBE model, List <TableFieldTypeMasterBE> tableFieldTypeMaster) { bool success = false; int id = 0; FormDesignTemplateDetailBE formDesignTemplateDetail = FormLogic.FetchFormDesignTemplateDetail(model.FormID, model.Field); if (formDesignTemplateDetail == null) { formDesignTemplateDetail = new FormDesignTemplateDetailBE(); } formDesignTemplateDetail.FormID = model.FormID; formDesignTemplateDetail.Field = model.Field; formDesignTemplateDetail.FieldName = model.FieldName; formDesignTemplateDetail.FieldType = model.FieldType; formDesignTemplateDetail.Section = model.Section; formDesignTemplateDetail.Sequence = model.Sequence; formDesignTemplateDetail.Mandatory = model.Mandatory; if (model.Field <= 0) { success = FormLogic.AddFormDesignTemplateDetail(formDesignTemplateDetail, out int field); //if (tableFieldTypeMaster != null) //{ // foreach (var o in tableFieldTypeMaster) // { // FormLogic.AddTableFieldTypeMaster(o); // } //} } else { success = FormLogic.UpdateFormDesignTemplateDetail(formDesignTemplateDetail); //if (tableFieldTypeMaster != null) //{ // foreach (var o in tableFieldTypeMaster) // { // if (o.Field > 0) // { // FormLogic.DeleteTableFieldTypeMaster(o.Field); // } // FormLogic.AddTableFieldTypeMaster(o); // } //} } return(Json(new { success, id })); }
public ActionResult FormDesignTemplateDetailFields(FormDesignTemplateDetailBE formDetail) { bool success = true; if (formDetail != null) { FormDesignTemplateDetailBE formDesignTemplateDetailBE = FormLogic.FetchFormDesignTemplateDetail(formDetail.FormID, formDetail.Field); if (formDesignTemplateDetailBE != null) { formDesignTemplateDetailBE.Section = formDetail.Section; formDesignTemplateDetailBE.Sequence = formDetail.Sequence; success = FormLogic.UpdateFormDesignTemplateDetail(formDesignTemplateDetailBE); } } return(Json(new { Success = success })); }
public ActionResult EditPermitFormField(int formID, int fieldID) { FormDesignTemplateDetailBE model; model = FormLogic.FetchFormDesignTemplateDetail(formID, fieldID); if (model == null) { model = new FormDesignTemplateDetailBE(); } ViewData["SectionList"] = FormLogic.FetchAllTemplateFormSection(formID).Select(m => new SelectListItem() { Text = m.Section, Value = m.Section }); return(View(model)); }