Пример #1
0
        /// <summary>
        /// 催办
        /// </summary>
        /// <param name="Type"></param>
        private void Remind(string Type)
        {
            string SurveyId = this.RequestData.Get("SurveyId") + "";
            var    Ent      = SurveyQuestion.TryFind(SurveyId);

            if (Ent == null)
            {
                this.PageState.Add("State", "0");
                return;
            }

            string NoticeType = string.Empty;

            if (Type == "Email")
            {
                NoticeType = "Email";
            }
            if (Type == "Msg")
            {
                NoticeType = "Message";
            }

            var List = RequestData.GetList <string>("Dt");
            IList <RemindCla> ents = List.Select(tent => JsonHelper.GetObject <RemindCla>(tent) as RemindCla).ToList();

            foreach (var v in ents)
            {
                SysUser User = SysUser.Find(v.UserId);
                //发送通知
                StartSurveyQuestion SQ = new StartSurveyQuestion();
                SQ.SendNotice_Nosubmit(User, NoticeType, Ent.SurveyTitile, Ent.Id, Ent.StartTime.GetValueOrDefault().ToString("yyyy-MM-dd HH:mm:ss"), Ent.EndTime.GetValueOrDefault().ToString("yyyy-MM-dd HH:mm:ss"), Ent.Description.ToString());
            }
        }
Пример #2
0
        /// <summary>
        /// 查询
        /// </summary>
        private void DoSelect()
        {
            string sql = @"select B.GroupID As CorpId ,B.Name As CorpName from sysuser As A 
	                       left join SysGroup As B
                             on A.Pk_corp=B.GroupID
	                       where A.UserID='{0}' "    ;

            sql = string.Format(sql, UserInfo.UserID);
            DataTable Dt = DataHelper.QueryDataTable(sql);

            CommPowerSplit ps = new CommPowerSplit();

            if (ps.IsHR(UserInfo.UserID, UserInfo.LoginName) || ps.IsSetMgrRole(UserInfo.UserID, UserInfo.LoginName)) //设置管理角色 or HR
            {
                ents = WelfareConfig.FindAll(SearchCriterion);
            }
            else
            {
                string  CorpIds = string.Empty;
                SysUser Ent     = SysUser.Find(UserInfo.UserID);

                // 判断公司登陆
                if (Session["CompanyId"] != null)
                {
                    CorpIds = Session["CompanyId"] + "";
                }
                else
                {
                    CorpIds = Ent.Pk_corp;
                }
                ents = WelfareConfig.FindAll(SearchCriterion, Expression.Sql("CorpId='" + CorpIds + "' or CreateId='" + UserInfo.UserID + "' "));
            }

            this.PageState.Add("DataList", ents);
        }
Пример #3
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);
                }
            }
        }
        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);
            }
        }
Пример #5
0
 public string SaveSelectNode(string NodeIds, string RefID)
 {
     if (string.IsNullOrEmpty(NodeIds))
     {
         return("0");
     }
     if (!string.IsNullOrEmpty(RefID))
     {
         string[] idList = JsonConvert.DeserializeObject <string[]>(NodeIds);
         SysUserModuleList.DeleteAll("UserID='" + RefID + "'");  //先删除
         var GrEnt = SysUser.Find(RefID);
         foreach (var item in idList)
         {
             var OrgEnt = DataModel.SysModule.Find(item);
             //创建
             SysUserModuleList Ent = new SysUserModuleList();
             Ent.UserID     = GrEnt.ID;
             Ent.UserName   = GrEnt.Name;
             Ent.ModuleID   = OrgEnt.ID;
             Ent.ModuleName = OrgEnt.Name;
             Ent.ModulePath = OrgEnt.Path; //Path
             Ent.DoCreate();
         }
     }
     else
     {
         return("0");
     }
     return("1");
 }
