コード例 #1
0
        private void DoSelect()
        {
            //            string sql = @"select
            //                             SurveyedUserId as UserId,SurveryUserName as UserName,
            //                             C.GroupID as DeptId,C.Name As DeptName,D.IsNoName
            //                           from BJKY_IntegratedManage..SurveyCommitHistory As A
            //                            left join BJKY_Portal..SysUserGroup As B
            //                                on A.SurveyedUserId=B.UserId
            //                            left join BJKY_Portal..SysGroup As C
            //                                on C.GroupID=B.GroupID
            //                            left  join BJKY_IntegratedManage..SurveyQuestion AS D
            //	                            on D.Id=A.SurveyId
            //                           where A.SurveyId='{0}' and 1=1 ";
            string sql = @"select 
	                            SurveyedUserId as UserId,SurveryUserName as UserName,D.IsNoName,A.CreateTime
                           from BJKY_IntegratedManage..SurveyCommitHistory As A
                            left  join BJKY_IntegratedManage..SurveyQuestion AS D
	                            on D.Id=A.SurveyId				
                           where A.SurveyId='{0}' and 1=1";

            if (SearchCriterion.GetSearchValue("UserName") != null)
            {
                sql = sql.Replace("and 1=1", " and A.SurveryUserName like '%" + SearchCriterion.GetSearchValue("UserName") + "%'");
            }
            if (!string.IsNullOrEmpty(Id))
            {
                sql = string.Format(sql, Id);
                this.PageState.Add("DataList", GetPageData(sql, SearchCriterion));
            }
        }
コード例 #2
0
        private void DoSelect()
        {
            SearchCriterion.SetOrder("SortIndex");
            var ents = Model.ManagementGroup.FindAll(SearchCriterion);

            this.PageState.Add("DataList", ents);
        }
コード例 #3
0
        private void DoSelect()
        {
            SearchCriterion.AddSearch(ExamineTask.Prop_ExamineStageId, ExamineStageId);
            IList <ExamineStageResult> esrEnts = ExamineStageResult.FindAll(SearchCriterion);

            PageState.Add("DataList", esrEnts);
        }
コード例 #4
0
        public IEnumerable <AcadrePWIcase> SearchCases(SearchCriterion searchCriterion)
        {
            List <AcadrePWIcase> acadrePWIcases = new List <AcadrePWIcase>();
            var request = new RestRequest("/Frontend/api/v8/case", Method.GET);

            request.RequestFormat = DataFormat.Json;
            request.AddParameter("SearchCaseType", CaseFileTypeCode);
            if (searchCriterion.IsClosed.HasValue)
            {
                request.AddParameter("Active", !searchCriterion.IsClosed);
            }
            request.AddParameter("page-size", 100);
            if (searchCriterion.PrimaryContactsName != "")
            {
                request.AddParameter("ContactSearchKey", searchCriterion.PrimaryContactsName);
            }
            request.AddParameter("SearchTerm", searchCriterion.CaseContent);
            int i = 0;

            while (true)
            {
                request.AddOrUpdateParameter("page-index", i);
                var response = Execute(request).Content;
                var acadrePWIcasesresponse = JsonConvert.DeserializeObject <AcadrePWIcase[]>(response);
                acadrePWIcases.AddRange(acadrePWIcasesresponse);
                if (acadrePWIcasesresponse.Length < 100)
                {
                    break;
                }
                i++;
            }
            return(acadrePWIcases.Where(x => (x.ResponsibleUserName == searchCriterion.CaseManagerInitials || searchCriterion.CaseManagerInitials == null) /*&& (searchCriterion.PrimaryContactsName.Replace("*","").Split(' ').Where(y=>x.Description.Contains(y)).Any() || searchCriterion.PrimaryContactsName == "")*/ && (searchCriterion.AcadreOrgID == x.ResponsibleUnit.Id || searchCriterion.AcadreOrgID == 0) && (searchCriterion.ChildCPR == x.Title || searchCriterion.ChildCPR == "*") && (searchCriterion.KLE == null /*|| searchCriterion.KLE = x.Classification*/)));
        }
