Exemplo n.º 1
0
        private void DoSelect()
        {
            ExamineStageResult esrEnt = ExamineStageResult.Find(ExamineStageResultId);

            string where = "";
            if (SearchCriterion.Orders.Count == 0)
            {
                SearchCriterion.SetOrder("ToUserName", true);
                where = " ExamineStageId='{0}' and State='3' and BeUserId='{1}'";
            }
            else
            {
                where = " ExamineStageId='{0}' and State='3' and BeUserId='{1}'";
            }
            where = string.Format(where, esrEnt.ExamineStageId, esrEnt.UserId);
            IList <ExamineTask> etEnts = ExamineTask.FindAll(SearchCriterion, Expression.Sql(where));

            PageState.Add("DataList", etEnts);
            if (!string.IsNullOrEmpty(esrEnt.ExamineStageId))//有些考核结果是手动填报的 因此需要加判断  有无考核阶段和明细
            {
                ExamineStage esEnt = ExamineStage.Find(esrEnt.ExamineStageId);
                PageState.Add("ExamineStage", esEnt);
            }
            PageState.Add("BeUserName", esrEnt.UserName);
        }
Exemplo n.º 2
0
        private void Doselect()
        {
            string where = "";
            foreach (CommonSearchCriterionItem item in SearchCriterion.Searches.Searches)
            {
                if (!String.IsNullOrEmpty(item.Value.ToString()))
                {
                    switch (item.PropertyName)
                    {
                    default:
                        where += " and  def2 like '%" + item.Value + "%' ";
                        break;
                    }
                }
            }

            string SQL = @"select  newid() as Id,def2 As XL from (
	                            select distinct def2 from HR_OA_MiddleDB..fld_gw where def2 is not null
                            ) AS T where 1=1 ";

            SQL = SQL + where;
            SQL = SQL.Replace("HR_OA_MiddleDB", Global.HR_OA_MiddleDB);
            SearchCriterion.SetOrder("XL");
            this.PageState.Add("DataList", GetPageData(SQL, SearchCriterion));
        }
Exemplo n.º 3
0
        private void DoSelect()
        {
            SearchCriterion.SetOrder("SortIndex");
            var ents = Model.ManagementGroup.FindAll(SearchCriterion);

            this.PageState.Add("DataList", ents);
        }
Exemplo n.º 4
0
        private void DoSelect()
        {
            sql = @"select Id as IndicatorFirstId ,IndicatorFirstName  from BJKY_Examine..IndicatorFirst 
                      where  ExamineIndicatorId = '" + ExamineIndicatorId + "' order by SortIndex asc ";
            EasyDictionary dic = DataHelper.QueryDict(sql, "IndicatorFirstId", "IndicatorFirstName");

            PageState.Add("IndictorFirstEnum", dic);//Combo数据集
            if (op != "c" && op != "cs")
            {
                if (!String.IsNullOrEmpty(id))
                {
                    ent = IndicatorSecond.Find(id);
                }
                SetFormData(ent);
                SearchCriterion.AddSearch(ScoreStandard.Prop_IndicatorSecondId, id);
                SearchCriterion.SetOrder("SortIndex", true);
                ents = ScoreStandard.FindAll(SearchCriterion);
                PageState.Add("DataList", ents);
            }
            else
            {
                if (!string.IsNullOrEmpty(IndicatorFirstId))
                {
                    IndicatorFirst ifEnt = IndicatorFirst.Find(IndicatorFirstId);
                    sql = "select isnull(max(SortIndex),0) from BJKY_Examine..IndicatorSecond where IndicatorFirstId='" + IndicatorFirstId + "'";
                    var obj = new
                    {
                        SortIndex          = DataHelper.QueryValue <int>(sql) + 1,
                        ExamineIndicatorId = ExamineIndicatorId
                    };
                    SetFormData(obj);
                }
            }
        }
Exemplo n.º 5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Aim.WorkFlow.Task ent = null;
            switch (this.RequestAction)
            {
            case RequestActionEnum.Delete:
                ent = this.GetTargetData <Aim.WorkFlow.Task>();
                ent.DoDelete();
                this.SetMessage("删除成功!");
                break;

            default:
                if (RequestActionString == "batchdelete")
                {
                    IList <object> idList = RequestData.GetList <object>("IdList");

                    if (idList != null && idList.Count > 0)
                    {
                        SysWorkFlowTask.DoBatchDelete(idList.ToArray());
                    }
                }
                else
                {
                    SearchCriterion.SetSearch("EFormName", this.RequestData["FormId"].ToString(), SearchModeEnum.Like);
                    SearchCriterion.SetOrder("CreatedTime", true);
                    ents = Aim.WorkFlow.TaskRule.FindAll(SearchCriterion);
                    this.PageState.Add("SysWorkFlowTaskList", ents);
                }
                break;
            }
        }
Exemplo n.º 6
0
 /// <summary>
 /// 查询
 /// </summary>
 private void DoSelect()
 {
     SearchCriterion.SetSearch("CreateId", UserInfo.UserID);
     SearchCriterion.SetOrder("CreateTime", false);
     ents = EmpVoiceAskQuestion.FindAll(SearchCriterion);
     this.PageState.Add("DataList", ents);
     this.PageState.Add("QuestionEnum", SysEnumeration.GetEnumDict("QuestionType"));
 }