Пример #6
0
        private void DoSelect()
        {
            string DeptName = Request["DeptName"];
            string year     = Request["year"];
            string month    = Request["month"];

            string where = "";
            if (!string.IsNullOrEmpty(DeptName))
            {
                where += " and  BelongDeptName like '%" + DeptName + "%' ";
            }
            if (!string.IsNullOrEmpty(year))
            {
                where += " and Year =" + year + "";
            }
            if (!string.IsNullOrEmpty(month))
            {
                where += " and Month =" + month + "";
            }
            //获取当前登录用户的部门
            SysUser suEnt = SysUser.Find(WebPortalService.CurrentUserInfo.UserID);

            //suEnt.Server_IAGUID 部门ID      suEnt.Server_Seed  部门名称 100136[杨小伟]
            if (WebPortalService.CurrentUserInfo.Name != "管理员" && WebPortalService.CurrentUserInfo.Name != "赵勤" && WebPortalService.CurrentUserInfo.Name != "王红" && suEnt.LoginName != "100136" && suEnt.LoginName != "100808" && suEnt.LoginName != "100817" && suEnt.LoginName != "104342")
            {
                where += " and BelongDeptId='" + suEnt.Server_IAGUID + "'";
            }
            sql = @"select Id,BelongDeptName,Year,Month,isnull(Status,'未归档') as Status from NCRL_SP..DeptAttendance where 1=1 " + where;
            DataTable td   = DataHelper.QueryDataTable(GetPageData(sql));
            string    str  = JsonHelper.GetJsonStringFromDataTable(td);
            string    json = "{\"pageCount\":" + totalRecord + ",\"rows\":" + str + "}";

            Response.Write(json);
            Response.End();
        }
Пример #7
0
        private void DoSelect()
        {
            string where = "";
            foreach (CommonSearchCriterionItem item in SearchCriterion.Searches.Searches)
            {
                if (!string.IsNullOrEmpty(item.Value.ToString()))
                {
                    switch (item.PropertyName)
                    {
                    case "StartTime":
                        where += " and StartTime>='" + item.Value + "' ";
                        break;

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

                    default:
                        where += " and " + item.PropertyName + " like '%" + item.Value + "%'";
                        break;
                    }
                }
            }
            string sql = @"select * from BJKY_Examine..ExamineTask where ExamineStageId='" + ExamineStageId + "' and ToUserId='" + ToUserId + "'" + where + " order by ToDeptName,BeDeptName,BeUserName asc";

            PageState.Add("DataList", DataHelper.QueryDictList(sql));
            var Obj = new
            {
                ExamineStageName = ExamineStage.Find(ExamineStageId).StageName,
                ToUserName       = SysUser.Find(ToUserId).Name
            };

            PageState.Add("Obj", Obj);
        }
Пример #8
0
        public string DeleteRecord(string Id)
        {
            var Ent = SysUser.Find(Id);

            Ent.State = "-1";
            Ent.DoUpdate();
            return("1");
        }
 private void SelectEdit()
 {
     if (!string.IsNullOrEmpty(UserId))
     {
         string data = JsonHelper.GetJsonString(SysUser.Find(UserId));
         Response.Write("{success: true  ,data:" + data + "}");
         Response.End();
     }
 }
Пример #10
0
        public static void SendMessageByUser(string userId, string message)
        {
            SysUser user = SysUser.Find(userId);//user.Phone

            SendMessage("14782178734", message);
            if (!string.IsNullOrEmpty(user.Email))
            {
                SendMessageServices(mailSenderAddress, "*****@*****.**", "中国瑞林咨询公司审图系统提醒", message, mailAccount, mailPass, mailServer);
            }
        }
Пример #11
0
        private string GetFileIdByUserId(string userId)
        {
            if (!string.IsNullOrEmpty(userId))
            {
                userName = SysUser.Find(userId).Name;
            }
            string fileId = "";

            return(fileId);
        }
        /// <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);
                }
            }
        }