コード例 #5
0
        private DataTable GetPageData(String sql, SearchCriterion search)
        {
            string constr = ConfigurationManager.AppSettings["conStr"] + "";

            using (SqlConnection con = new SqlConnection(constr))
            {
                con.Open();
                using (SqlCommand sqlcmd = new SqlCommand())
                {
                    SqlCommand cmd = new SqlCommand(sql, con);
                    int        k   = cmd.ExecuteNonQuery();
                    cmd.CommandText = @"select count(1) from #ST";
                    k = int.Parse(cmd.ExecuteScalar() + "");

                    cmd.CommandText = @"select * from 
                                        (
                                          select  ROW_NUMBER() OVER (order by SurveyId)as RN ,#ST.*
                                         from #ST
                                        )T where RN Between {0} and {1} ";
                    cmd.CommandText = string.Format(cmd.CommandText, (search.CurrentPageIndex - 1) * search.PageSize + 1, search.CurrentPageIndex * search.PageSize);

                    DataTable      dt  = new DataTable();
                    SqlDataAdapter dap = new SqlDataAdapter(cmd);
                    dap.Fill(dt);
                    SearchCriterion.RecordCount = k;

                    return(dt);
                }
            }
        }
コード例 #6
0
        /// <summary>
        /// 查询
        /// </summary>
        private void DoSelect()
        {
            EasyDictionary dic = SysEnumeration.GetEnumDict("EmpAppeal");

            dic.Add("%%", "请选择...");
            PageState.Add("AppealTypeName", dic);


            //问卷角色或管理员
            CommPowerSplit Role = new CommPowerSplit();

            if (Role.IsAppealRole(UserInfo.UserID, UserInfo.LoginName))
            {
                ents = UsrAppealList.FindAll(SearchCriterion);
                this.PageState.Add("UsrAppealListList", ents);
            }
            else
            {
                StringBuilder strb = new StringBuilder();
                if (Session["CompanyId"] != null)           //判断公司登陆
                {
                    SearchCriterion.SetSearch(UsrAppealList.Prop_CompanyId, Session["CompanyId"]);
                    ents = UsrAppealList.FindAll(SearchCriterion);
                    this.PageState.Add("UsrAppealListList", ents);
                }
                else
                {
                    var UsrEnt = SysUser.Find(UserInfo.UserID);
                    SearchCriterion.SetSearch(UsrAppealList.Prop_CompanyId, UsrEnt.Pk_corp);
                    ents = UsrAppealList.FindAll(SearchCriterion);
                    this.PageState.Add("UsrAppealListList", ents);
                }
            }
        }
コード例 #7
0
        private void SearchCriteriaDataGridView_CellEndEdit(object sender, DataGridViewCellEventArgs e)
        {
            ColumnDefinition colDef = (ColumnDefinition)ColumnListBox.SelectedItem;

            SearchCriterion[] criterions = searchCriteria.CriterionList.Find(colDef.ColumnName);
            SearchCriterion   criterion  = criterions[e.RowIndex];

            DataGridViewCell cell = SearchCriteriaDataGridView.Rows[e.RowIndex].Cells[e.ColumnIndex];

            if (e.ColumnIndex == TERM_INDEX)
            {
                SetTermValue(criterion, cell.Value.ToString());
            }
            else if (e.ColumnIndex == OPERATOR_INDEX)
            {
                SetOperatorValue(criterion, cell.Value.ToString());
            }
            else
            {
                if (cell.Value == null)
                {
                    SetValue(colDef, criterion, "");
                }
                else
                {
                    SetValue(colDef, criterion, cell.Value.ToString());
                }
            }
        }