Exemplo n.º 7
0
        string code = String.Empty; // 编码

        #endregion

        #region 构造函数

        #endregion

        #region ASP.NET 事件

        protected void Page_Load(object sender, EventArgs e)
        {
            op   = RequestData.Get <string>("op");
            id   = RequestData.Get <string>("id");
            type = RequestData.Get <string>("type");
            code = RequestData.Get <string>("code");

            DynamicAuthCatalog dac = null; // 动态权限类型

            SearchCriterion sc = new HqlSearchCriterion();

            SearchCriterion.SetOrder("SortIndex");
            SearchCriterion.SetOrder("CreatedDate");
            SearchCriterion.AddSearch("EditStatus", "G", SearchModeEnum.Like);  // 只显示允许授权的节点

            if (type == "catalog")
            {
                if (String.IsNullOrEmpty(code) && !String.IsNullOrEmpty(id))
                {
                    dac  = DynamicAuthCatalog.Find(id);
                    code = dac.Code;
                }

                if (!String.IsNullOrEmpty(code))
                {
                    SearchCriterion.AddSearch("CatalogCode", code);
                    SearchCriterion.AddSearch("ParentID", SingleSearchModeEnum.IsNull);

                    ents = DynamicAuthRule.FindAll(SearchCriterion);

                    if (dac == null)
                    {
                        dac = DynamicAuthCatalog.FindFirst(Expression.Eq("Code", code));
                    }
                }
            }
            else if (!String.IsNullOrEmpty(id))
            {
                SearchCriterion.AddSearch("ParentID", id);

                ents = DynamicAuthRule.FindAll(SearchCriterion);

                DynamicAuth da = DynamicAuth.Find(id);
                dac = DynamicAuthCatalog.FindFirst(Expression.Eq("Code", da.CatalogCode));
            }

            this.PageState.Add("EntList", ents);

            if (!IsAsyncRequest)
            {
                if (dac != null)
                {
                    IList <DynamicPermissionCatalog> dpcs = dac.AllowGrantPermissionCatalog;
                    this.PageState.Add("PCatalogList", dpcs);
                }
            }
        }
Exemplo n.º 8
0
        /// <summary>
        /// 选择操作
        /// </summary>
        private void DoSelect()
        {
            DynamicAuthCatalog dac = null; // 动态权限类型

            SearchCriterion sc = new HqlSearchCriterion();

            SearchCriterion.SetOrder("SortIndex");
            SearchCriterion.SetOrder("CreatedDate");
            SearchCriterion.AddSearch("EditStatus", "G", SearchModeEnum.Like);  // 只显示允许授权的节点

            if (type == "catalog")
            {
                if (String.IsNullOrEmpty(code) && !String.IsNullOrEmpty(id))
                {
                    dac  = DynamicAuthCatalog.Find(id);
                    code = dac.Code;
                }

                if (!String.IsNullOrEmpty(code))
                {
                    SearchCriterion.AddSearch("CatalogCode", code);
                    SearchCriterion.AddSearch("ParentID", SingleSearchModeEnum.IsNull);

                    ents = DynamicAuthRule.FindAll(SearchCriterion);

                    if (dac == null)
                    {
                        dac = DynamicAuthCatalog.FindFirst(Expression.Eq("Code", code));
                    }
                }
            }
            else if (!String.IsNullOrEmpty(id))
            {
                SearchCriterion.AddSearch("ParentID", id);

                ents = DynamicAuthRule.FindAll(SearchCriterion);

                DynamicAuth da = DynamicAuth.Find(id);
                dac = DynamicAuthCatalog.FindFirst(Expression.Eq("Code", da.CatalogCode));
            }

            this.PageState.Add("EntList", ents);

            if (!IsAsyncRequest)
            {
                if (dac != null)
                {
                    IList <DynamicPermissionCatalog> dpcs = dac.AllowGrantPermissionCatalog;
                    this.PageState.Add("PCatalogList", dpcs);

                    this.PageState.Add("AllowOperation", dac.GetAllowOperations()); // 允许的操作
                }

                this.PageState.Add("OpDivChar", DynamicOperations.DivChar); // 操作分割符
            }
        }
