/// <summary> /// 用户登录成功,将ID等相关重要信息写入cookie中 /// </summary> private void LoginConfirm(tblUserInfo model, HttpResponseBase Response) { CryptManage crypt = new CryptManage(); HttpCookie cookie = new HttpCookie("LoginUser"); cookie.Expires = DateTime.Now.AddMinutes(30); DepartmentInfoDataTreeManage tree = new DepartmentInfoDataTreeManage(); tblDepartmentInfo parent = tree.GetFirstParent(Convert.ToInt64(model.UserIDepartmentIID)); cookie.Values.Add("ID", crypt.Encrypto(model.ID.ToString())); cookie.Values.Add("UserName", HttpUtility.UrlEncode(model.Name)); cookie.Values.Add("RegisterName", HttpUtility.UrlEncode(model.UserICode)); cookie.Values.Add("UserDuty", HttpUtility.UrlEncode(model.DutyInfo.Name)); cookie.Values.Add("DepartmentID", crypt.Encrypto(model.UserIDepartmentIID.ToString())); if (parent != null) { cookie.Values.Add("ParentDepartmentID", crypt.Encrypto(parent.ID.ToString())); cookie.Values.Add("UserGxID", crypt.Encrypto(parent.GxID.ToString())); } else { cookie.Values.Add("ParentDepartmentID", crypt.Encrypto("0")); cookie.Values.Add("UserGxID", crypt.Encrypto("0")); } string sUserRoles = string.Join(CosValue.SPLITOPERATOR2.ToString(), model.authorRelations.Select(x => x.author.ID).ToArray()); string sUserRoleNames = HttpUtility.UrlEncode(string.Join(CosValue.SPLITOPERATOR1.ToString(), model.authorRelations.Select(x => x.author.Name).ToArray())); cookie.Values.Add("UserRoles", crypt.Encrypto(sUserRoles)); cookie.Values.Add("UserRoleNames", sUserRoleNames); Response.Cookies.Add(cookie); }
public ActionResult WindowSaveClick(tblDepartmentInfo mo, string PanelID, string ParentVariable) { string[] EditColumns = { "DepartmentIADD", "DepartmentIPostalCode", "DepartmentIPhone", "DepartmentIFax", "DepartmentIeMail", "GxID", "ZYIDs" }; DepartmentInfoManage man = new DepartmentInfoManage(); man.SaveOneRecord(mo, EditColumns); SetHiddenValue(PanelID + "_ExitCode", "1"); return(this.Direct()); }
///// <summary> ///// 根据分拣条件,把所有符合的ID组成字符串返回 ///// </summary> ///// <param name="sNames"></param> ///// <param name="sValues"></param> ///// <param name="sSigns"></param> ///// <returns></returns> //public string GetSpecialIDsFromWhere(string sNames, string sValues, string sSigns) //{ // ArrayList arrNames = new ArrayList(sNames.Split(CosValue.SPLITOPERATOR1)); // ArrayList arrValues = new ArrayList(sValues.Split(CosValue.SPLITOPERATOR1)); // ArrayList arrSigns = new ArrayList(sSigns.Split(CosValue.SPLITOPERATOR1)); // Expression<Func<tblDepartmentInfo, bool>> where = GetAndLambdaExpression<tblDepartmentInfo>(arrNames, arrValues, arrSigns); // List<tblDepartmentInfo> list = GetRecord(where); // string sReturn = ""; // if ((list != null) && (list.Count > 0)) // sReturn = string.Join(CosValue.SPLITOPERATOR2.ToString(), list.Select(c => c.ID).ToArray()); // return sReturn; //} /// <summary> /// 获得所有上级部门名称拼起来的完整名称 /// </summary> /// <param name="lDepartmentID"></param> /// <returns></returns> public string GetWholeDepartmentName(long lDepartmentID) { string s = ""; tblDepartmentInfo model = GetOneRecordbyID <tblDepartmentInfo, long>(lDepartmentID); while (model != null) { s = model.Name + s; model = GetOneRecordbyID <tblDepartmentInfo, long>(model.ParentIndex); } return(s); }
/// <summary> /// 根据当前的编号,获取其所在学校的编号(就是返回二级节点) /// </summary> /// <param name="sID"></param> /// <returns></returns> public tblDepartmentInfo GetSchoolModel(string sID) { tblDepartmentInfo model = GetOneRecordbyID <tblDepartmentInfo, long>(Convert.ToInt64(sID)); if (model.TheLevel == 3) { return(GetOneRecordbyID <tblDepartmentInfo, long>(model.ParentIndex)); } else { return(model); } }
/// <summary> /// 根据当前的编号,获取该学校和所有部门的编号(就是返回二级节点和所有三级节点) /// </summary> /// <param name="sID"></param> /// <returns></returns> public List <tblDepartmentInfo> GetAllSchoolModels(string sID) { tblDepartmentInfo model = GetOneRecordbyID <tblDepartmentInfo, long>(Convert.ToInt64(sID)); long lSecondLevelID = 0; if (model.TheLevel == 3) { lSecondLevelID = model.ParentIndex; } else { lSecondLevelID = model.ID; } string sAllLeaf = GetAllLeaf(lSecondLevelID); return(GetRecordsByID <tblDepartmentInfo>(sAllLeaf)); }
public override ActionResult WindowCommonShow(string PanelID, string ParentVariable, string ParentKey) { GetParentVariable(ParentVariable); DepartmentInfoManage man = new DepartmentInfoManage(); tblDepartmentInfo model = man.GetSpecialModelFromCurrentID(ParentVar.transValue); if (model.ID != 0) { setParentVariable("UserControl", "WinDepartmentMore", "WinDepartmentMore_SelectGxdmChange", null, "gxdmTable"); SetHiddenValue(PanelID + "_cmbGxdm_ParentVariable", ParentVar.DefaultVal); tblDepartmentInfo parentModel = man.GetFirstParent(model.ID); SetComboValue(PanelID + "_cmbGxdm", parentModel.GxID.ToString(), true); if (model.ParentIndex != -1) { var panel = this.GetCmp <Panel>(PanelID + "_comboPanel"); panel.Disable(); } var form = this.GetCmp <FormPanel>(PanelID + "_Form"); form.SetValues(model); } return(this.Direct()); }
public override dynamic GetSpecialModelFromCurrentID <T>(T ID) { tblDepartmentInfo obj = base.GetSpecialModelFromCurrentID(ID); if ((obj.ZYIDs != null) && (obj.ZYIDs != "")) { ArrayList arrNames = new ArrayList(); ArrayList arrSigns = new ArrayList(); ArrayList arrValues = new ArrayList(); arrNames.Add("ID"); arrValues.Add(obj.ZYIDs); arrSigns.Add(SIGN.In); var where = GetAndLambdaExpression <Td_zydh>(arrNames, arrValues, arrSigns); List <Td_zydh> list = GetRecord(where); if ((list != null) && (list.Count > 0)) { obj.ZYNames = string.Join(CosValue.SPLITOPERATOR2.ToString(), list.Select(x => x.Name).ToArray()); } //obj.GetType().GetProperty("ParentName").SetValue(obj, GetAllParentName(ID), null); } return(obj); }
//protected virtual int _DFSSetLine(int nItemPos, int nRowNumX, int nRowNumY, Worksheet ws, ArrayList ItemKeys, ArrayList arrItems, ArrayList arrNames, ArrayList arrValues, ArrayList arrSigns, object tempMan) //{ // return nRowNumX; //} protected virtual int DFSSetLine(int nItemPos, int nRowNumX, int nRowNumY, Worksheet ws, ArrayList ItemKeys, ArrayList arrItems, ArrayList arrNames, ArrayList arrValues, ArrayList arrSigns, long ReportTypeID) { dqdmTableManage dqMan = new dqdmTableManage(); OriginTableManage tableMan = new OriginTableManage(); for (int i = 0; i < ((ArrayList)arrItems[nItemPos]).Count; i++) { if (ItemKeys[nItemPos].ToString() == "pcdmTable") { continue; } ArrayList arrNowNames = new ArrayList(); ArrayList arrNowValues = new ArrayList(); ArrayList arrNowSigns = new ArrayList(); for (int j = 0; j < arrNames.Count; j++) { arrNowNames.Add(arrNames[j]); arrNowValues.Add(arrValues[j]); arrNowSigns.Add(arrSigns[j]); } long lNowID = Convert.ToInt64(((ArrayList)arrItems[nItemPos])[i]); int nRowNowNumY = nRowNumY; string sColumnValue = ""; switch (ItemKeys[nItemPos].ToString()) { case "Department": zydhTableManage zyMan = new zydhTableManage(); tblDepartmentInfo depart = GetOneRecordbyID <tblDepartmentInfo, long>(lNowID); if (depart.ZYIDs != null && depart.ZYIDs != "" && depart.ZYIDs != " ") { long[] ZyIDs = Array.ConvertAll(depart.ZYIDs.Split(CosValue.SPLITOPERATOR2), long.Parse); if (ZyIDs.Length > 0) { clsExcelApp.SetCellValue(ws, nRowNumX, nRowNowNumY, depart.Name); nRowNowNumY++; int nRowNumXX = nRowNumX; switch (ReportTypeID) { case 1: //计划库 arrNowNames.Add("Zydh"); arrNowValues.Add(0); arrNowSigns.Add(SIGN.Equal); break; case 3: //批次,第一志愿 case 4: arrNowNames.Add("jhk.Zydh"); arrNowValues.Add(0); arrNowSigns.Add(SIGN.Equal); break; default: arrNowNames.Add("Lqzy"); arrNowValues.Add(0); arrNowSigns.Add(SIGN.Equal); break; } for (int j = 0; j < ZyIDs.Length; j++) { arrNowValues[arrNowValues.Count - 1] = ZyIDs[j]; Td_zydh zymodel = GetOneRecordbyID <Td_zydh, long>(ZyIDs[j]); int nRowNowNumYY = nRowNowNumY; if (zymodel != null) { clsExcelApp.SetCellValue(ws, nRowNumX, nRowNowNumYY, zymodel.Name); nRowNowNumYY++; //clsExcelApp.SetCellValue(ws, nRowNumX, nRowNowNumYY, zymodel.Code); nRowNowNumYY++; nRowNumX = _SetLineCore(nItemPos, nRowNumX, ws, ItemKeys, arrItems, arrNowNames, arrNowValues, arrNowSigns, nRowNowNumYY, ReportTypeID); } } clsExcelApp.UniteCells(ws, nRowNumXX, nRowNowNumY - 1, nRowNumX - 1, nRowNowNumY - 1); } } break; case "Province": if (ReportTypeID == 1) //因为jhk里直接有ProvinceID字段,否则前面要加bmk来找 { arrNowNames.Add("ProvinceID"); } else { arrNowNames.Add("bmk.ProvinceID"); } arrNowValues.Add(lNowID); arrNowSigns.Add(SIGN.Equal); string sProvinceName = dqMan.GetNowNamefromID(lNowID); clsExcelApp.SetCellValue(ws, nRowNumX, nRowNowNumY, sProvinceName); //省份 nRowNowNumY++; nRowNumX = _SetLineCore(nItemPos, nRowNumX, ws, ItemKeys, arrItems, arrNowNames, arrNowValues, arrNowSigns, nRowNowNumY, ReportTypeID); break; default: string sNowTableName = ItemKeys[nItemPos].ToString().Replace("Table", ""); sNowTableName = "bmk." + sNowTableName.Substring(0, 1).ToUpper() + sNowTableName.Substring(1, sNowTableName.Length - 1); arrNowNames.Add(sNowTableName); arrNowValues.Add(lNowID); arrNowSigns.Add(SIGN.Equal); sColumnValue = tableMan.GetNowNamefromID(lNowID, ItemKeys[nItemPos].ToString()); clsExcelApp.SetCellValue(ws, nRowNumX, nRowNowNumY, sColumnValue); nRowNowNumY++; nRowNumX = _SetLineCore(nItemPos, nRowNumX, ws, ItemKeys, arrItems, arrNowNames, arrNowValues, arrNowSigns, nRowNowNumY, ReportTypeID); break; } } return(nRowNumX); }
public ActionResult WinCreateReport_CreateReportDirectMethod(string sSelItems, string sSelTypeIDs, string PanelID, string sGxID, string sStartYear, string sEndYear, string ParentVariable, string sChartType, string sID) { if (sSelItems == "") { X.Msg.Alert("注意!", "已选项不能为空!").Show(); return(this.Direct()); } ReportInfoManage man = new ReportInfoManage(); tblReportInfo mo = man.GetOneRecordbyID <tblReportInfo, string>(sID); string GxName = "", FileName = ""; DepartmentInfoManage Deman = new DepartmentInfoManage(); tblDepartmentInfo model = Deman.GetOneRecordbyID <tblDepartmentInfo, string>(sGxID); //获取数据库表中的一条记录 if (model != null) { GxName = model.Name; } Expression <Func <tblReportType, bool> > where = (c => c.ID == mo.ReportTypeID && c.DelFlag == false); ReportTypeDataListManage reMan = new ReportTypeDataListManage(); List <tblReportType> list = reMan.GetRecord(where); //获取数据库表中的多条记录 if (sEndYear == sStartYear) { FileName = GxName + sStartYear + "年" + list[0].Name; } else { FileName = GxName + sStartYear + "-" + sEndYear + "年" + list[0].Name; } mo.Name = FileName; ReportInfoDataListManage smpDlgMan = new ReportInfoDataListManage(); string[] EditColumn = { "Name" }; long nNewID = smpDlgMan.SaveOneSimpleRecord(mo, null, EditColumn); SetHiddenValue(PanelID + "_ExitCode", "1"); switch (mo.ReportTypeID) { case 1: JHReportManage JHReport = new JHReportManage(); JHReport.CreateReport(sSelItems, sSelTypeIDs, sID, sGxID, sStartYear, sEndYear, sChartType, mo.ReportTypeID); break; case 2: LQReportManage LQReport = new LQReportManage(); LQReport.CreateReport(sSelItems, sSelTypeIDs, sID, sGxID, sStartYear, sEndYear, sChartType, mo.ReportTypeID); break; case 3: if (!sSelTypeIDs.Contains("pcdmTable")) { X.Msg.Alert("注意", "招生批次必须选择,生成报表失败!").Show(); return(this.Direct()); } PCReportManage PCReport = new PCReportManage(); PCReport.CreateReport(sSelItems, sSelTypeIDs, sID, sGxID, sStartYear, sEndYear, sChartType, mo.ReportTypeID); break; case 4: if (!sSelTypeIDs.Contains("Department")) { X.Msg.Alert("注意", "院系必须选择,生成报表失败!").Show(); return(this.Direct()); } DYZYReportManage DYZYReport = new DYZYReportManage(); DYZYReport.CreateReport(sSelItems, sSelTypeIDs, sID, sGxID, sStartYear, sEndYear, sChartType, mo.ReportTypeID); break; // case "5": //FSReportManage FSReport = new FSReportManage(); //FSReport.CreateReport(sSelItems, sSelTypeIDs, sID, sGxID, sStartYear, sEndYear, sChartType); // break; case 6: SYDReportManage SYDReport = new SYDReportManage(); SYDReport.CreateReport(sSelItems, sSelTypeIDs, sID, sGxID, sStartYear, sEndYear, sChartType, mo.ReportTypeID); break; case 7: FSReportManage FSReport = new FSReportManage(); FSReport.CreateReport(sSelItems, sSelTypeIDs, sID, sGxID, sStartYear, sEndYear, sChartType, mo.ReportTypeID); break; } //JHReportManage manReport = new JHReportManage(); //manReport.CreateReport(sSelItems, sSelTypeIDs, sID, sGxID, sYear); //SetHiddenValue(PanelID + "_ExitCode", "1"); return(this.Direct()); }