protected void tvModuleFirst_SelectedNodeChanged(object sender, EventArgs e) { try { if (tvModuleFirst.SelectedNode.Value.Split('|')[1] == "1") { lblAlert.Text = "正在设置模块【" + tvModuleFirst.SelectedNode.Text + "】的功能"; DataTable dtFunctionSelected = new BLL_Sys_Function().GetSysModuleFunctionByModuleID(tvModuleFirst.SelectedNode.Value.Split('|')[0]).Tables[0]; DataTable dtFunction = new BLL_Sys_Function().GetAllSys_FunctionList().Tables[0]; Rc.Cloud.Web.Common.pfunction.SetCbl(cblFunction, dtFunction, "FunctionName", "FunctionID"); Rc.Cloud.Web.Common.pfunction.SetCbl(cblFunction, "FunctionID", dtFunctionSelected); hidModuleId.Value = tvModuleFirst.SelectedNode.Value.Split('|')[0]; cblFunction.Visible = true; btnSave.Visible = true; } else { hidModuleId.Value = ""; lblAlert.Text = "不可以在模块【" + tvModuleFirst.SelectedNode.Text + "】上设置功能"; cblFunction.Visible = false; btnSave.Visible = false; } } catch (Exception ex) { new BLL_clsAuth().AddLogErrorFromBS(Module_Id, string.Format("类:{0},方法:{1},错误信息:{2}, 详细:{3}", ex.TargetSite.DeclaringType.ToString(), ex.TargetSite.Name.ToString(), ex.Message, ex.StackTrace)); throw ex; } }
protected void btnSave_Click(object sender, EventArgs e) { try { Model_Sys_Function model = new Model_Sys_Function(); BLL_Sys_Function bll = new BLL_Sys_Function(); model.FUNCTIONID = txtFunctionId.Text.Trim(); model.FUNCTIONName = txtFunctionName.Text.Trim(); if (hidCtrl.Value == "1") { bool result = bll.AddSys_Function(model); if (result) { StringBuilder strLog = new StringBuilder(); strLog.AppendFormat("【添加功能】【ID】: {0}【功能名】:{1}", model.FUNCTIONID, model.FUNCTIONName); new BLL_clsAuth().AddLogFromBS(Module_Id, strLog.ToString()); } } else if (hidCtrl.Value == "2") { bool result = bll.UpdateSys_FunctionByID(model); if (result) { StringBuilder strLog = new StringBuilder(); strLog.AppendFormat("【修改功能】【ID】: {0}【功能名】:{1}", model.FUNCTIONID, model.FUNCTIONName); new BLL_clsAuth().AddLogFromBS(Module_Id, strLog.ToString()); } } } catch (Exception ex) { new BLL_clsAuth().AddLogErrorFromBS(Module_Id, string.Format("类:{0},方法:{1},错误信息:{2}, 详细:{3}", ex.TargetSite.DeclaringType.ToString(), ex.TargetSite.Name.ToString(), ex.Message, ex.StackTrace)); throw ex; } }
protected string GetHtmlData() { try { var modelList = new BLL_Sys_Function().GetSys_FunctionModelList(""); int i = 0; StringBuilder strHtmlData = new StringBuilder(); strHtmlData.Append("<table class='table table-hover table-bordered'>"); strHtmlData.Append("<thead>"); strHtmlData.Append("<tr>"); strHtmlData.Append("<th>编码</th>"); strHtmlData.Append("<th>名称</th>"); strHtmlData.Append("<th>操作</th>"); strHtmlData.Append("</tr>"); strHtmlData.Append("</thead>"); strHtmlData.Append("<tbody>"); foreach (var item in modelList) { i++; strHtmlData.Append("<tr>"); strHtmlData.Append("<td>" + item.FUNCTIONID + "</td>"); strHtmlData.Append("<td>" + item.FUNCTIONName + "</td>"); strHtmlData.Append("<td class='opera'>"); if (UserFun.Edit) { strHtmlData.AppendFormat("<a href='javascript:;' onclick=\"showPop('2','{0}','{1}')\">编辑</a>" , item.FUNCTIONID , item.FUNCTIONName); } else { strHtmlData.Append("<a href='javascript:;' class='disabled'>编辑</a>"); } if (UserFun.Delete) { strHtmlData.AppendFormat("<a href='javascript:;' onclick=\"DeleteFunction('{0}')\">删除</a>", item.FUNCTIONID); } else { strHtmlData.Append("<a href='javascript:;'>删除</a>"); } strHtmlData.Append("</td>"); strHtmlData.Append(" "); strHtmlData.Append("</tr>"); } strHtmlData.Append("</tbody>"); strHtmlData.Append("</table>"); if (i == 0) { strHtmlData.Append("<div class='nodata'>暂无数据</div>"); } return(strHtmlData.ToString()); } catch (Exception ex) { new BLL_clsAuth().AddLogErrorFromBS(Module_Id, string.Format("类:{0},方法:{1},错误信息:{2}, 详细:{3}", ex.TargetSite.DeclaringType.ToString(), ex.TargetSite.Name.ToString(), ex.Message, ex.StackTrace)); throw ex; } }
protected void Page_Load(object sender, EventArgs e) { string key = Request.QueryString["key"]; StringBuilder strStr = new StringBuilder(); StringBuilder strWhere = new StringBuilder(); DataTable dt = new DataTable(); string strJson = string.Empty; if (string.IsNullOrEmpty(key)) { key = Request["key"]; } switch (key) { case "DeleteSysModuleByID": #region 根据ID删除模块关联信息 string module_id = string.Empty; string syscode = string.Empty; try { module_id = Request["id"].ToString(); if (new BLL_SysModule().DeleteSysModuleBySyscodeAndModuleID(module_id)) { StringBuilder str = new StringBuilder(); str.Append("【删除模块关联信息】模块关联信息ID:" + module_id); new BLL_clsAuth().AddLogFromBS("Ajax/SysAJax.aspx", str.ToString()); Response.Write("1"); } else { Response.Write("0"); } } catch (Exception) { Response.Write("0"); } Response.End(); #endregion break; #region 得到系统数据的JSON串 case "GetSysCodeToJson": //dt = new BLL_SysProduct().GetList(" SysCode='00002'").Tables[0]; // dt = new BLL_SysCode().GetSysCodeListByHospitalID(""); Response.Write("{\"ds\":[{\"Value\":\"00001\",\"Text\":\"实施系统\"}]}"); break; #endregion #region 得到一级菜单的JSON串 case "GetModuleFristToJson": //dt = new BLL_SysModule().GetModuleFirstBySysCode(Request["f"].ToString()).Tables[0]; dt = new BLL_SysModule().GetSysModuleForFirstBySysCode(Request["f"].ToString()).Tables[0]; Response.Write(Rc.Cloud.Web.Common.pfunction.DtToJson(dt, "MODULEID", "MODULENAME")); break; #region 除系统信息 case "SysCodeTempDelete": try { string sysCodeT = clsUtility.Decrypt(Request.QueryString["Aid"]); //if (new BLL_SysCode().DeleteSysCodeBySysCode(sysCodeT) == true) //{ // //MS.Authority.clsAuth.AddLogFromBS("", String.Format("删除成功 【系统编码】:{0}", sysCodeT)); // strStr.Append(1); //} //else //{ // //MS.Authority.clsAuth.AddLogFromBS("", String.Format("删除失败 【系统编码】:{0}", sysCodeT)); // strStr.Append(0); //} } catch { //strJson = ex.Message.ToString(); strJson = "0"; } Response.Write(strStr.ToString()); Response.End(); break; #endregion #endregion case "SysUserTempDelete": #region 根据ID删除模块关联信息 string SysUser_ID = string.Empty; try { SysUserBLL BLL = new SysUserBLL(); SysUser_ID = clsUtility.Decrypt(Request["Aid"].ToString()); if (BLL.DeleteByPK(SysUser_ID) > 0 && BLL.DeleteSysUserRoleRelationByModuleID(SysUser_ID) == true) { StringBuilder str = new StringBuilder(); str.Append("【删除用户关联表SysUserTempDelete】用户ID:" + SysUser_ID); new BLL_clsAuth().AddLogFromBS("Ajax/SysAJax.aspx", str.ToString()); Response.Write("1"); } else { Response.Write("0"); } } catch (Exception) { Response.Write("0"); } Response.End(); #endregion break; case "SysCommon_DictTempDelete": #region 根据ID删除模块关联信息 string common_Dict_ID = string.Empty; try { Common_DictBLL BLL = new Common_DictBLL(); common_Dict_ID = clsUtility.Decrypt(Request["Aid"].ToString()); if (BLL.DeleteByPK(common_Dict_ID) > 0) { StringBuilder str = new StringBuilder(); str.Append("【删除字典】字典ID:" + common_Dict_ID); new BLL_clsAuth().AddLogFromBS("Ajax/SysAJax.aspx", str.ToString()); Response.Write("1"); } else { Response.Write("0"); } } catch (Exception) { Response.Write("0"); } Response.End(); #endregion break; #region 得到省的JSON串 case "GetProvinceToJson": // Response.Write(key); dt = new BLL_DictForHospital().GetHospitalRegional(" D_PartentID='' ").Tables[0]; Response.Write(Rc.Cloud.Web.Common.pfunction.DtToJson(dt, "Regional_Dict_ID", "D_Name")); break; #endregion #region 得到市的JSON串 case "GetCityToJson": dt = new BLL_DictForHospital().GetHospitalRegional(" D_PartentID='" + Request["province"].ToString() + "' ").Tables[0]; Response.Write(Rc.Cloud.Web.Common.pfunction.DtToJson(dt, "Regional_Dict_ID", "D_Name")); break; #endregion #region 得到县的JSON串 case "GetCountryToJson": dt = new BLL_DictForHospital().GetHospitalRegional(" D_PartentID='" + Request["city"].ToString() + "' ").Tables[0]; //dt = new BLL_DictForHospital().GetHospitalRegional(strWhere.ToString()).Tables[0]; Response.Write(Rc.Cloud.Web.Common.pfunction.DtToJson(dt, "Regional_Dict_ID", "D_Name")); break; #endregion case "CustomVisitAttachmentDelete": #region 根据ID删除文件信息 string customVisitAttachmentID = string.Empty; try { BLL_CustomVisitAttachment BLL = new BLL_CustomVisitAttachment(); customVisitAttachmentID = Request["Aid"].ToString(); if (BLL.DeleteByPK(customVisitAttachmentID) > 0) { Response.Write("1"); } else { Response.Write("0"); } } catch (Exception) { Response.Write("0"); } Response.End(); #endregion break; case "DeleteFunction": #region 根据ID删除文件信息 string functionID = string.Empty; try { BLL_Sys_Function BLL = new BLL_Sys_Function(); functionID = Request["FunctionID"].ToString(); if (BLL.DeleteSys_FunctionByID(functionID)) { Response.Write("1"); } else { Response.Write("0"); } } catch (Exception) { Response.Write("0"); } Response.End(); #endregion break; case "DeleteBaseSysModuleByID": #region 根据ID删除基库模块关联信息 string baseModuleId = string.Empty; string baseSysCode = string.Empty; try { baseModuleId = Request["id"].ToString(); baseSysCode = Request["syscode"].ToString(); if (new BLL_SysCode().DeleteBaseModule(baseModuleId, baseSysCode)) { Response.Write("1"); } else { Response.Write("0"); } } catch (Exception) { Response.Write("0"); } Response.End(); #endregion break; case "DeleteUpdateDataItem": #region 根据ID删除更新数据项 try { if (new Common_DictBLL().DeleteByPK(Request.QueryString["id"]) > 0) { Response.Write("1"); } else { Response.Write("0"); } } catch (Exception) { Response.Write("0"); } Response.End(); #endregion break; case "GetMaxType": #region 根据ID删除更新数据项 try { string type = new Common_DictBLL().GetMaxDType().ToString(); Response.Write(type); } catch (Exception) { Response.Write("0"); } Response.End(); #endregion break; case "DeleteDSQL": #region 根据ID删除更新数据项 try { if (new BLL_DictionarySQlMaintenance().DeleteByPKNew(Request["Aid"]) > 0) { Response.Write("1"); } else { Response.Write("0"); } } catch (Exception) { Response.Write("0"); } Response.End(); #endregion break; case "SysCommon_Dict1TempDelete": #region 根据ID删除模块关联信息 string common_Dict1_ID = string.Empty; try { BLL_Common_DictNew BLL = new BLL_Common_DictNew(); common_Dict1_ID = clsUtility.Decrypt(Request["Aid"].ToString()); if (BLL.DeleteByPK(common_Dict1_ID) > 0) { StringBuilder str = new StringBuilder(); str.Append("【删除字典】字典ID:" + common_Dict1_ID); new BLL_clsAuth().AddLogFromBS("Ajax/SysAJax.aspx", str.ToString()); Response.Write("1"); } else { Response.Write("0"); } } catch (Exception) { Response.Write("0"); } Response.End(); #endregion break; case "GetD_Remark": #region 根据D_Type得到D_Rmark string R_Type = Request.QueryString["Aid"]; BLL_Common_DictNew BLLmain = new BLL_Common_DictNew(); Response.Write(BLLmain.GetD_Remark(R_Type)); Response.End(); #endregion break; case "DelFUser": #region 根据UserId删除前台注册用户 string UserId = Request.QueryString["UserId"]; try { bool res = new Rc.BLL.Resources.BLL_F_User().DelFUser(UserId); if (res) { Response.Write("1"); } else { Response.Write("0"); } } catch (Exception) { Response.Write("0"); } #endregion break; default: break; } }