Пример #13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            recid = RequestData.Get <string>("recid");
            title = RequestData.Get <string>("title", String.Empty);
            op    = RequestData.Get <string>("op");

            SysMessage msg = null;

            switch (this.RequestAction)
            {
            case RequestActionEnum.Update:
                msg = this.GetMergedData <SysMessage>();
                msg.SaveAndFlush();
                this.SetMessage("修改成功!");
                break;

            case RequestActionEnum.Insert:
            case RequestActionEnum.Create:
                msg = this.GetPostedData <SysMessage>();

                msg.SenderId   = this.UserInfo.UserID;
                msg.SenderName = this.UserInfo.Name;
                msg.SendTime   = DateTime.Now;

                msg.DoSend();
                this.SetMessage("新建成功!");
                break;

            case RequestActionEnum.Delete:
                msg = this.GetTargetData <SysMessage>();
                msg.DeleteAndFlush();
                this.SetMessage("删除成功!");
                return;
            }

            if (this.Request["Id"] != null)
            {
                msg = SysMessage.Find(this.Request["Id"]);
            }
            else if (op == "c")
            {
                if (!String.IsNullOrEmpty(recid))
                {
                    SysUser tusr = SysUser.Find(recid);

                    PageState.Add("ReceiverInfo", tusr);
                    PageState.Add("Title", title);
                }
            }

            this.SetFormData(msg);
        }
Пример #14
0
        string id = String.Empty;   // 对象id

        protected void Page_Load(object sender, EventArgs e)
        {
            op = RequestData.Get <string>("op"); // 用户编辑操作
            id = RequestData.Get <string>("id");

            SysUser ent = null;

            if (IsAsyncRequest)
            {
                switch (RequestAction)
                {
                case RequestActionEnum.Query:
                case RequestActionEnum.Read:
                case RequestActionEnum.Default:
                    break;

                case RequestActionEnum.Create:
                    ent = this.GetPostedData <SysUser>();
                    ent.DoCreate();
                    break;

                case RequestActionEnum.Update:
                    ent = this.GetMergedData <SysUser>();
                    ent.DoUpdate();
                    break;

                case RequestActionEnum.Delete:
                    ent = this.GetTargetData <SysUser>();
                    ent.DoDelete();
                    break;

                case RequestActionEnum.Custom:
                    if (RequestActionString == "chgpwd")
                    {
                        this.ChgPwd(FormData["LoginName"].ToString(), FormData["OrgPassword"].ToString(), FormData["Password"].ToString());
                    }
                    break;
                }
            }
            else
            {
                if (op != "c")
                {
                    if (!String.IsNullOrEmpty(id))
                    {
                        ent = SysUser.Find(id);
                    }
                }
            }

            this.SetFormData(ent);
        }
Пример #15
0
        public string FreezeUser(string ID)
        {
            var Ent = SysUser.Find(ID);

            if (Ent.State == "1")
            {
                Ent.State = "0"; //0 标识冻结
            }
            else if (Ent.State == "0")
            {
                Ent.State = "1"; //1 启用
            }
            Ent.DoUpdate();
            return("1");
        }
        /// <summary>
        /// 获取旅游金
        /// </summary>
        private void GetMyTravelMoney()
        {
            string SQL = @"select top 1
                                BaseMoney,[Money]
                            from FL_Culture..TravelMoneyConfig where WorkNo='{0}' order by CreateTime desc ";

            SQL = string.Format(SQL, SysUser.Find(UserInfo.UserID).WorkNo);
            DataTable Dt          = DataHelper.QueryDataTable(SQL);
            string    TravleMoney = "|";

            if (Dt.Rows.Count > 0)
            {
                TravleMoney = Dt.Rows[0][0] + "|" + Dt.Rows[0][1];
            }
            this.PageState.Add("TravelMoney", TravleMoney);
        }
Пример #17
0
        public string SaveData(string json)
        {
            SysUser Ent = Newtonsoft.Json.JsonConvert.DeserializeObject <SysUser>(json);

            if (string.IsNullOrEmpty(Ent.ID))
            {
                Ent.DoCreate();
            }
            else
            {
                var SourceEnt = SysUser.Find(Ent.ID);
                var NewEnt    = DataHelper.MergeDataIf <SysUser>(Ent, SourceEnt);
                NewEnt.DoUpdate();
            }
            return(Ent.ID);
        }
