public ActionResult EditPermitFormField(PermitFormScreenDesignTemplateDetailBE model) { bool success = false; int id = 0; PermitFormScreenDesignTemplateDetailBE permitFormScreenDesignTemplateDetail = FormLogic.FetchPermitFormScreenDesignTemplateDetail(model.FormID, model.Field); if (permitFormScreenDesignTemplateDetail == null) { permitFormScreenDesignTemplateDetail = new PermitFormScreenDesignTemplateDetailBE(); } permitFormScreenDesignTemplateDetail.FormID = model.FormID; permitFormScreenDesignTemplateDetail.Field = model.Field; permitFormScreenDesignTemplateDetail.FieldName = model.FieldName; permitFormScreenDesignTemplateDetail.FieldType = model.FieldType; permitFormScreenDesignTemplateDetail.Section = model.Section; permitFormScreenDesignTemplateDetail.Sequence = model.Sequence; if (model.Field <= 0) { success = FormLogic.AddPermitFormScreenDesignTemplateDetail(permitFormScreenDesignTemplateDetail); } else { success = FormLogic.UpdatePermitFormScreenDesignTemplateDetail(permitFormScreenDesignTemplateDetail); } return(Json(new { success, id })); }