示例#1
0
        public ExecuteProcess UpdateUser(QueryUser model)
        {
            var pAction = new ExecuteProcess();

            try
            {
                if (new NTS.WEB.BLL.User().IsExistUserName(model))
                {
                    pAction.Success      = false;
                    pAction.ExceptionMsg = "该用户名已存在";
                    return(pAction);
                }
                else
                {
                    new NTS.WEB.BLL.User().UpdateUser(model);
                    pAction.Success      = true;
                    pAction.ExceptionMsg = "更新用户成功";
                    return(pAction);
                }
            }
            catch (Exception e)
            {
                pAction.Success      = false;
                pAction.ExceptionMsg = e.Message;
                return(pAction);
            }
        }
示例#2
0
        private void HandleHandshake(byte[] buffer, IPEndPoint clientEP)
        {
            using (var ms = new MemoryStream(buffer))
            {
                using (var stream = new BinaryReader(ms))
                {
                    int sessionId = GetSessionId(stream);

                    var user = new QueryUser { SessionId = sessionId, ChallengeToken = Rnd.Next() };

                    if (UserList.ContainsKey(clientEP))
                    {
                        QueryUser u;
                        while (!UserList.TryRemove(clientEP, out u))
                            Thread.Sleep(1);
                    }

                    UserList[clientEP] = user;

                    using (var response = new MemoryStream())
                    {
                        using (var writer = new BinaryWriter(response))
                        {
                            WriteHead(Type_Handshake, user, writer);
                            WriteStringToStream(user.ChallengeToken.ToString(), response);
                            SendResponse(response.ToArray(), clientEP);
                        }
                    }
                }

            }
        }
示例#3
0
        private void Save_Edit(object sender, RoutedEventArgs e)
        {
            ComboBoxItem status = (ComboBoxItem)this.status.SelectedItem;
            UserBean     bean   = new UserBean();
            QueryUser    query  = new QueryUser();

            query.Account  = UserManagerBean.AddUser.queryAccount.Text;
            query.UserName = UserManagerBean.AddUser.queryName.Text;
            bean.Id        = int.Parse(this.userId.Content.ToString());
            bean.UserName  = this.userName.Text;
            bean.Phone     = this.userPhone.Text;
            bean.Status    = int.Parse(status.Tag.ToString());
            bean.Type      = this.userType.SelectedIndex;
            Users user  = new Users();
            int   state = user.saveUserEdit(bean);

            if (state == BaseRequest.SUCCESS)
            {
                JXMessageBox.Show(Window.GetWindow(this), "编辑用信息保存成功!", MsgImage.Success);
                this.Close();
                UserManagerBean.AddUser.page.ShowPages(UserManagerBean.AddUser.userData, user.getUsersList(query), BaseRequest.PAGE_SIZE);
            }
            else if (state == BaseRequest.SYSTEM_EXCEPTION)
            {
                JXMessageBox.Show(Window.GetWindow(this), "系统异常,请联系管理员!", MsgImage.Error);
            }
            else
            {
                JXMessageBox.Show(Window.GetWindow(this), "未知错误", MsgImage.Error);
            }
        }
示例#4
0
        private void HandleHandshake(byte[] buffer, IPEndPoint clientEP)
        {
            using (var ms = new MemoryStream(buffer))
                using (var stream = new BinaryReader(ms))
                {
                    var sessionId = GetSessionId(stream);

                    var user = new QueryUser {
                        SessionId = sessionId, ChallengeToken = Rnd.Next()
                    };

                    if (UserList.ContainsKey(clientEP))
                    {
                        QueryUser u;
                        while (!UserList.TryRemove(clientEP, out u))
                        {
                            Thread.Sleep(1);
                        }
                    }

                    UserList[clientEP] = user;

                    using (var response = new MemoryStream())
                        using (var writer = new BinaryWriter(response))
                        {
                            WriteHead(Type_Handshake, user, writer);
                            WriteStringToStream(user.ChallengeToken.ToString(), response);
                            SendResponse(response.ToArray(), clientEP);
                        }
                }
        }