Пример #18
0
        /// <summary>
        /// 获取公司当前公司ID
        /// </summary>
        /// <param name="UID"></param>
        /// <returns></returns>
        public string GetUserCurrentCorpId(string UID)
        {
            string CorpIds = string.Empty;

            // 判断公司登陆
            if (Session["CompanyId"] != null)
            {
                CorpIds = Session["CompanyId"] + "";
            }
            else
            {
                SysUser UsrEnt = SysUser.Find(UID);
                CorpIds = UsrEnt.Pk_corp;
            }
            return(CorpIds);
        }
        public UserSession(string userID)
        {
            _sessionID = this.NewSessionID();

            using (new SessionScope())
            {
                SysUser user = SysUser.Find(userID);
                user.RetrieveAllAuth(); // 触发Lazy Read

                if (user != null)
                {
                    _logonInfo = new UserLogonInfo(user);
                }
            }

            _lastActiveTime = DateTime.Now.ToLongTimeString();
        }
Пример #20
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                Aim.Portal.Web.WebPortalService.CheckLogon();
            }
            catch
            {
                Response.Write("<script> window.location.href = '/Login.aspx';</script>");
                Response.End();
            }
            string action = Request["action"];

            UserId = Request["UserId"];
            switch (action)
            {
            case "Create":
                obj = Request["json"];
                ent = JsonHelper.GetObject <SysUser>(obj);
                MD5Encrypt encrypt = new MD5Encrypt();
                ent.Server_IAGUID = "267";
                ent.Server_Seed   = "江西瑞林工程咨询有限公司";
                ent.LoginName     = ent.IDNumber;
                ent.Status        = 1;
                ent.Password      = encrypt.GetMD5FromString(ent.LoginName);
                ent.DoCreate();
                break;

            case "Update":
                obj = Request["json"];
                ent = JsonHelper.GetObject <SysUser>(obj);
                SysUser        ori_Ent = SysUser.Find(ent.UserID);
                EasyDictionary dic     = JsonHelper.GetObject <EasyDictionary>(obj);
                ent = DataHelper.MergeData <SysUser>(ori_Ent, ent, dic.Keys);
                ent.DoUpdate();
                break;

            case "SelectEdit":
                SelectEdit();
                break;

            case "check":
                Check();
                break;
            }
        }
 private void DoSelect()
 {
     if (!string.IsNullOrEmpty(TripId))
     {
         ent = LeaderTrip.Find(TripId);
     }
     else
     {
         ent = new LeaderTrip();
         if (!string.IsNullOrEmpty(UserIds))
         {
             ent.UserIds = UserIds;
             SysUser suEnt = SysUser.Find(UserIds);
             ent.UserNames = suEnt.Name;
         }
         if (!string.IsNullOrEmpty(ColumnId))
         {
             string dt = ColumnId.Substring(0, ColumnId.Length - 2);
             ent.TripStartTime = Convert.ToDateTime(dt);
             ent.StartAMPM     = ColumnId.Substring(ColumnId.Length - 2, 2);
             ent.TripEndTime   = Convert.ToDateTime(dt);
             ent.CreateName    = UserInfo.Name;
             ent.EndAMPM       = "PM";
         }
         else
         {
             ent.CreateName    = UserInfo.Name;
             ent.TripStartTime = Convert.ToDateTime(DateTime.Now.ToShortDateString().Replace("/", "-"));
             ent.StartAMPM     = "AM";
             ent.TripEndTime   = Convert.ToDateTime(DateTime.Now.ToShortDateString().Replace("/", "-"));
             ent.EndAMPM       = "PM";
         }
         //如果当前用户在领导信息清单中,直接将领导名称设置为当前登录人,否则 为空
         IList <InstituteLeader> ilEnts = InstituteLeader.FindAllByProperty(InstituteLeader.Prop_UserId, UserInfo.UserID);
         if (ilEnts.Count > 0)
         {
             ent.UserIds   = UserInfo.UserID;
             ent.UserNames = UserInfo.Name;
         }
     }
     SetFormData(ent);
     PageState.Add("FormData", ent);
     sql = "select * from BJKY_IntegratedManage..InstituteLeader order by SortIndex asc";
     PageState.Add("LeaderData", DataHelper.QueryDictList(sql));
 }