コード例 #8
0
        private IList <EasyDictionary> GetPageData(String sql, SearchCriterion search)
        {
            string ordercol = "SaveTime";

            if (RequestData.Get <string>("op") == "r")
            {
                ordercol = "PostTime";
            }

            SearchCriterion.RecordCount = DataHelper.QueryValue <int>("select count(*) from (" + sql + ") t");
            string order   = search.Orders.Count > 0 ? search.Orders[0].PropertyName : ordercol;
            string asc     = search.Orders.Count <= 0 || !search.Orders[0].Ascending ? " desc" : " asc";
            string pageSql = @"
		    WITH OrderedOrders AS
		    (SELECT *,
		    ROW_NUMBER() OVER (order by {0} {1})as RowNumber
		    FROM ({2}) temp ) 
		    SELECT * 
		    FROM OrderedOrders 
		    WHERE RowNumber between {3} and {4}"        ;

            pageSql = string.Format(pageSql, order, asc, sql, (search.CurrentPageIndex - 1) * search.PageSize + 1, search.CurrentPageIndex * search.PageSize);
            IList <EasyDictionary> dicts = DataHelper.QueryDictList(pageSql);

            return(dicts);
        }
コード例 #9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            cid   = RequestData.Get <string>("cid", String.Empty);
            type  = RequestData.Get <string>("type", String.Empty).ToLower();
            ctype = RequestData.Get <string>("ctype", "role").ToLower();

            if (!String.IsNullOrEmpty(cid))
            {
                try
                {
                    int icid = Convert.ToInt32(cid);

                    SearchCriterion.AddSearch("Type", icid);

                    ents = SysRoleRule.FindAll(SearchCriterion);
                }
                catch { }
            }
            else
            {
                ents = SysRoleRule.FindAll(SearchCriterion);
            }

            this.PageState.Add("DtList", ents);
        }
コード例 #10
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);
                }
            }
        }
コード例 #11
0
        private void DoSelect()
        {
            string index = RequestData.Get <string>("Index");

            string where = "";
            string detailwhere      = "";
            string payState         = RequestData.Get <string>("PayState");
            string inWarehouseState = RequestData.Get <string>("InWarehouseState");
            string orderState       = RequestData.Get <string>("OrderState");

            if (!string.IsNullOrEmpty(payState))
            {
                SearchCriterion.AddSearch("PayState", payState);
            }
            if (!string.IsNullOrEmpty(inWarehouseState))
            {
                SearchCriterion.AddSearch("InWarehouseState", inWarehouseState);
            }
            if (!string.IsNullOrEmpty(orderState))
            {
                SearchCriterion.AddSearch("OrderState", orderState);
            }
            string sql = string.Empty;

            foreach (CommonSearchCriterionItem item in SearchCriterion.Searches.Searches)
            {
                if (item.PropertyName == "BeginDate" && item.Value.ToString() != "")
                {
                    where += " and CreateTime>'" + item.Value + "' ";
                }
                else if (item.PropertyName == "EndDate" && item.Value.ToString() != "")
                {
                    where += " and CreateTime<'" + (item.Value.ToString()).Replace(" 0:00:00", " 23:59:59") + "' ";
                }
                else if (item.Value.ToString() != "")
                {
                    if (item.PropertyName != "Code")
                    {
                        where += " and " + item.PropertyName + " like '%" + item.Value + "%'";
                    }
                    else
                    {
                        detailwhere = "where " + item.PropertyName + " like '%" + item.Value + "%'";
                    }
                }
            }
            if (index == "0")
            {
                sql = @"select A.* from SHHG_AimExamine..PurchaseOrder as A                       
                where A.InWarehouseState='未入库' and A.Id in 
                (select distinct PurchaseOrderId from SHHG_AimExamine..PurchaseOrderDetail " + detailwhere + ")" + where;
            }//采购人员也能看到别人做的采购订单所以这里不加人员过滤
            else
            {
                sql = @"select A.* from SHHG_AimExamine..PurchaseOrder as A           
                where A.InWarehouseState='已入库' and  A.Id in
                (select distinct PurchaseOrderId from SHHG_AimExamine..PurchaseOrderDetail " + detailwhere + ")" + where;
            }
            PageState.Add("PurchaseOrderList", GetPageData(sql, SearchCriterion));
        }
