Пример #1
0
        /// <summary>
        /// 获取代办列表
        /// </summary>
        /// <param name="loginName"></param>
        /// <param name="user"></param>
        public static List <TodoEntity> GetTodoList(string loginName, UserInfo user)
        {
            List <TodoEntity> list       = new List <TodoEntity>();
            string            auditorStr = "";

            SecurityBll.LogIn(loginName, user);
            if (user != null && user.Roles != null && user.inn != null)
            {
                List <PrManageModel>             prList = GetPrTodoList(user);
                List <ExpenseReimbursementModel> erList = GetErTodoList(user);
                List <TripReimbursementModel>    trList = GetTrTodoList(user);
                if (prList != null && prList.Count > 0)
                {
                    foreach (var item in prList)
                    {
                        TodoEntity entity = new TodoEntity();
                        entity.RecordName      = "PR单" + "(" + item.b_PrRecordNo + ")";
                        entity.Applicant       = item.b_Applicant;
                        entity.FlowStatus      = item.status;
                        entity.ApplicationDate = item.nb_RaisedDate.ToString("yyyy-MM-dd");
                        entity.AuditorStr      = ActivityDA.GetActivityOperator(user.inn, item.activityId);
                        entity.LinkStr         = "https://oa.bordrin.com/PrManage";
                        list.Add(entity);
                    }
                }

                if (erList != null && erList.Count > 0)
                {
                    foreach (var item in erList)
                    {
                        TodoEntity entity = new TodoEntity();
                        entity.RecordName      = "费用报销单" + "(" + item.b_RecordNo + ")";
                        entity.Applicant       = item.b_Employee;
                        entity.FlowStatus      = item.status;
                        entity.ApplicationDate = item.nb_ApplicationDate.GetValueOrDefault().ToString("yyyy-MM-dd");
                        entity.AuditorStr      = ActivityDA.GetActivityOperator(user.inn, item.activityId);
                        entity.LinkStr         = "https://oa.bordrin.com/ExpenseReimbursement";

                        list.Add(entity);
                    }
                }

                if (trList != null && trList.Count > 0)
                {
                    foreach (var item in trList)
                    {
                        TodoEntity entity = new TodoEntity();
                        entity.RecordName      = "差旅报销单" + "(" + item.b_RecordNo + ")";
                        entity.Applicant       = item.b_Employee;
                        entity.FlowStatus      = item.status;
                        entity.ApplicationDate = item.nb_ApplicationDate.GetValueOrDefault().ToString("yyyy-MM-dd");
                        entity.AuditorStr      = ActivityDA.GetActivityOperator(user.inn, item.activityId);
                        entity.LinkStr         = "https://oa.bordrin.com/TripReimbursement";
                        list.Add(entity);
                    }
                }
            }
            return(list);
        }
Пример #2
0
        public string MD5Encode(string userName, string password)
        {
            string encode   = "";
            string errorMsg = ADLogin.LoginAD(userName, password);

            if (errorMsg == "AD Login OK")
            {
                userName = userName + ";" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                encode   = SecurityBll.Encode(userName);
            }
            return(encode);
        }
Пример #3
0
        public List <TodoEntity> GetToDoList(string loginName, string token, string ErrorStr = "")
        {
            string str = SecurityBll.Decode(token);

            string[] strList     = str.Split(';');
            string   name        = strList[0];
            DateTime dateNow     = DateTime.Parse(strList[1]);
            DateTime CurrentTime = DateTime.Now.AddHours(-8);

            if (CurrentTime > dateNow)
            {
                ErrorStr = "令牌超时";
            }
            List <TodoEntity> list = new List <TodoEntity>();

            if (loginName == name && ErrorStr == "")
            {
                UserInfo user = new UserInfo();
                list = ToDoServiceBll.ToDoServiceBll.GetTodoList(loginName, user);
            }
            return(list);
        }