示例#5
0
        // GET: Role
        public ActionResult Index(QueryUser query)
        {
            var list = UserManager.GetInstance().GetPageList(query);

            ViewBag.param = query;
            return(View(list));
        }
示例#6
0
        public JqGrid ForGrid(JqGrid grid)
        {
            QueryUser query = new QueryUser();

            query.name = grid.QueryField.ContainsKey("CHINESE_NAME") ? grid.QueryField["CHINESE_NAME"] : "";
            grid.QueryField.Remove("CHINESE_NAME");
            grid = QueryTableHelper.QueryGrid <CasUserEntity>(query, grid);
            return(grid);
        }
        public IActionResult TestFeign()
        {
            var f = QueryUser.Find("666", new User()
            {
                Name = "summer", Value = "boot"
            });

            return(Ok(f));
        }
示例#8
0
        /// <summary>
        /// 获取用户角色
        /// </summary>
        /// <param name="grid"></param>
        /// <returns></returns>
        public LigerGrid UserRoleGrid(string systemName, LigerGrid grid)
        {
            QueryUser query = new QueryUser();

            query.ligerGrid  = grid;
            query.systemName = systemName;
            grid             = QueryTableHelper.QueryTable <CasUserEntity>(query.GetUserRoleSQL(), grid);
            return(grid);
        }
示例#9
0
        private void Submit_AddUser(object sender, RoutedEventArgs e)
        {
            if (ValidateUtil.CheckFolderName(this.account.Text) == false)
            {
                JXMessageBox.Show(Window.GetWindow(this), "请填写帐号!", MsgImage.Error);
                return;
            }
            if (ValidateUtil.CheckFolderName(this.userName.Text) == false)
            {
                JXMessageBox.Show(Window.GetWindow(this), "请填写用户姓名!", MsgImage.Error);
                return;
            }
            if (ValidateUtil.CheckPasswordStrength(this.password.Password) == false)
            {
                JXMessageBox.Show(Window.GetWindow(this), "请输入6位以上的密码长度!", MsgImage.Error);
                return;
            }

            if (!this.password.Password.Equals(this.password2.Password))
            {
                JXMessageBox.Show(Window.GetWindow(this), "输入密码不一致,请重新输入!", MsgImage.Error);
                return;
            }
            Users     u     = new Users();
            UserBean  bean  = new UserBean();
            QueryUser query = new QueryUser();

            query.Account   = UserManagerBean.AddUser.queryAccount.Text;
            query.UserName  = UserManagerBean.AddUser.queryName.Text;
            bean.Account    = this.account.Text;
            bean.UserName   = this.userName.Text;
            bean.Password   = this.password.Password;
            bean.Status     = 0;
            bean.CreateId   = Session.UserId;
            bean.CreateTime = Convert.ToDateTime(DateTime.Now);
            bean.Phone      = this.phone.Text;
            ComboBoxItem type = (ComboBoxItem)this.userType.SelectedItem;

            bean.Type = int.Parse(type.Tag.ToString());
            int    state = u.registUser(bean);
            Window targe = Window.GetWindow(this);

            if (state == BaseRequest.HAS)
            {
                JXMessageBox.Show(Window.GetWindow(this), "该账号已被使用!", MsgImage.Error);
            }
            else if (state == BaseRequest.SUCCESS)
            {
                JXMessageBox.Show(Window.GetWindow(this), "新增用户成功!", MsgImage.Error);
                UserManagerBean.AddUser.page.ShowPages(UserManagerBean.AddUser.userData, u.getUsersList(query), BaseRequest.PAGE_SIZE);
                this.Close();
            }
            else
            {
                JXMessageBox.Show(Window.GetWindow(this), "系统异常,请联系管理员!", MsgImage.Error);
            }
        }