コード例 #12
0
        /// <summary>
        /// 查询
        /// </summary>
        private void DoSelect()
        {
            SearchCriterion.AddSearch("UserId", UserInfo.UserID);
            string where = "";
            foreach (CommonSearchCriterionItem item in SearchCriterion.Searches.Searches)
            {
                if (!String.IsNullOrEmpty(item.Value.ToString()) && item.PropertyName == "Month")
                {
                    where += " month(ApplyTime)=" + item.Value.ToString() + " ";
                }
                if (!String.IsNullOrEmpty(item.Value.ToString()) && item.PropertyName == "Year")
                {
                    where += " Year(ApplyTime)=" + item.Value.ToString() + " ";
                }
            }
            if (!string.IsNullOrEmpty(where))
            {
                SearchCriterion.Searches.RemoveSearch("Month");
                SearchCriterion.Searches.RemoveSearch("Year");
                ents = UsrChildWelfare.FindAll(SearchCriterion, Expression.Sql(where));
            }
            else
            {
                ents = UsrChildWelfare.FindAll(SearchCriterion);
            }

            this.PageState.Add("UsrChildWelfareList", ents);
        }
コード例 #13
0
        private void DoSelect()
        {
            CommPowerSplit ps = new CommPowerSplit();

            if (ps.IsSurveyRole(UserInfo.UserID, UserInfo.LoginName))
            {
                this.PageState.Add("IsCanGrant", "1");
                SearchCriterion.SetSearch("IsFixed", "1");  //
                SurveyQuestion[] Ents = SurveyQuestion.FindAll(SearchCriterion);
                this.PageState.Add("DataList", Ents);
            }
            else
            {
                string SQL = @"select  * from  SysRole  As A
	                         inner join  SysUserRole As B
                           on  A.RoleID=B.RoleID  
                            where A.Code='PubSurvey' and B.UserId='{0}'";
                SQL = string.Format(SQL, UserInfo.UserID);
                object obj = DataHelper.QueryValue(SQL);
                if (obj == null)
                {
                    if (Session["CompanyId"] != null)
                    {
                        string CorpId = Session["CompanyId"].ToString();
                        CorpId = !string.IsNullOrEmpty(CorpId) ? CorpId : "1007";
                        SearchCriterion.SetSearch("CompanyId", CorpId);
                    }
                }
                SearchCriterion.SetSearch("IsFixed", "1");  //
                SurveyQuestion[] Ents = SurveyQuestion.FindAll(SearchCriterion);
                this.PageState.Add("DataList", Ents);
            }
        }
コード例 #14
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.Delete();
                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);
                    //SearchCriterion.SetOrder("FinishTime", true);
                    ents = Aim.WorkFlow.TaskRule.FindAll(SearchCriterion).OrderBy(ens => !ens.FinishTime.HasValue ? DateTime.Now : ens.FinishTime).OrderBy(ens => ens.CreatedTime).ToArray();
                    this.PageState.Add("SysWorkFlowTaskList", ents);
                }
                break;
            }
        }