Пример #22
0
        /// <summary>
        /// 获取人员信息
        /// </summary>
        private void GetDetailInfo()
        {
            string UserId = RequestData.Get("UserId") + "";

            if (!string.IsNullOrEmpty(UserId))
            {
                SysUser  UsrEnt = SysUser.Find(UserId);
                SysGroup CrpEnt = SysGroup.Find(UsrEnt.Pk_corp);
                string   val    = UsrEnt.WorkNo + "|" + CrpEnt.GroupID + "|" + CrpEnt.Name + "|" + UsrEnt.Indutydate;

                string     Money   = string.Empty;
                ComUtility Utility = new ComUtility();
                Money = Utility.GetTravelMoney(UsrEnt.WorkNo);

                val = val + "|" + Money + "|" + Utility.GetTravelBaseMoney(UsrEnt.WorkNo);
                this.PageState.Add("RtnVal", val);
            }
        }
Пример #23
0
        /// <summary>
        /// 获取岗位
        /// </summary>
        /// <param name="UserId">人员Id</param>
        /// <returns>岗位</returns>
        public static string getPost(string UserId, string DeptId, string type)
        {
            string result = "";
            string pk_gw  = "";

            if (string.IsNullOrEmpty(UserId))
            {
                return("");
            }

            string MiddleDBName = ConfigurationManager.AppSettings["MiddleDBName"];
            string workNo       = SysUser.Find(UserId).WorkNo;

            if (type == "CompanyId")
            {
                pk_gw = DataHelper.QueryValue("select top 1 PK_gw from " + MiddleDBName + "..fld_ryxx where psncode='" + workNo + "' and pk_corp='" + DeptId + "'") + "";
            }
            else
            {
                //有可能一个公司有多条,根据部门Path取
                int gws = DataHelper.QueryValue <int>("select count(1) from " + MiddleDBName + "..fld_ryxx where psncode='" + workNo + "' and pk_corp=(select top 1 pk_corp from " + MiddleDBName + "..fld_bmml where pk_deptdoc='" + DeptId + "')");
                if (gws > 1)
                {
                    string path = DataHelper.QueryValue("select [path]+GroupId from SysGroup where GroupId='" + DeptId + "'") + "";
                    pk_gw = DataHelper.QueryValue("select top 1 pk_gw from " + MiddleDBName + "..fld_ryxx where psncode='" + workNo + "' and '" + path + "' like '%'+ pk_deptdoc+'%'") + "";
                }
                else
                {
                    pk_gw = DataHelper.QueryValue("select top 1 PK_gw from " + MiddleDBName + "..fld_ryxx where psncode='" + workNo + "' and pk_corp=(select top 1 pk_corp from " + MiddleDBName + "..fld_bmml where pk_deptdoc='" + DeptId + "')") + "";
                }
            }

            if (string.IsNullOrEmpty(pk_gw))
            {
                pk_gw = DataHelper.QueryValue("select top 1 PK_gw from SysUser where UserId='" + UserId + "' and isnull(outdutydate,'')=''") + "";
            }
            SysRole role = SysRole.TryFind(pk_gw);

            if (role != null)
            {
                result = role.Name;
            }
            return(result);
        }
Пример #24
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                SysUser suEnt  = SysUser.Find(UserInfo.UserID);
                string  action = Request["action"] + "";
                switch (action)
                {
                case "upload":
                    string fileId = Request["fileId"];
                    if (!string.IsNullOrEmpty(suEnt.Ext2))
                    {
                        fiEnt = FileItem.Find(suEnt.Ext2);
                        fiEnt.DoDelete();    //如果存在旧的图像将旧的图像文件删除
                        FileInfo fi = new FileInfo(@"D:\RW\Files\AppFiles\Portal\Default\" + fiEnt.Id + "_" + fiEnt.Name);
                        if (fi.Exists)
                        {
                            fi.Delete();
                        }
                    }
                    suEnt.Ext2 = fileId;
                    suEnt.DoUpdate();
                    Response.Write(fileId);
                    Response.End();
                    break;

                default:
                    if (!string.IsNullOrEmpty(suEnt.Ext2))
                    {
                        fiEnt = FileItem.Find(suEnt.Ext2);
                        this.userimage.Src = @"/Document/" + fiEnt.Id + "_" + fiEnt.Name;
                    }
                    break;
                }
                IniPersonalCenter();
                IniWeather();
                IniNotice();
                IniNews();
                IniMyLink();
                IniTaskWebPart();
                //PromptWin();
            }
        }