Exemplo n.º 9
0
        string code = String.Empty; // 对象类型

        #endregion

        #region 构造函数

        #endregion

        #region ASP.NET 事件

        protected void Page_Load(object sender, EventArgs e)
        {
            op   = RequestData.Get <string>("op");
            id   = RequestData.Get <string>("id");
            code = RequestData.Get <string>("code");

            if (IsAsyncRequest)
            {
                DynamicAuth ent = null;

                switch (this.RequestAction)
                {
                case RequestActionEnum.Read:
                case RequestActionEnum.Query:
                case RequestActionEnum.Default:
                    if (SearchCriterion.Orders.Count <= 0)
                    {
                        SearchCriterion.SetOrder("SortIndex");
                        SearchCriterion.SetOrder("CreatedDate");
                    }

                    SearchCriterion.AddSearch("CatalogCode", code);
                    SearchCriterion.AddSearch("EditStatus", SingleSearchModeEnum.IsNotNull);
                    SearchCriterion.AddSearch("EditStatus", "", SearchModeEnum.NotEqual);

                    if (String.IsNullOrEmpty(id))
                    {
                        SearchCriterion.AddSearch("ParentID", SingleSearchModeEnum.IsNull);
                    }
                    else
                    {
                        SearchCriterion.AddSearch("ParentID", id);
                    }

                    ents = DynamicAuthRule.FindAll(SearchCriterion);
                    break;

                case RequestActionEnum.Delete:
                    ent = DynamicAuth.Find(id);
                    ent.DoDelete();
                    this.SetMessage("删除成功!");
                    break;
                }

                this.PageState.Add("EntList", ents);
            }
            else
            {
                SearchCriterion sc = new HqlSearchCriterion();
                sc.SetOrder("SortIndex");
                sc.SetOrder("CreatedDate");
                DynamicAuthCatalog[] entCatalogs = DynamicAuthCatalogRule.FindAll(sc);

                this.PageState.Add("EntCatalogList", entCatalogs);
            }
        }
Exemplo n.º 10
0
 private void DoSelect()
 {
     if (!string.IsNullOrEmpty(SurveyId))
     {
         SearchCriterion.SetSearch("SurveyId", SurveyId);
         SearchCriterion.SetOrder("CreateWay");
         SurveyCanReaderUsr[] SrEnt = SurveyCanReaderUsr.FindAll(SearchCriterion);
         this.PageState.Add("DataList2", SrEnt);
     }
 }
Exemplo n.º 11
0
        private void DoSelect()
        {
            if (!string.IsNullOrEmpty(SurveyId))
            {
                string where = "";
                foreach (CommonSearchCriterionItem item in SearchCriterion.Searches.Searches)
                {
                    if (!String.IsNullOrEmpty(item.Value.ToString()))
                    {
                        switch (item.PropertyName)
                        {
                        case "StartTime":
                            where += " and CreateTime>='" + item.Value + "' ";
                            break;

                        case "EndTime":
                            where += " and CreateTime<='" + (item.Value.ToString()).Replace(" 0:00:00", " 23:59:59") + "' ";
                            break;

                        default:
                            where += " and " + item.PropertyName + " like '%" + item.Value + "%' ";
                            break;
                        }
                    }
                }
                //SearchCriterion.SetSearch("SurveyId", SurveyId);
                //SearchCriterion.SetOrder("CreateWay");
                //SurveyFinallyUsr[] SuEnt = SurveyFinallyUsr.FindAll(SearchCriterion);
                // this.PageState.Add("DataList1", SuEnt);
                string SQL = @"select distinct A.*,B.Phone,B.Email,
                                 case when C.State='1' then '是'
                                      when C.State='0' then '否'
                                      else '否'
                                 end As EmailIsFilled,
                                 case when C.PhoneState='1' then '是'
                                      when C.PhoneState='0' then '否'
                                      else '否'
                                 end As MsgIsFilled,
								case when  D.Id is null then 'N' when D.Id is not null  then 'Y' end As Commited 
                                from  FL_Culture..SurveyFinallyUsr As A 
                                left join FL_PortalHR..SysUser As B
	                                on A.UserID=B.UserID
                                left join FL_Recruitment..Remind As C
	                                on A.UserID =C.UserId and C.EXT1='S|'+A.Surveyid 
							    left join  FL_Culture..SurveyCommitHistory As D	
								    on A.UserId=D.SurveyedUserId and  D.SurveyId=A.SurveyId
                                where A.SurveyId='{0}' ";
                SQL += where;
                SQL  = string.Format(SQL, SurveyId);
                SQL  = SQL.Replace("FL_PortalHR", Global.AimPortalDB);
                SQL  = SQL.Replace("FL_Recruitment", Global.FL_Recruitment);
                SearchCriterion.SetOrder("CreateWay");
                this.PageState.Add("DataList1", GetPageData(SQL, SearchCriterion));
            }
        }