コード例 #15
0
        private void DoSelect()
        {
            CommPowerSplit ps = new CommPowerSplit();

            if (ps.IsSurveyRole(UserInfo.UserID, UserInfo.LoginName))
            {
                SearchCriterion.SetSearch("IsFixed", "2");  //固定问卷
                SurveyQuestion[] Ents = SurveyQuestion.FindAll(SearchCriterion);
                this.PageState.Add("DataList", Ents);
            }
            else
            {
                SearchCriterion.SetSearch("IsFixed", "2");  //固定问卷
                string CompanyId = string.Empty;            //公司ID

                //first depend login corpid
                var             Ent = SysUser.Find(UserInfo.UserID);
                UserContextInfo UC  = new UserContextInfo();
                CompanyId = UC.GetUserCurrentCorpId(UserInfo.UserID);

                SearchCriterion.AddSearch("CompanyId", CompanyId);
                SurveyQuestion[] Ents = SurveyQuestion.FindAll(SearchCriterion);
                this.PageState.Add("DataList", Ents);
            }
        }
コード例 #16
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);
        }
コード例 #17
0
 private void SetOperatorValue(SearchCriterion criterion, string cellValue)
 {
     if (cellValue == OPERATOR_IS_EQUAL)
     {
         criterion.OperatorType = SearchCriterion.OperatorTypeEnum.IsEqual;
     }
     else if (cellValue == OPERATOR_IS_NOT_EQUAL)
     {
         criterion.OperatorType = SearchCriterion.OperatorTypeEnum.IsNotEqual;
     }
     else if (cellValue == OPERATOR_LESS_THAN)
     {
         criterion.OperatorType = SearchCriterion.OperatorTypeEnum.LessThan;
     }
     else if (cellValue == OPERATOR_LESS_THAN_EQUAL)
     {
         criterion.OperatorType = SearchCriterion.OperatorTypeEnum.LessThanEqual;
     }
     else if (cellValue == OPERATOR_GREATER_THAN)
     {
         criterion.OperatorType = SearchCriterion.OperatorTypeEnum.GreaterThan;
     }
     else if (cellValue == OPERATOR_GREATER_THAN_EQUAL)
     {
         criterion.OperatorType = SearchCriterion.OperatorTypeEnum.GreaterThanEqual;
     }
     else if (cellValue == OPERATOR_LIKE)
     {
         criterion.OperatorType = SearchCriterion.OperatorTypeEnum.Like;
     }
     else if (cellValue == OPERATOR_NOT_LIKE)
     {
         criterion.OperatorType = SearchCriterion.OperatorTypeEnum.NotLike;
     }
 }
コード例 #18
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));
        }
コード例 #19
0
        /// <summary>
        /// 查询
        /// </summary>
        private void DoSelect()
        {
            string QuestionId = RequestData.Get <string>("Id");

            SearchCriterion.AddSearch(EmpVoiceAnswerInfo.Prop_QuestionId, QuestionId);
            ents = EmpVoiceAnswerInfo.FindAll(SearchCriterion);
            this.PageState.Add("EmpVoiceAnswerInfoList", ents);
        }
コード例 #20
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"));
 }
コード例 #21
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);
                }
            }
        }
コード例 #22
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); // 操作分割符
            }
        }
コード例 #23
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);
            }
        }
コード例 #24
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);
     }
 }
コード例 #25
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));
            }
        }
コード例 #26
0
        /// <summary>
        /// 查询
        /// </summary>
        private void DoSelect()
        {
            SearchCriterion.SetSearch(UsrAppealList.Prop_UserId, UserInfo.UserID);
            ents = UsrAppealList.FindAll(SearchCriterion);
            this.PageState.Add("UsrAppealListList", ents);

            EasyDictionary dic = SysEnumeration.GetEnumDict("EmpAppeal");

            dic.Add("%%", "请选择...");
            PageState.Add("AppealTypeName", dic);
        }
コード例 #27
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);
                }
            }
        }
コード例 #28
0
        private void DoSelect()
        {
            string type = this.RequestData.Get("VedioType") + "";

            if (!string.IsNullOrEmpty(type))
            {
                SearchCriterion.AddSearch(Vedio.Prop_VedioType, type);
            }
            ents = Vedio.FindAll(SearchCriterion);
            this.PageState.Add("DataList", ents);
        }