示例#10
0
        private void QueryUser(object sender, RoutedEventArgs e)
        {
            QueryUser query = new QueryUser();

            query.Account  = this.queryAccount.Text;
            query.UserName = this.queryName.Text;
            Users   user = new Users();
            DataSet set  = user.getUsersList(query);

            this.page.ShowPages(this.userData, set, BaseRequest.PAGE_SIZE);
        }
示例#11
0
        //private void _UserManager(object sender, System.Windows.Input.MouseButtonEventArgs e)
        //{
        //    //UserManagerBean.AddUser
        //    Users u = new Users();
        //    QueryUser query = new QueryUser();
        //    query.Account = UserManagerBean.AddUser.queryAccount.Text;
        //    query.UserName = UserManagerBean.AddUser.queryName.Text;

        //    DataSet set = u.getUsersList(query);
        //    UserManagerBean.AddUser.page.ShowPages(UserManagerBean.AddUser.userData, set, BaseRequest.PAGE_SIZE);
        //    AddGrid(UserManagerBean.AddUser);
        //}

        private void User_Manager_KeyDown(object sender, KeyEventArgs e)
        {
            //UserManagerBean.AddUser
            Users     u     = new Users();
            QueryUser query = new QueryUser();

            query.Account  = UserManagerBean.AddUser.queryAccount.Text;
            query.UserName = UserManagerBean.AddUser.queryName.Text;

            DataSet set = u.getUsersList(query);

            UserManagerBean.AddUser.page.ShowPages(UserManagerBean.AddUser.userData, set, BaseRequest.PAGE_SIZE);
            AddGrid(UserManagerBean.AddUser);
        }
示例#12
0
        private void DazzleTabControl_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            DazzleTabItem item = ((sender as DazzleTabControl).SelectedItem as DazzleTabItem);

            if (item != null)
            {
                //MessageBox.Show(item.ToString());
                if (item.Name.Equals("User_Manager"))
                {
                    Users     u     = new Users();
                    QueryUser query = new QueryUser();
                    query.Account  = UserManagerBean.AddUser.queryAccount.Text;
                    query.UserName = UserManagerBean.AddUser.queryName.Text;

                    DataSet set = u.getUsersList(query);
                    UserManagerBean.AddUser.page.ShowPages(UserManagerBean.AddUser.userData, set, BaseRequest.PAGE_SIZE);
                    AddGrid(UserManagerBean.AddUser);
                }
            }
        }
示例#13
0
        public virtual bool ExportExcel(LigerGrid grid, ref ExcelConvertHelper.ExcelContext context, ref string Error)
        {
            QueryUser query = new QueryUser();

            query.ligerGrid = grid;
            eContract.Common.ExcelConvertHelper.ColumnList columns = new eContract.Common.ExcelConvertHelper.ColumnList();
            columns.Add(CasUserTable.C_USER_ACCOUNT, "登录名");
            columns.Add(CasUserTable.C_ENGLISH_NAME, "姓名");
            context          = new ExcelConvertHelper.ExcelContext();
            context.FileName = "UserList" + ".xls";
            context.Title    = "用户列表";
            //context.Data = DataAccess.QueryDataSet(query);
            WhereBuilder where = query.ParseSQL();
            context.Data       = DataAccess.Select(where.SQLString, where.Parameters).Tables[0];
            if (columns != null)
            {
                context.Columns.Add(columns);
            }
            CacheHelper.Instance.Set(WebCaching.UserId + "_" + ExcelHelper.EXPORT_EXCEL_CONTEXT, context);
            return(true);
        }