Exemplo n.º 12
0
        private void DoSelect()
        {
            if (!string.IsNullOrEmpty(SurveyId))
            {
                var Ent = SurveyQuestion.Find(SurveyId);
                if (string.IsNullOrEmpty(Ent.TemplateId))
                {
                    string sql = @"select * from  FL_Culture..QuestionItem where SurveyId='{0}' order by SortIndex ";
                    sql = string.Format(sql, SurveyId);
                    this.PageState.Add("DataList", DataHelper.QueryDictList(sql));
                }
                else
                {
                    //判断是否合并过
                    string SQL = "select * from FL_Culture..QuestionItem where SurveyId='{0}' ";
                    SQL = string.Format(SQL, SurveyId);
                    var Ents = DataHelper.QueryDictList(SQL);
                    if (Ents.Count > 0)
                    {
                        string sql = @"select * from  FL_Culture..QuestionItem where SurveyId='{0}' order by SortIndex ";
                        sql = string.Format(sql, SurveyId);
                        this.PageState.Add("DataList", DataHelper.QueryDictList(sql));
                        //SearchCriterion.SetOrder("SortIndex");
                        //IList<QuestionItem> Items = QuestionItem.FindAll(SearchCriterion, Expression.Sql(" SurveyId='" + SurveyId + "'"));
                        //this.PageState.Add("DataList", Items);
                        return;
                    }

                    //合并模板
                    var TemplateId  = Ent.TemplateId;
                    var ItemEnts    = QuestionItem.FindAllByProperties(QuestionItem.Prop_SurveyId, TemplateId);
                    var SubItemEnts = QuestionAnswerItem.FindAllByProperties(QuestionAnswerItem.Prop_SurveyId, TemplateId);

                    foreach (var ent in ItemEnts)
                    {
                        QuestionItem Item = new QuestionItem();
                        Item          = ent;
                        Item.SurveyId = SurveyId;
                        Item.DoCreate();
                    }
                    foreach (var subEnt in SubItemEnts)
                    {
                        QuestionAnswerItem subItem = new QuestionAnswerItem();
                        subItem          = subEnt;
                        subItem.SurveyId = SurveyId;
                        subItem.DoCreate();
                    }

                    SearchCriterion.SetOrder("SortIndex");
                    IList <QuestionItem> items = QuestionItem.FindAll(SearchCriterion, Expression.Sql(" SurveyId='" + SurveyId + "'"));
                    this.PageState.Add("DataList", items);
                }
            }
        }
        /// <summary>
        /// 查询
        /// </summary>
        private void DoSelect()
        {
            string where = string.Empty;
            foreach (CommonSearchCriterionItem item in SearchCriterion.Searches.Searches)
            {
                if (!String.IsNullOrEmpty(item.Value.ToString()))
                {
                    switch (item.PropertyName)
                    {
                    case "CreateTime":

                        where += " year(CreateTime)=" + item.Value + " ";
                        break;
                    }
                }
            }
            SearchCriterion.RemoveSearch("CreateTime");
            SearchCriterion.SetOrder(TravelMoneyConfig.Prop_Corp);             //公司
            SearchCriterion.SetOrder(TravelMoneyConfig.Prop_Indutydate, true); //日期

            CommPowerSplit PS     = new CommPowerSplit();
            SysUser        UsrEnt = SysUser.Find(UserInfo.UserID);

            if (PS.TraveMoneyConfig(UserInfo.UserID, UserInfo.LoginName)) //总部HR权限  HR1
            {
                if (!string.IsNullOrEmpty(where))
                {
                    ents = TravelMoneyConfig.FindAll(SearchCriterion, Expression.Sql(where));
                    this.PageState.Add("TravelMoneyConfigList", ents);
                }
                else
                {
                    ents = TravelMoneyConfig.FindAll(SearchCriterion);
                    this.PageState.Add("TravelMoneyConfigList", ents);
                }
            }
            else
            {
                //公司权限
                UserContextInfo UC = new UserContextInfo();
                SearchCriterion.SetSearch(TravelMoneyConfig.Prop_Corp, UC.GetUserCurrentCorpId(UserInfo.UserID));

                if (!string.IsNullOrEmpty(where))
                {
                    ents = TravelMoneyConfig.FindAll(SearchCriterion, Expression.Sql(where));
                    this.PageState.Add("TravelMoneyConfigList", ents);
                }
                else
                {
                    ents = TravelMoneyConfig.FindAll(SearchCriterion);
                    this.PageState.Add("TravelMoneyConfigList", ents);
                }
            }
        }
