Beispiel #1
0
        public ActionResult WinCreateReport_ItemsSelRead(string PanelID, string sGxID, string SelOldItemIDs, string SelNowItemIDs, string SelectedStore)
        {
            string[] arrOldItemIDs = SelOldItemIDs.Split(CosValue.SPLITOPERATOR2);
            string[] arrNowItemIDs = SelNowItemIDs.Split(CosValue.SPLITOPERATOR2);
            int      num           = 0;

            foreach (string oldItemID in arrOldItemIDs) //如果某个老编号在新编号里面,保留
            {
                if (arrNowItemIDs.Contains(oldItemID))
                {
                    num++;
                }
            }

            object[][] arrObj = new object[num][];
            num = 0;
            int allnum = 0;

            foreach (string oldItemID in arrOldItemIDs) //如果某个老编号在新编号里面,保留
            {
                if (arrNowItemIDs.Contains(oldItemID))
                {
                    switch (oldItemID)
                    {
                    case "Department":
                        DepartmentInfoManage departmentMan = new DepartmentInfoManage();
                        arrObj[num] = departmentMan.GetNameStoreforSelection(sGxID, SelectedStore);    //获得院系
                        break;

                    case "Province":
                        dqdmTableManage dqMan = new dqdmTableManage();
                        arrObj[num] = dqMan.GetNameStoreforSelection(SelectedStore);
                        break;

                    default:
                        OriginTableManage tableMan = new OriginTableManage();
                        arrObj[num] = tableMan.GetNameStoreforSelection(oldItemID, SelectedStore, true);
                        break;
                    }
                    allnum += arrObj[num].Length;
                    num++;
                }
            }

            object[] returnObj = new object[allnum];
            int      k         = 0;

            for (int i = 0; i < num; i++)
            {
                for (int j = 0; j < arrObj[i].Length; j++)
                {
                    returnObj[k] = arrObj[i][j];
                    k++;
                }
            }
            return(this.Store(returnObj));
        }
        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>
 /// 构造方法
 /// </summary>
 public UserAccountAppService(IRepository <UserAccount, long> userAccountRepository, UserAccountManage userAccountManage,
                              IRepository <DepartmentInfo, long> departmentRepository, DepartmentInfoManage departmentInfoManage,
                              IRepository <JobPost, long> jobPostRepository, JobPostManage jobPostManage)
 {
     _userAccountRepository = userAccountRepository;
     _userAccountManage     = userAccountManage;
     _departmentRepository  = departmentRepository;
     _departmentInfoManage  = departmentInfoManage;
     _jobPostRepository     = jobPostRepository;
     _jobPostManage         = jobPostManage;
 }
        /// <summary>
        /// 初始化树的节点,需要在调用前定义TempData中TreeAuthorNowID
        /// </summary>
        /// <returns></returns>
        public virtual StoreResult InitTreeNodes(string node, string ParentVariable, string PanelID, string sRelationIDs, string sNowNames, string sNowValues, string sNowSigns, string sAuthorIDs)
        {
            try
            {
                GetParentVariable(ParentVariable);
                var treeMan = GetTreeManage(ParentVar.KeyWords);
                if (sAuthorIDs != "0")
                {
                    switch (ParentVar.KeyWords)
                    {
                    case "DepartmentInfo":
                        if (sRelationIDs != "0")
                        {
                            AuthorizationInfoDataListManage manAuthor = new AuthorizationInfoDataListManage();
                            List <tblAuthorizationInfo>     authors   = manAuthor.GetRecordsByID <tblAuthorizationInfo>(sAuthorIDs);
                            if (!authors.Select(x => x.Name).ToArray().Contains(UserRoleName.SUPER))     //如果不是超级管理员,只显示其所在部门和下级部门
                            {
                                sNowNames += CosValue.SPLITOPERATOR1 + "ID";
                                sNowSigns += CosValue.SPLITOPERATOR1 + SIGN.In.ToString();
                                DepartmentInfoManage manDepart = new DepartmentInfoManage();
                                sNowValues += manDepart.GetAllParent(sRelationIDs) + CosValue.SPLITOPERATOR2 + manDepart.GetAllLeaf(sRelationIDs);
                                if (sNowNames[0] == '|')
                                {
                                    sNowNames  = sNowNames.Remove(0, 1);
                                    sNowValues = sNowValues.Remove(0, 1);
                                    sNowSigns  = sNowSigns.Remove(0, 1);
                                }
                                SetHiddenValue(PanelID + "_NowNames", sNowNames);
                                SetHiddenValue(PanelID + "_NowValues", sNowValues);
                                SetHiddenValue(PanelID + "_NowSigns", sNowSigns);
                            }
                        }
                        sAuthorIDs = "0";     //部门和角色表没有关联,所以把角色设为0,只通过上面代码进行分拣
                        break;

                    default: sAuthorIDs = "0"; break;
                    }
                }
                NodeCollection nodes = treeMan.InitTree(node, sAuthorIDs, sNowNames, sNowValues, sNowSigns);
                if (ParentVariable.Contains("MainPage"))
                {
                    TempData["FirstTreeNodeId"] = treeMan.sFirstLeafNodeID;
                }
                return(this.Store(nodes));
            }
            catch (Exception e)
            {
                return(null);
            }
        }
