//界面赋值 private void PageBand() { try { Common_DictModel model = new Common_DictBLL().GetCommon_DictModelByPK(common_dict_id); DataTable dt = new DataTable(); if (model != null) { txtd_Remark.Text = model.D_Remark; txtd_name.Text = model.D_Name; txtD_code.Text = model.D_Code; } } 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; } }
//获取界面参数 private Common_DictModel GetData() { Common_DictModel model = new Common_DictModel(); if (string.IsNullOrEmpty(common_dict_id)) { model.Common_Dict_ID = Guid.NewGuid().ToString(); model.D_CreateUser = loginUser.SysUser_ID; model.D_CreateTime = DateTime.Now; } else { model = new Common_DictBLL().GetCommon_DictModelByPK(common_dict_id); model.D_ModifyTime = DateTime.Now; model.D_ModifyUser = loginUser.SysUser_ID; } model.D_Name = txtd_name.Text.Trim(); model.D_Code = txtD_code.Text.Trim(); model.D_Remark = txtd_Remark.Text.Trim(); model.D_Type = 43; return(model); }
protected string GetHtmlData() { try { Common_DictBLL bll = new Common_DictBLL(); DataTable dt = new DataTable(); string strSql = string.Empty; if (!string.IsNullOrEmpty(txtCName.Text.Trim())) { strSql = " and D_Remark like '" + txtCName.Text.Trim() + "%'"; } strSql += " and d_type=43 "; dt = bll.GetCommon_DictList(strSql, PageIndex, PageSize, out rCount, out pCount).Tables[0]; int i = 0; StringBuilder strHtmlData = new StringBuilder(); strHtmlData.Append("<table class='table_list' cellpadding='0' cellspacing='0' >"); strHtmlData.Append("<tr class='tr_title'>"); strHtmlData.Append("<td style='width:30%;'>数据项名称</td>"); strHtmlData.Append("<td style='width:30%;'>表名称</td>"); strHtmlData.Append("<td style='width:30%;'>唯一ID</td>"); strHtmlData.Append("<td style='width:10%;'>操作</td>"); strHtmlData.Append("</tr>"); for (int j = 0; j < dt.Rows.Count; j++) { i++; string css = string.Empty; if (i % 2 == 0) { css = "tr_con_001"; } else { css = "tr_con_002"; } strHtmlData.Append("<tr class='" + css + "'>"); strHtmlData.Append("<td>" + dt.Rows[j]["D_Remark"] + "</td>"); strHtmlData.Append("<td>" + dt.Rows[j]["d_name"] + "</td>"); strHtmlData.Append("<td>" + dt.Rows[j]["d_code"] + "</td>"); strHtmlData.Append("<td><input type=\"button\" title='编辑数据项信息' class=\"btn_modify\" onclick=\"showUpdateDataItemEdit('" + dt.Rows[j]["common_dict_id"] + "')\"/>|"); strHtmlData.Append("<input type=\"button\" title='删除数据项信息' class=\"btn_delete\" onclick=\"DeleteUpdateDataItem('" + dt.Rows[j]["common_dict_id"] + "')\"/>"); strHtmlData.Append("</td> "); strHtmlData.Append("</tr>"); } strHtmlData.Append("</table>"); if (i == 0) { strHtmlData.Append(" <div class='nodata_div'>暂无数据</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; } }