Exemplo n.º 14
0
 private void DoSelect()
 {
     if (string.IsNullOrEmpty(ExamineIndicatorId))
     {
         return;
     }
     SearchCriterion.SetSearch(IndicatorFirst.Prop_ExamineIndicatorId, ExamineIndicatorId);
     SearchCriterion.SetOrder("SortIndex", true);
     ents = IndicatorFirst.FindAll(SearchCriterion);
     PageState.Add("DataList", ents);
     PageState.Add("BeRoleName", SysEnumeration.GetEnumDict("BeExamineObject")); //被考核
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (SearchCriterion.Orders.Count <= 0)
            {
                SearchCriterion.SetOrder("SortIndex");
                SearchCriterion.SetOrder("CreatedDate");
            }

            ents = DynamicPermissionCatalogRule.FindAll(SearchCriterion);

            this.PageState.Add("DtList", ents);
        }
        /// <summary>
        /// 查询
        /// </summary>
        private void DoSelect()
        {
            string LeaderId = RequestData.Get <string>("LeaderId");
            string ids      = RequestData.Get <string>("id");

            string where = "";
            foreach (CommonSearchCriterionItem item in SearchCriterion.Searches.Searches)
            {
                if (!String.IsNullOrEmpty(item.Value.ToString()))
                {
                    switch (item.PropertyName)
                    {
                    case "TripStartTime":
                        where += " and TripStartTime>='" + item.Value + "' ";
                        break;

                    case "TripEndTime":
                        where += " and TripStartTime<='" + (item.Value.ToString()).Replace(" 0:00:00", " 23:59:59") + "' ";
                        break;

                    default:
                        where += " and " + item.PropertyName + " like '%" + item.Value + "%' ";
                        break;
                    }
                }
            }

            string sql = @"select *,charindex(LeaderName,'{0}') As SortIndex from BJKY_IntegratedManage..LeaderBusinessTrip where  1=1 ";
            //按顺序获取领导
            string LeaderSql = @"select STUFF((select ','+ CAST(UserName AS varchar)  from  BJKY_IntegratedManage..InstituteLeader FOR XML PATH('')),1,1,'' ) As LeaderName ";
            object obj       = DataHelper.QueryValue(LeaderSql);

            sql = string.Format(sql, obj);

            //if (!string.IsNullOrEmpty(RequestData.Get<string>("viewType") + "")) //处理月份
            //{
            //    sql = "select * from BJKY_IntegratedManage..LeaderBusinessTrip where '{0}' like '%'+Id+'%' ";
            //    sql = string.Format(sql, ids);
            //}

            if (!string.IsNullOrEmpty(where))
            {
                sql = sql + where;
            }
            if (!string.IsNullOrEmpty(LeaderId))
            {
                sql += " and LeaderId='" + LeaderId + "'";
            }
            //sql += " order by SortIndex ";
            SearchCriterion.SetOrder("SortIndex");
            //ents = IntegratedManage.Model.LeaderBusinessTrip.FindAll();
            this.PageState.Add("LeaderBusinessTripList", GetPageData(sql, SearchCriterion));
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            id = RequestData.Get <string>("id", String.Empty);
            // 类型标识
            cid   = RequestData.Get <string>("cid", String.Empty);
            type  = RequestData.Get <string>("type", String.Empty).ToLower();
            ctype = RequestData.Get <string>("ctype", "role").ToLower();

            if (!IsAsyncRequest)
            {
                cid = "2";  //WGM 13/4/7 默认组织结构
                if (!String.IsNullOrEmpty(cid))
                {
                    try
                    {
                        int icid = Convert.ToInt32(cid);

                        SearchCriterion.SetOrder("ParentID");
                        SearchCriterion.SetOrder("SortIndex");
                        SearchCriterion.SetOrder("CreateDate");
                        SearchCriterion.AddSearch("Type", icid);

                        ents = SysGroupRule.FindAll(SearchCriterion);
                    }
                    catch { }

                    this.PageState.Add("DtList", ents);
                }
                else
                {
                    SysGroupType[] typeList = SysGroupTypeRule.FindAll();
                    this.PageState.Add("DtList", typeList);
                }
            }
            else
            {
                switch (this.RequestAction)
                {
                case RequestActionEnum.Custom:
                    if (RequestActionString == "querychildren")
                    {
                        if (type == "gtype")
                        {
                            ents = SysGroup.FindAll("FROM SysGroup as ent WHERE ent.Type = ?", id);

                            this.PageState.Add("DtList", ents);
                        }
                    }
                    break;
                }
            }
        }
Exemplo n.º 18
0
        /// <summary>
        /// default
        /// </summary>
        private void DoSelect()
        {
            string PId = RequestData.Get("PId") + "";

            if (!string.IsNullOrEmpty(PId))
            {
                //ManagementInfo.Prop_PId, PId);
                SearchCriterion.AddSearch("PId", PId);
                SearchCriterion.SetOrder(ManagementInfo.Prop_CreateTime, false);
                var Ents = ManagementInfo.FindAll(SearchCriterion);
                this.PageState.Add("DataList", Ents);
            }
        }
Exemplo n.º 19
0
        protected void Page_Load(object sender, EventArgs e)
        {
            // 若未对SortIndex和CreateTime进行排序,在这里进行排序
            if (!SearchCriterion.HasOrdered("SortIndex") && SearchCriterion.HasOrdered("CreateTime"))
            {
                SearchCriterion.SetOrder("SortIndex");
                SearchCriterion.SetOrder("CreateTime");
            }

            ents = SysGroup.FindAll(SearchCriterion);

            this.PageState.Add("DtList", ents);
        }