コード例 #29
0
        /// <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);
                }
            }
        }
コード例 #30
0
 private void SetTermValue(SearchCriterion criterion, string cellValue)
 {
     if (cellValue == TERM_OR)
     {
         criterion.TerminalType = SearchCriterion.TerminalTypeEnum.Or;
     }
     else
     {
         criterion.TerminalType = SearchCriterion.TerminalTypeEnum.And;
     }
 }
コード例 #31
0
ファイル: MainForm.cs プロジェクト: rahulsinghch26/imgburn
 private void lV_licenseDetailUser_Enter(object sender, EventArgs e)
 {
     _searchCriterion = SearchCriterion.LicenseByUser;
 }
コード例 #32
0
 public SearchCriterionEntry(int cliloc, SearchCriterion criterion)
 {
     Cliloc = cliloc;
     Criterion = criterion;
 }
コード例 #33
0
ファイル: MainForm.cs プロジェクト: rahulsinghch26/imgburn
 private void lV_licenseDetailProduct_Enter(object sender, EventArgs e)
 {
     _searchCriterion = SearchCriterion.LicenseByProduct;
 }
コード例 #34
0
ファイル: MainForm.cs プロジェクト: rahulsinghch26/imgburn
 private void lV_licenseProduct_Enter(object sender, EventArgs e)
 {
     _searchCriterion = SearchCriterion.ProductWithLicense;
 }
コード例 #35
0
ファイル: MainForm.cs プロジェクト: rahulsinghch26/imgburn
        private void SelectControls(SearchCriterion searchCriterion)
        {
            System.Diagnostics.Debug.WriteLine("Switching: " + searchCriterion.ToString());
            switch (searchCriterion)
            {
                case SearchCriterion.Product:
                    tC_main.SelectedTab = tC_main.TabPages["tP_products"];
                    lV_searchResult = lV_products;
                    break;

                case SearchCriterion.ProductWithLicense:
                    tC_main.SelectedTab = tC_main.TabPages["tP_licenseProduct"];
                    lV_searchResult = lV_licenseProduct;
                    break;

                case SearchCriterion.LicenseByProduct:
                    tC_main.SelectedTab = tC_main.TabPages["tP_licenseProduct"];
                    lV_searchResult = lV_licenseDetailProduct;
                    break;

                case SearchCriterion.UserWithLicense:
                    tC_main.SelectedTab = tC_main.TabPages["tP_licenseUser"];
                    lV_searchResult = lV_licenseUser;
                    break;

                case SearchCriterion.LicenseByUser:
                    tC_main.SelectedTab = tC_main.TabPages["tP_licenseUser"];
                    lV_searchResult = lV_licenseDetailUser;
                    break;

                default:
                    tC_main.SelectedTab = tC_main.TabPages["tP_products"];
                    lV_searchResult = lV_products;
                    break;
            }
        }
コード例 #36
0
ファイル: MainForm.cs プロジェクト: rahulsinghch26/imgburn
 private void PopulateForm()
 {
     if (tC_main.SelectedTab == tC_main.TabPages["tP_licenseUser"])
     {
         tS_license.Visible = true;
         _searchCriterion = SearchCriterion.UserWithLicense;
         PopulateUserLicenseListView();
     }
     else if (tC_main.SelectedTab == tC_main.TabPages["tP_licenseProduct"])
     {
         tS_license.Visible = true;
         _searchCriterion = SearchCriterion.ProductWithLicense;
         PopulateProductLicenseListView();
     }
     else
     {
         tS_license.Visible = false;
         _searchCriterion = SearchCriterion.Product;
         PopulateProductListView();
     }
 }
コード例 #37
0
ファイル: MainForm.cs プロジェクト: rahulsinghch26/imgburn
 private void lV_licenseUser_Enter(object sender, EventArgs e)
 {
     _searchCriterion = SearchCriterion.UserWithLicense;
 }