Пример #25
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                Aim.Portal.Web.WebPortalService.CheckLogon();
            }
            catch
            {
                Response.Redirect("/Login.aspx");
            }
            string    action = Request["action"];
            string    sql    = "";
            DataTable dt     = null;

            string where = "";
            switch (action)
            {
            case "select":
                if (!string.IsNullOrEmpty(Request["ProjectName"]))
                {
                    where += " and ProjectName like '%" + Request["ProjectName"] + "%'";
                }
                if (!string.IsNullOrEmpty(Request["PManagerName"]))
                {
                    where += " and PManagerName like '%" + Request["PManagerName"] + "%'";
                }
                //管理员 100136[杨小伟]能看到所有的项目考勤 项目总监只能看到自身的项目考勤 Aim.Portal.Web.WebPortalService.CurrentUserInfo.UserID;
                SysUser suEnt = SysUser.Find(WebPortalService.CurrentUserInfo.UserID);
                if (WebPortalService.CurrentUserInfo.Name == "管理员" || WebPortalService.CurrentUserInfo.Name == "赵勤" || WebPortalService.CurrentUserInfo.Name == "王红" || suEnt.LoginName == "100136" || suEnt.LoginName == "100808" || suEnt.LoginName == "100817" || suEnt.LoginName == "104342")
                {
                    sql = @"select * from NCRL_SP..ProjectAttendance where 1=1 " + where;
                }
                else
                {
                    sql = @"select * from NCRL_SP..ProjectAttendance where (CreateName='{0}' or PManagerName='{0}') " + where;
                    sql = string.Format(sql, WebPortalService.CurrentUserInfo.Name);
                }
                dt = DataHelper.QueryDataTable(GetPageSql(sql));
                Response.Write("{rows:" + JsonHelper.GetJsonStringFromDataTable(dt) + ",total:" + totalProperty + "}");
                Response.End();
                break;
            }
        }
        private void CreateGuid()
        {
            SurveyQuestion ent = new SurveyQuestion();
            var            Et  = SysUser.Find(UserInfo.UserID);

            ent.IsFixed = "0";                          //0 一般调查问卷
            UserContextInfo UC = new UserContextInfo();

            ent.CompanyId = UC.GetUserCurrentCorpId(UserInfo.UserID); //判断公司登陆

            //部门
            string DeptSQL = @"select A.UserID,A.WorkNo,A.Name,B.GroupID as CropId,B.Name as CropName,
                                    C.GroupID as DeptId,C.Name as DeptName
                             from FL_PortalHR..SysUser As A
	                            left join FL_PortalHR..SysGroup As B
                              on  A.Pk_corp=B.GroupID
	                            left join  FL_PortalHR..SysGroup As C
                              on A.Pk_deptdoc=C.GroupID
                            where UserID='{0}' and  A.pk_corp='{1}' ";

            DeptSQL = DeptSQL.Replace("FL_PortalHR", Global.AimPortalDB);
            DeptSQL = string.Format(DeptSQL, UserInfo.UserID, Et.Pk_corp);

            DataTable dt = DataHelper.QueryDataTable(DeptSQL);

            if (dt.Rows.Count > 0)
            {
                ent.CompanyId   = dt.Rows[0]["CropId"].ToString();
                ent.CompanyName = dt.Rows[0]["CropName"].ToString();

                ent.DeptId   = dt.Rows[0]["DeptId"].ToString();
                ent.DeptName = dt.Rows[0]["DeptName"].ToString();
            }
            else
            {
                ent.CompanyName = DataHelper.QueryValue("select * from sysgroup where GroupId='" + ent.CompanyId + "'") + "";
            }

            ent.DoCreate();
            this.PageState.Add("Guid", ent.Id);
        }
        //通知范围检查
        private void CKSubmit()
        {
            string Id = RequestData.Get("Id") + "";

            string CorpIds = string.Empty;
            var    UsrEnt  = SysUser.Find(Id);

            if (Session["CompanyId"] != null)
            {
                CorpIds = Session["CompanyId"] + "";
            }
            else
            {
                CorpIds = UsrEnt.Pk_corp;
            }

            ComUtility Ut    = new ComUtility();
            string     UsrId = Ut.CheckApply("员工体检", UserInfo.UserID, CorpIds);

            this.PageState.Add("State", UsrId);
        }