Exemplo n.º 20
0
        protected void Page_Load(object sender, EventArgs e)
        {
            id    = RequestData.Get <string>("id", String.Empty);
            type  = RequestData.Get <string>("type", String.Empty).ToLower();
            ctype = RequestData.Get <string>("ctype", "user").ToLower();
            if (ctype == "group")
            {
                if (!String.IsNullOrEmpty(id))
                {
                    ICriterion cirt = null;

                    if (type == "gtype")
                    {
                        cirt = Expression.Sql("UserID IN (SELECT UserID FROM SysUserGroup WHERE GroupID IN (SELECT GroupID FROM SysGroup WHERE Type = ?))", id, NHibernateUtil.String);
                    }
                    else
                    {
                        // 应该同时获取子组用户 矿研的组织机构sysgroup path 字段中并不包含本记录的ID  所以下列语句要改写
                        //cirt = Expression.Sql("UserID IN (SELECT UserID FROM View_SysUserGroup WHERE Path LIKE '%" + id + "%' or GroupId='" + id + "')",
                        //    id, NHibernateUtil.String);
                        cirt = Expression.Sql("UserID IN (SELECT UserID FROM  SysUserGroup WHERE GroupID IN (SELECT GroupID FROM SysGroup where  Path LIKE '%" + id + "%' or GroupId='" + id + "'))",
                                              id, NHibernateUtil.String);
                    }
                    cirt = SearchHelper.IntersectCriterions(cirt, Expression.IsNull("Ext1"));
                    SearchCriterion.AutoOrder = false;
                    SearchCriterion.SetOrder(SysUser.Prop_WorkNo);
                    users = SysUserRule.FindAll(SearchCriterion, cirt);
                }
                PageState.Add("UsrList", users);
            }
            else
            {
                SearchCriterion.AutoOrder = false;
                string dName  = SearchCriterion.GetSearchValue <string>("Name");
                string workNo = SearchCriterion.GetSearchValue <string>("WorkNo");
                SearchCriterion.SetOrder(SysUser.Prop_WorkNo);
                if (dName != null && dName.Trim() != "")
                {
                    string where = "select * from SysUser where " + GetPinyinWhereString("Name", dName);
                    where       += "and Ext1 is null and WorkNo like '%" + workNo + "%'";
                    PageState.Add("UsrList", DataHelper.QueryDictList(where));
                }
                else
                {
                    ICriterion cirt = null;
                    cirt  = SearchHelper.IntersectCriterions(cirt, Expression.IsNull("Ext1"));
                    users = SysUserRule.FindAll(SearchCriterion, cirt);
                    PageState.Add("UsrList", users);
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            SearchCriterion.SetOrder("BlockType");
            if (!string.IsNullOrEmpty(this.RequestData.Get <string>("BlockType")))
            {
                ents = WebPartRule.FindAll(SearchCriterion, Expression.Eq("BlockType", this.RequestData.Get <string>("BlockType")));
            }
            else
            {
                ents = WebPartRule.FindAll(SearchCriterion, Expression.Eq("BlockType", "portal"));
            }

            this.PageState.Add("WebPartList", ents);
            this.PageState.Add("BlockType", SysEnumeration.GetEnumDict("BlockType"));

            Aim.Portal.Model.WebPart ent = null;
            switch (this.RequestAction)
            {
            case RequestActionEnum.Insert:
                ent = this.GetPostedData <Aim.Portal.Model.WebPart>();
                ent.Create();
                this.SetMessage("新建成功!");
                break;

            case RequestActionEnum.Update:
                ent = this.GetMergedData <Aim.Portal.Model.WebPart>();
                ent.Update();
                this.SetMessage("保存成功!");
                break;

            case RequestActionEnum.Delete:
                ent = this.GetTargetData <Aim.Portal.Model.WebPart>();
                ent.Delete();
                this.SetMessage("删除成功!");
                break;

            case RequestActionEnum.Custom:
                IList <object> idList = RequestData.GetList <object>("IdList");

                if (idList != null && idList.Count > 0)
                {
                    if (RequestActionString == "batchdelete")
                    {
                        WebPartRule.BatchRemoveByPrimaryKeys(idList);
                    }
                }
                break;
            }
        }
Exemplo n.º 22
0
        protected void Page_Load(object sender, EventArgs e)
        {
            SearchCriterion.AutoOrder = false;
            SearchCriterion.SetOrder(SysUser.Prop_WorkNo);
            string dName = SearchCriterion.GetSearchValue <string>("Name");

            if (dName != null && dName.Trim() != "")
            {
                string where = "select * from SysUser where " + GetPinyinWhereString("Name", dName);
                this.PageState.Add("UsrList", DataHelper.QueryDictList(where));
            }
            else
            {
                ents = SysUserRule.FindAll(SearchCriterion);
                this.PageState.Add("UsrList", ents);
            }
            if (this.IsAsyncRequest)
            {
                switch (this.RequestAction)
                {
                case RequestActionEnum.Custom:
                    if (RequestActionString == "querychildren")
                    {
                        string id    = (RequestData.ContainsKey("ID") ? RequestData["ID"].ToString() : String.Empty);
                        string ttype = RequestData["Type"].ToString().ToLower();

                        if (RequestData.ContainsKey("Type"))
                        {
                            if (ttype == "atype")      // 1为入口权限
                            {
                                SysAuth[] auths = SysAuth.FindAll("FROM SysAuth as ent WHERE ent.Type = ?", id);

                                this.PageState.Add("DtList", auths);
                            }
                        }
                    }
                    break;

                default:
                    break;
                }
            }
            else
            {
                SysAuthType[] authTypeList = SysAuthTypeRule.FindAll();
                this.PageState.Add("DtList", authTypeList);
            }
        }
Exemplo n.º 23
0
        protected void Page_Load(object sender, EventArgs e)
        {
            id    = RequestData.Get <string>("id", String.Empty);
            type  = RequestData.Get <string>("type", String.Empty).ToLower();
            ctype = RequestData.Get <string>("ctype", "user").ToLower();

            if (ctype == "group")
            {
                if (!String.IsNullOrEmpty(id))
                {
                    ICriterion cirt = null;

                    if (type == "gtype")
                    {
                        cirt = Expression.Sql("UserID IN (SELECT UserID FROM SysUserGroup WHERE GroupID IN (SELECT GroupID FROM SysGroup WHERE Type = ?))", id, NHibernateUtil.String);
                    }
                    else
                    {
                        // 应该同时获取子组用户
                        cirt = Expression.Sql("UserID IN (SELECT UserID FROM SysUserGroup WHERE GroupID IN (SELECT GroupID FROM SysGroup WHERE GroupID = ? OR Path LIKE '%" + id + "%'))",
                                              id, NHibernateUtil.String);
                    }
                    SearchCriterion.AutoOrder = false;
                    SearchCriterion.SetOrder(SysUser.Prop_WorkNo);
                    users = SysUserRule.FindAll(SearchCriterion, cirt);
                    this.PageState.Add("UsrList", users);
                }
            }
            else
            {
                SearchCriterion.AutoOrder = false;

                string dName  = SearchCriterion.GetSearchValue <string>("Name");
                string workNo = SearchCriterion.GetSearchValue <string>("WorkNo");
                SearchCriterion.SetOrder(SysUser.Prop_WorkNo);
                if (dName != null && dName.Trim() != "")
                {
                    string where = "select * from SysUser where " + GetPinyinWhereString("Name", dName);
                    where       += " and WorkNo like '%" + workNo + "%'";
                    this.PageState.Add("UsrList", DataHelper.QueryDictList(where));
                }
                else
                {
                    users = SysUserRule.FindAll(SearchCriterion);
                    this.PageState.Add("UsrList", users);
                }
            }
        }
Exemplo n.º 24
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (SearchCriterion.Orders.Count <= 0)
            {
                SearchCriterion.SetOrder("SortIndex");
                SearchCriterion.SetOrder("CreatedDate");
            }

            ents = DynamicAuthCatalogRule.FindAll(SearchCriterion);

            this.PageState.Add("DynamicAuthCatalogList", ents);

            DynamicAuthCatalog ent = null;

            switch (this.RequestAction)
            {
            case RequestActionEnum.Create:
                ent = this.GetPostedData <DynamicAuthCatalog>();
                ent.DoCreate();
                this.SetMessage("新建成功!");
                break;

            case RequestActionEnum.Update:
                ent = this.GetMergedData <DynamicAuthCatalog>();
                ent.DoUpdate();
                this.SetMessage("保存成功!");
                break;

            case RequestActionEnum.Delete:
                ent = this.GetTargetData <DynamicAuthCatalog>();
                ent.DoDelete();
                this.SetMessage("删除成功!");
                break;

            case RequestActionEnum.Custom:
                IList <object> idList = RequestData.GetList <object>("IdList");

                if (idList != null && idList.Count > 0)
                {
                    if (RequestActionString == "batchdelete")
                    {
                        DynamicAuthCatalogRule.BatchRemoveByPrimaryKeys(idList);
                    }
                }
                break;
            }
        }
Exemplo n.º 25
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (this.Request.Files.Count > 0)
            {
                string guid     = Guid.NewGuid().ToString();
                string filePath = "//WorkTime//InputExcelFiles//" + Guid.NewGuid().ToString() + System.IO.Path.GetExtension(Request.Files[0].FileName);
                this.Request.Files[0].SaveAs(Server.MapPath(filePath));
                ExcelProcessor ep = ExcelService.GetProcessor(Server.MapPath(filePath));
                DataSet        ds = ep.GetDataSet();
                InputDatas(ds.Tables[0]);
                Response.Write("{success:true}");
                Response.End();
            }

            id   = RequestData.Get <string>("id", String.Empty);
            type = RequestData.Get <string>("type", String.Empty);
            SearchCriterion.AutoOrder = false;
            SearchCriterion.SetOrder(SysUser.Prop_WorkNo);
            users = SysUserRule.FindAll(SearchCriterion);

            this.PageState.Add("UsrList", users);

            SysUser usr = null;

            switch (this.RequestAction)
            {
            case RequestActionEnum.Create:
                usr = this.GetPostedData <SysUser>();
                usr.DoCreate();
                this.SetMessage("新建成功!");
                break;

            case RequestActionEnum.Update:
                usr = this.GetMergedData <SysUser>();
                usr.DoUpdate();
                this.SetMessage("保存成功!");
                break;

            case RequestActionEnum.Delete:
                usr = this.GetTargetData <SysUser>();
                usr.DoDelete();
                this.SetMessage("删除成功!");
                break;
            }
        }