示例#14
0
        public async Task <IActionResult> TestFeign2()
        {
            //var client= IHttpClientFactory.CreateClient();
            //var httpRequest = new HttpRequestMessage(HttpMethod.Post, "http://localhost:5000/home/test?Id=3223");
            //httpRequest.Headers.Add("Content-Type", "application/json");

            //var httpContent=new StringContent(new User(){Name = "123",Value = "456"}.ToJson());
            //httpRequest.Content = httpContent;
            ////client.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));
            ////httpContent.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("application/json");
            ////var f = await client.PostAsync("http://localhost:5000/home/test?Id=3223", httpContent);

            //var f = await client.SendAsync(httpRequest);

            var f = await QueryUser.FindAsync("666", new User()
            {
                Name = "summer", Value = "boot"
            });

            return(Ok(f));
        }
示例#15
0
 public BLLResult <QueryUser> SelectUser(int Id)
 {
     try
     {
         var result = SelectByUserId(Id);
         if (result.Success)
         {
             QueryUser item = new QueryUser();
             var       data = result.Data;
             item.Password = data.Password;
             item.UserName = data.UserName;
             item.Address  = data.Address;
             return(BLLResultFactory <QueryUser> .Success(item));
         }
         else
         {
             return(BLLResultFactory <QueryUser> .Error(result.Msg));
         }
     }
     catch (Exception ex)
     {
         return(BLLResultFactory <QueryUser> .Error(ex.Message));
     }
 }
示例#16
0
文件: User.cs 项目: NickQi/TianheDemo
 public void UpdateUser(QueryUser model)
 {
     //dal.UpdateUser(model);
 }
示例#17
0
 private void WriteHead(byte type, QueryUser user, BinaryWriter stream)
 {
     stream.Write(type);
     stream.Write(user.SessionId);
 }
示例#18
0
        //设备管理功能选择
        private void Choice(object sender, RoutedEventArgs e)
        {
            TreeViewItem assets = ((sender as TreeView).SelectedItem as TreeViewItem);
            //MessageBox.Show(assets.Uid.ToString());
            string assetsName = assets.Uid.ToString();

            if (assetsName == null || "".Equals(assetsName))
            {
                roomGrid.Children.Clear();
            }
            if (roomGrid.Children != null)
            {
                roomGrid.Children.Clear();
            }

            // ==================================================================================

            if (assetsName.Equals("Elist"))
            {
                EquipmentList equipment = RoomManagerBean.EquipmentList;
                RoomClass     rc        = new RoomClass();
                EquipmentBean bean      = new EquipmentBean();

                DataSet  equipmentSet = rc.queryEquipmentList(bean);
                DataSet  typeSet      = rc.queryType();
                ComboBox box          = RoomManagerBean.EquipmentList.type;
                if (box.HasItems)
                {
                    box.Items.Clear();
                }
                ComboBoxItem boxItem = new ComboBoxItem();
                boxItem.Content    = "请选择...";
                boxItem.Tag        = "";
                boxItem.IsSelected = true;
                box.Items.Add(boxItem);
                //RoomManagerBean.DeviceClass.selectType.SelectedValuePath = "";
                if (typeSet.Tables.Count > 0)
                {
                    DataRowCollection drc = typeSet.Tables[0].Rows;

                    for (int i = 0; i < drc.Count; i++)
                    {
                        DataRow dr       = drc[i];
                        int     typeId   = (int)dr["ID"];
                        string  typeName = dr["TYPE_NAME"].ToString();

                        ComboBoxItem boxItems = new ComboBoxItem();
                        boxItems.Content = typeName;
                        boxItems.Tag     = typeId;
                        box.Items.Add(boxItems);
                        //MessageBox.Show("typeId=" + typeId + " typeName=" + boxItems.Tag);
                    }
                    //MessageBox.Show("===" + equipmentSet.Tables.Count);
                    RoomManagerBean.EquipmentList.page.ShowPages(RoomManagerBean.EquipmentList.equipment, equipmentSet, BaseRequest.PAGE_SIZE);
                    roomGrid.Children.Add(equipment);
                    equipment.SetValue(Grid.RowProperty, 0);
                    equipment.SetValue(Grid.ColumnProperty, 0);
                }
            }
            else if (assetsName.Equals("Report"))
            {
                Statement statement = RoomManagerBean.Statement;
                roomGrid.Children.Add(statement);
                statement.SetValue(Grid.RowProperty, 0);
                statement.SetValue(Grid.ColumnProperty, 0);
            }
            else if (assetsName.Equals("Inventory"))
            {
                RoomClass rc       = new RoomClass();
                DataSet   stockSet = rc.queryInventory();
                RoomManagerBean.DeviceList.page.ShowPages(RoomManagerBean.DeviceList.stock, stockSet, BaseRequest.PAGE_SIZE);
                DeviceList deviceList = RoomManagerBean.DeviceList;
                roomGrid.Children.Add(deviceList);
                deviceList.SetValue(Grid.RowProperty, 0);
                deviceList.SetValue(Grid.ColumnProperty, 0);
            }
            else if (assetsName.Equals("Category"))
            {
                DeviceClass deviceClass = RoomManagerBean.DeviceClass;
                RoomClass   room        = new RoomClass();
                QueryUser   query       = new QueryUser();

                //query.Account = UserManagerBean.AddUser.queryAccount.Text;
                //query.UserName = UserManagerBean.AddUser.queryName.Text;
                DataSet set = room.queryType();

                RoomManagerBean.DeviceClass.page.ShowPages(RoomManagerBean.DeviceClass.deviceData, set, BaseRequest.PAGE_SIZE);

                roomGrid.Children.Add(deviceClass);
                deviceClass.SetValue(Grid.RowProperty, 0);
                deviceClass.SetValue(Grid.ColumnProperty, 0);
            }
            else if (assetsName.Equals("HistoryEquipment"))
            {
                HistoryEquipment he  = RoomManagerBean.HistoryEquipment;
                RoomClass        rc  = new RoomClass();
                DataSet          set = rc.queryHistoryEquipment();
                he.page.ShowPages(he.historyEquipment, set, BaseRequest.PAGE_SIZE);
                roomGrid.Children.Add(he);
                he.SetValue(Grid.RowProperty, 0);
                he.SetValue(Grid.ColumnProperty, 0);
            }
        }