Пример #28
0
        /// <summary>
        /// 查询
        /// </summary>
        private void DoSelect()
        {
            var    UserEnt = SysUser.Find(UserInfo.UserID);
            string CorpIds = string.Empty;

            CommPowerSplit ps = new CommPowerSplit();

            if (ps.IsNoticeRole(UserInfo.UserID, UserInfo.LoginName))
            {
                ents = UseWelfareNote.FindAll(SearchCriterion);
            }
            else
            {
                // 判断公司登陆
                UserContextInfo UC = new UserContextInfo();
                CorpIds = UC.GetUserCurrentCorpId(UserInfo.UserID);

                SearchCriterion.SetSearch("CreateCorp", CorpIds);
                ents = UseWelfareNote.FindAll(SearchCriterion);
            }
            this.PageState.Add("UseWelfareNoteList", ents);
        }
Пример #29
0
        /// <summary>
        /// 审批人配置判断
        /// </summary>
        private void GetApproveUser()
        {
            var    UsrEnt = SysUser.Find(UserInfo.UserID);
            string SQL    = @"with GetTree
                                as
                                (
	                                select * from HR_OA_MiddleDB..fld_bmml where pk_deptdoc='{0}'
	                                union all
	                                select A.*
	                                from HR_OA_MiddleDB..fld_bmml As A 
	                                join GetTree as B 
	                                on  A.pk_deptdoc=B.pk_fathedept
                                )
	                           select deptname+',' as [text()] from getTree FOR XML PATH('') "    ;

            SQL = SQL.Replace("HR_OA_MiddleDB", Global.HR_OA_MiddleDB);
            SQL = string.Format(SQL, UsrEnt.Pk_deptdoc);
            string DeptPathStr = DataHelper.QueryValue(SQL) + "";

            // 判断公司登陆
            string          CorpIds = string.Empty;
            UserContextInfo UC      = new UserContextInfo();

            CorpIds = UC.GetUserCurrentCorpId(UserInfo.UserID);

            //选取配置最近的配置  HR经理
            SQL = @"select top 1 HRManagerId As UserID,HRManagerName As Name ,
	                                case when patindex('%'+DeptName+'%','{1}')=0  then 100
		                                 else  patindex('%'+DeptName+'%','{1}') 
	                                end  As SortIndex 
                                from FL_Culture..SysApproveConfig As A
                                where A.CompanyId='{0}'  and HRManagerId is not null  order by SortIndex";
            SQL = string.Format(SQL, CorpIds, DeptPathStr);

            DataTable AppUsrDt = DataHelper.QueryDataTable(SQL);
            string    status   = AppUsrDt.Rows.Count > 0 ? "1" : "0";

            this.PageState.Add("Status", status);
        }
Пример #30
0
        // //问卷模板
        private void GetTplEnum()
        {
            string         SQL = string.Empty;
            CommPowerSplit ps  = new CommPowerSplit();

            if (ps.IsSurveyRole(UserInfo.UserID, UserInfo.LoginName))  //admin or surveyRole
            {
                SQL = @"select Id,SurveyTitile As Name from FL_Culture..SurveyQuestion
                             where IsFixed='1' and State='1'";
                SQL = SQL.Replace("FL_PortalHR", Global.AimPortalDB);
                PageState.Add("tplEnum", DataHelper.QueryDict(SQL));
            }
            else
            {
                var Ent = SysUser.Find(UserInfo.UserID);
                SQL = @" select Id,SurveyTitile As Name from FL_Culture..SurveyQuestion
                             where IsFixed='1' and State='1' and CompanyId='{0}' Or charindex('{0}',GrantCorpId ) >0 ";
                SQL = SQL.Replace("FL_PortalHR", Global.AimPortalDB);
                SQL = string.Format(SQL, Ent.Pk_corp);
                PageState.Add("tplEnum", DataHelper.QueryDict(SQL));
            }
        }