Exemplo n.º 26
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (this.IsAsyncRequest)
            {
                SearchCriterion.SetOrder("CreateDate");
                SearchCriterion.SetOrder("SortIndex");
                ents = SysRoleRule.FindAll(SearchCriterion);

                this.PageState.Add("RoleList", ents);
            }

            SysRole ent = null;

            switch (this.RequestAction)
            {
            case RequestActionEnum.Update:
                ent = this.GetMergedData <SysRole>();
                ent.SaveAndFlush();
                this.SetMessage("保存成功!");
                break;

            case RequestActionEnum.Create:
                ent = this.GetPostedData <SysRole>();
                ent.CreateAndFlush();
                this.SetMessage("新建成功!");
                break;

            case RequestActionEnum.Delete:
                ent = this.GetTargetData <SysRole>();
                ent.DeleteAndFlush();
                this.SetMessage("删除成功!");
                break;

            case RequestActionEnum.Custom:
                if (RequestActionString == "refreshsys")
                {
                    PortalService.RefreshSysModules();
                    SetMessage("操作成功!");
                }
                break;
            }

            SysRoleType[] roleTypes = SysRoleTypeRule.FindAll();
            this.PageState.Add("RoleTypeList", roleTypes);
        }
Exemplo n.º 27
0
        /// <summary>
        /// 查询
        /// </summary>
        private void DoSelect()
        {
            string CorpId = string.Empty;

            string where = string.Empty;
            var UsrEnt = SysUser.Find(UserInfo.UserID);

            CommPowerSplit ps = new CommPowerSplit();

            if (ps.IsNoticeRole(UserInfo.UserID, UserInfo.LoginName))
            {
                where += " (WorkFlowState='1' or WorkFlowState='2' or WorkFlowState='-1') ";
                if (!string.IsNullOrEmpty(SearchCriterion.GetSearchValue("Year") + ""))
                {
                    where += "  and  year(ApplyTime)= " + SearchCriterion.GetSearchValue("Year") + " ";
                }
                SearchCriterion.RemoveSearch("Year");
                ents = UsrTravelWelfare.FindAll(SearchCriterion, Expression.Sql(where));
                this.PageState.Add("UsrTravelWelfareList", ents);
            }
            else
            {
                // 判断公司登陆
                UserContextInfo UC = new UserContextInfo();
                CorpId = UC.GetUserCurrentCorpId(UserInfo.UserID);

                //SearchCriterion.AddSearch("CompanyId", CorpId);
                where += " (WorkFlowState='1' or WorkFlowState='2' or WorkFlowState='-1') " + AppealUsrAuth();
                if (!string.IsNullOrEmpty(SearchCriterion.GetSearchValue("Year") + ""))
                {
                    where += "  and  year(ApplyTime)= " + SearchCriterion.GetSearchValue("Year") + " ";
                }
                SearchCriterion.RemoveSearch("Year");
                SearchCriterion.SetOrder("CompanyId", true);
                ents = UsrTravelWelfare.FindAll(SearchCriterion, Expression.Sql(where));
                this.PageState.Add("UsrTravelWelfareList", ents);
            }
        }