Beispiel #5
0
        public ActionResult WinCreateReport_ItemsAllRead(string ParentVariable, string sGxID, string SelOldItemIDs, string SelNowItemIDs, string SelectedStore)
        {
            //GetParentVariable(ParentVariable);
            string[] arrOldItemIDs = SelOldItemIDs.Split(CosValue.SPLITOPERATOR2);
            string[] arrNowItemIDs = SelNowItemIDs.Split(CosValue.SPLITOPERATOR2);

            if (arrNowItemIDs != null)
            {
                object[][] arrObj = new object[arrNowItemIDs.Length][];
                int        num    = 0;
                for (int i = 0; i < arrNowItemIDs.Length; i++)
                {
                    switch (arrNowItemIDs[i])
                    {
                    case "Department":
                        DepartmentInfoManage departmentMan = new DepartmentInfoManage();
                        arrObj[i] = departmentMan.GetNameStoreforSelection(sGxID, SelectedStore, false);    //获得院系
                        break;

                    case "Province":
                        dqdmTableManage dqMan = new dqdmTableManage();
                        arrObj[i] = dqMan.GetNameStoreforSelection(SelectedStore, false);
                        break;

                    default:
                        OriginTableManage tableMan = new OriginTableManage();
                        arrObj[i] = tableMan.GetNameStoreforSelection(arrNowItemIDs[i], SelectedStore, false);
                        break;
                    }
                    num += arrObj[i].Length;
                }
                object[] returnObj = new object[num];
                num = 0;
                for (int i = 0; i < arrNowItemIDs.Length; i++)
                {
                    for (int j = 0; j < arrObj[i].Length; j++)
                    {
                        returnObj[num] = arrObj[i][j];
                        num++;
                    }
                }
                return(this.Store(returnObj));
            }
            else
            {
                return(null);
            }
        }
Beispiel #6
0
        public override void InitPage()
        {
            SetSearchPanelHeight(60);
            setParentVariable(null, null, "UserInfo_SelectDutyChange", null, "DutyInfo");
            SetHiddenValue(sPageKeyWord + "_cmbDutyInfo_ParentVariable", ParentVar.DefaultVal);
            SetComboValue(sPageKeyWord + "_cmbDutyInfo", "0", true);

            string[]             key           = { CookieKeys.DEPARTMENTID, CookieKeys.USERROLES };
            string               sDepartmentID = (new UserInfoManage()).GetLoginUserInfo(key)[0];
            string               sAuthorIDs    = (new UserInfoManage()).GetLoginUserInfo(key)[1];
            DepartmentInfoManage man           = new DepartmentInfoManage();

            SetHiddenValue(sPageKeyWord + "_SearchDepartmentID", man.GetSpecialIDsFromAuthors(sAuthorIDs, sDepartmentID));

            base.InitPage();
        }
        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());
        }
Beispiel #8
0
        public ActionResult WindowSaveClick(tblUserInfo model, string PanelID, string ParentVariable)//, string sSelAuthors, string sSetAuthors, string sOriginAuthors)
        {
            DirectResult result = new DirectResult();

            result.Success = true;

            UserInfoManage userMan = new UserInfoManage();

            //校验用户名和密码是否填写
            if ((model.UserICode == null) || (model.UserICode == "") || (model.UserIPsd == "") || (model.UserIPsd == null))
            {
                result.ErrorMessage = "用户名和密码不能为空!";
                result.Success      = false;
                return(result);
            }
            //校验如果用户名修改了,是否会有重复
            Expression <Func <tblUserInfo, bool> > where = (c => c.UserICode == model.UserICode && c.DelFlag == false);
            List <tblUserInfo> list = userMan.GetRecord(where);

            if ((list != null) && (list.Count > 0))
            {
                if (list[0].ID != model.ID)
                {
                    result.ErrorMessage = "用户名已经存在,不能使用!";
                    result.Success      = false;
                    return(result);
                }
            }

            model.UserIPsd = userMan.GetSecretPass(model.UserIPsd);
            long lUserID = model.ID;

            if (model.UserIDutyIID == 0)
            {
                model.UserIDutyIID = null;
            }
            if (model.UserIDepartmentIID == 0)
            {
                model.UserIDepartmentIID  = null;
                model.WholeDepartmentName = "";
            }
            else
            {
                DepartmentInfoManage departmentMan = new DepartmentInfoManage();
                model.WholeDepartmentName = departmentMan.GetWholeDepartmentName(Convert.ToInt64(model.UserIDepartmentIID));
            }

            if (lUserID == 0)
            {
                lUserID = userMan.AddOneRecord(model);
            }
            else
            {
                userMan.SaveOneRecord(model);
            }

            if (lUserID == 0)
            {
                result.ErrorMessage = "保存出错!";
                result.Success      = false;
                return(result);
            }
            X.AddScript("var i = 0; var sSelAuthors = \"\"; while (i < App." + PanelID + "_NowRoleStore" + ".getCount()) { sSelAuthors = sSelAuthors + App." + PanelID + "_NowRoleStore" + ".getAt(i).get('ID') + \",\"; i++; } sSelAuthors = sSelAuthors.slice(0, sSelAuthors.length - 1);");
            X.AddScript("App.direct.UserControl.WinUserMore_SaveAuthorsDirectMethod(" + lUserID + ",sSelAuthors, App." + PanelID + "_SetAuthorID" + ".getValue(),App." + PanelID + "_OriginAuthorIDs" + ".getValue(),\"" + PanelID + "\");");
            return(result);
        }
Beispiel #9
0
 /// <summary>
 /// 构造方法
 /// </summary>
 public DepartmentInfoAppService(IRepository <DepartmentInfo, long> departmentInfoRepository, DepartmentInfoManage departmentInfoManage, ISqlExecuter sqlExecuter)
 {
     _departmentInfoRepository = departmentInfoRepository;
     _departmentInfoManage     = departmentInfoManage;
     _sqlExecuter = sqlExecuter;
 }
Beispiel #10
0
        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());
        }