示例#19
0
文件: User.cs 项目: NickQi/TianheDemo
 public void AddUser(QueryUser model)
 {
     // dal.AddUser(model);
 }
示例#20
0
        public JsonResult QueryForwardSubmit(string queryid, QueryCommentViewModel queryCommentViewModel)
        {
            string[] arr   = Session["UserData"] as string[];
            string   appid = queryCommentViewModel.QueryDetails.ERApplicationId;

            queryCommentViewModel.Comment.ERApplicationId = appid;
            queryCommentViewModel.Comment.UserAccountId   = arr[0];

            queryCommentViewModel.QueryMaster.Is_Active       = true;
            queryCommentViewModel.QueryMaster.QueryParentId   = queryCommentViewModel.QueryDetails.QueryParentId;
            queryCommentViewModel.QueryMaster.ERApplicationId = appid;


            queryCommentViewModel.QueryDetails.QuerySeq      = 1;
            queryCommentViewModel.QueryDetails.CommentRefId  = queryCommentViewModel.Comment.Id;
            queryCommentViewModel.QueryDetails.QueryParentId = queryCommentViewModel.QueryMaster.Id;
            queryCommentViewModel.QueryDetails.Status        = StatusMasterContext.Collection().Where(x => x.Status == "Query Forward").FirstOrDefault().Id;
            queryCommentViewModel.QueryDetails.Is_Active     = true;

            QueryUser queryUser = new QueryUser()
            {
                SenderId   = arr[0],
                RecieverId = queryCommentViewModel.ReciverIdSelectList[0],
                QueryId    = queryCommentViewModel.QueryDetails.QueryParentId,
            };

            AuditTrails auditTrails = new AuditTrails()
            {
                ERApplicationId = appid,
                FileRefId       = queryCommentViewModel.QueryDetails.FileRefId,
                StatusId        = queryCommentViewModel.QueryDetails.Status,
                QueryDetailsId  = queryCommentViewModel.QueryDetails.Id,
                SenderId        = queryUser.SenderId,
                ReceiverId      = queryUser.RecieverId,
                Is_Active       = true,
            };
            string dt = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss").Replace("/", "").Replace(":", "").Replace(" ", "");

            queryCommentViewModel.QueryMaster.CustQueryId  = "QMID" + dt;
            queryCommentViewModel.QueryDetails.CustQueryId = "QDID" + dt;

            AuditTrailsContext.Insert(auditTrails);
            QueryUserContext.Insert(queryUser);
            commentContext.Insert(queryCommentViewModel.Comment);
            QueryDetailsContext.Insert(queryCommentViewModel.QueryDetails);
            QueryMasterContext.Insert(queryCommentViewModel.QueryMaster);

            if (TryValidateModel(queryCommentViewModel))
            {
                using (TransactionScope scope = new TransactionScope())
                {
                    commentContext.Commit();
                    AuditTrailsContext.Commit();
                    QueryDetailsContext.Commit();
                    QueryUserContext.Commit();
                    QueryMasterContext.Commit();
                    scope.Complete();
                    return(Json("Successfully Query Forward To Selected User.", JsonRequestBehavior.AllowGet));
                }
            }
            else
            {
                return(Json("Something Went Wrong! Try Again Later"));
            }
        }