Exemplo n.º 28
0
        protected void Page_Load(object sender, EventArgs e)
        {
            cid = RequestData.Get <string>("cid");

            SysParameter ent = null;

            switch (this.RequestAction)
            {
            case RequestActionEnum.Delete:
                ent = this.GetTargetData <SysParameter>();
                ent.DoDelete();
                this.SetMessage("删除成功!");
                break;

            case RequestActionEnum.Custom:
                IList <object> idList = RequestData.GetList <object>("IdList");

                if (idList != null && idList.Count > 0)
                {
                    if (RequestActionString == "batchdelete")
                    {
                        SysParameter.DoBatchDelete(idList.ToArray());
                    }
                }
                break;

            default:
                if (!String.IsNullOrEmpty(cid))
                {
                    SearchCriterion.SetOrder("SortIndex");
                    SearchCriterion.SetSearch("CatalogID", cid);

                    ents = SysParameterRule.FindAll(SearchCriterion);
                    this.PageState.Add("SysEnumerationList", ents);
                }
                break;
            }
        }
Exemplo n.º 29
0
        private void Doselect()
        {
            string CorpId = RequestData.Get("CorpId") + "";

            string where = "";
            foreach (CommonSearchCriterionItem item in SearchCriterion.Searches.Searches)
            {
                if (!String.IsNullOrEmpty(item.Value.ToString()))
                {
                    switch (item.PropertyName)
                    {
                    default:
                        where += " and  jobname like '%" + item.Value + "%' ";
                        break;
                    }
                }
            }

            string SQL = @"select  newid() as Id,jobname As XL from (
	                         select distinct jobname from HR_OA_MiddleDB..fld_gw where isabort='N' and {0}
                           ) AS T where 1=1 ";

            if (!string.IsNullOrEmpty(CorpId))
            {
                SQL = string.Format(SQL, "  pk_corp='" + CorpId + "' ");
            }
            else
            {
                SQL = string.Format(SQL, " 1=1 ");
            }

            SQL = SQL + where;
            SQL = SQL.Replace("HR_OA_MiddleDB", Global.HR_OA_MiddleDB);
            SearchCriterion.SetOrder("XL");
            this.PageState.Add("DataList", GetPageData(SQL, SearchCriterion));
        }
Exemplo n.º 30
0
 /// <summary>
 /// 查询
 /// </summary>
 private void DoSelect()
 {
     SearchCriterion.SetOrder("SortIndex");
     ents = Model.SurveyType.FindAll(SearchCriterion);
     this.PageState.Add("DataList", ents);
 }