示例#21
0
        public ActionResult AjaxAdd(string appid, string targetPage, string queryId)
        {
            string[]     arr    = Session["UserData"] as string[];
            string       userid = arr[0];
            object       _genericObject;
            QueryDetails queryDetails;
            QueryMaster  queryMaster;
            Comment      comment;

            switch (targetPage)
            {
            case "QueryCommentRaised":

                queryDetails = new QueryDetails()
                {
                    FileRefId       = Guid.NewGuid().ToString(),
                    ERApplicationId = appid
                };

                QueryCommentViewModel QueryCommentRaised = new QueryCommentViewModel();
                QueryCommentRaised.QueryDetails = queryDetails;


                if (arr[2] == "coordinator")
                {
                    ViewBag.ReciverList = ERAppActiveUsersContext.Collection().Where(x => x.ERApplicationId == appid && x.UserAccountId != userid)
                                          .Select(d => new { ListItemKey = d.UserAccountId, ListItemValue = d.UserAccount.FirstName + " " + d.UserAccount.LastName + " (" + d.UserAccount.UserRole + ")" }).ToList();
                }
                else if (arr[2] == "Consultant Enhanced Recovery")
                {
                    ViewBag.ReciverList = ERAppActiveUsersContext.Collection().Where(x => x.ERApplicationId == appid && x.UserAccountId != userid && x.UserAccount.UserRole == "coordinator")
                                          .Select(d => new { ListItemKey = d.UserAccountId, ListItemValue = d.UserAccount.FirstName + " " + d.UserAccount.LastName + " (" + d.UserAccount.UserRole + ")" }).ToList();
                }
                else if (arr[2] == "operator")
                {
                    ViewBag.ReciverList = ERAppActiveUsersContext.Collection().Where(x => x.ERApplicationId == appid && x.UserAccountId != userid && x.UserAccount.UserRole == "Consultant Enhanced Recovery")
                                          .Select(d => new { ListItemKey = d.UserAccountId, ListItemValue = d.UserAccount.FirstName + " " + d.UserAccount.LastName + " (" + d.UserAccount.UserRole + ")" }).ToList();
                }
                else
                {
                    ViewBag.ReciverList = ERAppActiveUsersContext.Collection().Where(x => x.ERApplicationId == appid && x.UserAccountId != userid && x.UserAccount.UserRole != "operator")
                                          .Select(d => new { ListItemKey = d.UserAccount.Id, ListItemValue = d.UserAccount.FirstName + " " + d.UserAccount.LastName + " (" + d.UserAccount.UserRole + ")" }).ToList();
                }

                _genericObject = QueryCommentRaised;

                break;

            case "QueryCommentForward":

                QueryCommentViewModel QueryCommentForward = new QueryCommentViewModel();
                QueryDetails          qd = QueryDetailsContext.Collection().Where(x => x.Id == queryId).FirstOrDefault();
                queryDetails = new QueryDetails()
                {
                    FileRefId       = Guid.NewGuid().ToString(),
                    ERApplicationId = appid,
                    QueryParentId   = qd.QueryParentId,
                };

                queryMaster = new QueryMaster()
                {
                    Subject = QueryMasterContext.Collection().Where(d => d.Id == qd.QueryParentId).FirstOrDefault().Subject,
                };
                comment = new Comment()
                {
                    Text = commentContext.Collection().Where(c => c.Id == qd.CommentRefId).FirstOrDefault().Text,
                };

                QueryCommentForward.QueryDetails = queryDetails;
                QueryCommentForward.QueryMaster  = queryMaster;
                QueryCommentForward.Comment      = comment;

                QueryUser queryUser = QueryUserContext.Collection().Where(x => x.QueryId == qd.QueryParentId).FirstOrDefault();

                if (arr[2] == "coordinator")
                {
                    //  QueryUserContext.Collection().Where(x=>x.QueryId==queryId)
                    var qmc   = QueryMasterContext.Collection().Where(e => e.ERApplicationId == appid).ToList();
                    var query = from p in qmc
                                join q in qmc on p.Id equals q.QueryParentId
                                select new { pid = p.Id, qid = q.Id };


                    ViewBag.ReciverList = ERAppActiveUsersContext.Collection().Where(x => x.ERApplicationId == appid && x.UserAccountId != userid && x.UserAccountId != queryUser.RecieverId && x.UserAccountId != queryUser.SenderId)
                                          .Select(d => new { ListItemKey = d.UserAccountId, ListItemValue = d.UserAccount.FirstName + " " + d.UserAccount.LastName + " (" + d.UserAccount.UserRole + ")" }).ToList();
                }
                else
                {
                    ViewBag.ReciverList = ERAppActiveUsersContext.Collection().Where(x => x.ERApplicationId == appid && x.UserAccountId != userid && x.UserAccount.UserRole != "operator" && x.UserAccountId != queryUser.RecieverId && x.UserAccountId != queryUser.SenderId)
                                          .Select(d => new { ListItemKey = d.UserAccount.Id, ListItemValue = d.UserAccount.FirstName + " " + d.UserAccount.LastName + " (" + d.UserAccount.UserRole + ")" }).ToList();
                }
                _genericObject = QueryCommentForward;
                break;

            case "QueryCommentReply":

                QueryCommentViewModel QueryCommentReply = new QueryCommentViewModel();

                queryDetails = new QueryDetails()
                {
                    ERApplicationId = appid,
                    QueryParentId   = QueryDetailsContext.Collection().Where(x => x.Id == queryId).Select(d => d.QueryParentId).FirstOrDefault().ToString(),
                    FileRefId       = Guid.NewGuid().ToString()
                };

                QueryCommentReply.QueryDetails = queryDetails;

                _genericObject = QueryCommentReply;
                break;

            case "QueryCommentResolved":
                _genericObject = new QueryCommentViewModel();

                break;

            case "ForwardApplication":
                ForwardAppViewModel forwardAppViewModel = new ForwardAppViewModel();
                ForwardApplication  forwardApplication  = new ForwardApplication();
                //if(arr[2]=="HoD")
                if (arr[2] == UserRoleType.ConsultantEnhancedRecovery.GetDisplayName())
                {
                    ViewBag.ReciverList = UserAccountContext.Collection().Where(x => (x.UserRole == UserRoleType.Coordinator.ToString()) && x.Id != userid)
                                          .Select(d => new { ListItemKey = d.Id, ListItemValue = d.FirstName + " " + d.LastName + " (" + d.UserRole + ")" }).ToList();
                }
                else if (arr[2] == UserRoleType.Coordinator.ToString())
                {
                    int CountForward     = ForwardApplicationContext.Collection().Where(x => x.ERApplicationId == appid && x.Is_Active == true && x.Sender == userid && (x.FileStatus == FileStatus.ReviewAgain || x.FileStatus == FileStatus.Forward)).Count();
                    int CountRecommended = ForwardApplicationContext.Collection().Where(x => x.ERApplicationId == appid && x.Is_Active == true && x.Reciever == userid && x.FileStatus == FileStatus.Recommended).Count();
                    if (CountForward == CountRecommended && CountForward != 0 && CountRecommended != 0)
                    {
                        ViewBag.ReciverList = UserAccountContext.Collection().Where(x => x.UserRole == UserRoleType.DG.ToString() && x.Id != userid)
                                              .Select(d => new { ListItemKey = d.Id, ListItemValue = d.FirstName + " " + d.LastName + " (" + d.UserRole + ")" }).ToList();
                    }
                    else
                    {
                        ViewBag.ReciverList = UserAccountContext.Collection().Where(x => (x.UserRole == UserRoleType.Hod.ToString() ||
                                                                                          x.UserRole == UserRoleType.Coordinator.ToString() || x.UserRole == UserRoleType.ADG.ToString()) && x.Id != userid)
                                              .Select(d => new { ListItemKey = d.Id, ListItemValue = d.FirstName + " " + d.LastName + " (" + d.UserRole + ")" }).ToList();
                    }
                }
                else
                {
                    ViewBag.ReciverList = UserAccountContext.Collection().Where(x => (x.UserRole == UserRoleType.Hod.ToString() ||
                                                                                      x.UserRole == UserRoleType.Coordinator.ToString() || x.UserRole == UserRoleType.ADG.ToString()) && x.Id != userid)
                                          .Select(d => new { ListItemKey = d.Id, ListItemValue = d.FirstName + " " + d.LastName + " (" + d.UserRole + ")" }).ToList();
                }

                forwardApplication.FileRef             = Guid.NewGuid().ToString();
                forwardAppViewModel.ForwardApplication = forwardApplication;
                _genericObject = forwardAppViewModel;
                break;

            case "UploadApprovalLetter":
                UploadApprovalLetterViewModel uploadApprovalLetterViewModel = new UploadApprovalLetterViewModel();
                ForwardApplication            forwardApplication1           = new ForwardApplication()
                {
                    FileRef         = Guid.NewGuid().ToString(),
                    ERApplicationId = appid
                };
                uploadApprovalLetterViewModel.ForwardApplication = forwardApplication1;
                _genericObject = uploadApprovalLetterViewModel;
                break;

            default:
                _genericObject = null;
                break;
            }
            if (null != _genericObject)
            {
                ViewBag.appid = appid;
                return(View(targetPage, _genericObject));
            }
            else
            {
                return(Content("<div class=\"alert alert-danger\" role=\"alert\"> An Error has occured </div>"));
            }
        }
示例#22
0
        /// <summary>
        /// 查询用户
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void queryUserToolStripMenuItem_Click(object sender, EventArgs e)
        {
            QueryUser queryuser = new QueryUser();

            queryuser.ShowDialog();
        }
示例#23
0
 private void WriteHead(byte type, QueryUser user, BinaryWriter stream)
 {
     stream.Write(type);
     stream.Write(user.SessionId);
 }
示例#24
0
文件: User.cs 项目: NickQi/TianheDemo
 public bool IsExistUserName(QueryUser model)
 {
     return(true);
     //return dal.IsExistUserName(model);
 }