Beispiel #1
0
        public HttpStatusCode Post(RosterAddRequest request)
        {
            var repo = new RosterRepository();

            repo.AddToRoster(request);

            return(HttpStatusCode.OK);
        }
 public void AddRosterRequest(long uid, long rosterId, string rosterJid, string message, IDKin.IM.Protocol.Center.User user, long categotyId = 0L)
 {
     RosterAddRequest request = new RosterAddRequest();
     request.category_id = categotyId;
     request.message = message;
     request.rjid = rosterJid;
     request.ruid = rosterId;
     request.uid = uid;
     request.user = user;
     this.connection.Send(PacketType.ROSTER_ADD, request);
 }
Beispiel #3
0
        public void AddRosterRequest(long uid, long rosterId, string rosterJid, string message, IDKin.IM.Protocol.Center.User user, long categotyId = 0L)
        {
            RosterAddRequest request = new RosterAddRequest();

            request.category_id = categotyId;
            request.message     = message;
            request.rjid        = rosterJid;
            request.ruid        = rosterId;
            request.uid         = uid;
            request.user        = user;
            this.connection.Send(PacketType.ROSTER_ADD, request);
        }
        public void AddToRoster(RosterAddRequest request)
        {
            using (var cn = new SqlConnection(Config.GetConnectionString()))
            {
                var p = new DynamicParameters();
                p.Add("@RosterId", dbType: DbType.Int32, direction: ParameterDirection.Output);
                p.Add("@UserId", request.UserId);
                p.Add("@ClassId", request.ClassId);

                cn.Execute("RosterInsert", p, commandType: CommandType.StoredProcedure);

                request.RosterId = p.Get <int>("@RosterId");
            }
        }
        private void ShowAddRosterNewMessage(long rosterId, System.Collections.Generic.List <Message> list)
        {
            Message message = list[0];

            if (message != null)
            {
                RosterAddRequest request = message.MessageObject as RosterAddRequest;
                if (request != null)
                {
                    FriendRequestWindow requestWindow = new FriendRequestWindow(request.uid, request.ruid, request.rjid, request.message, request.user, request.category_id);
                    requestWindow.Show();
                }
                DataModel.Instance.RemoveMessage(rosterId, MessageActorType.AddRoster);
            }
        }
        public void AddToRoster(RosterAddRequest request)
        {
            using (var cn = new SqlConnection(Config.GetConnectionString()))
            {
                var p = new DynamicParameters();
                p.Add("@ClassID", request.ClassID);
                p.Add("@StudentID", request.StudentID);


                cn.Execute("AddStudentToClass", p, commandType: CommandType.StoredProcedure);
                cn.Execute("RetroGradeBookEntryforNewStudent", p, commandType: CommandType.StoredProcedure);

                request.ClassID   = p.Get <int>("@ClassID");
                request.StudentID = p.Get <int>("@StudentID");
            }
        }
        public ActionResult AddStudent(string userId, int classId)
        {
            var uberModel  = new UberRoster();
            var addRequest = new RosterAddRequest();

            addRequest.UserId = userId;
            // addRequest.RosterId = rosterId;

            addRequest.ClassId = classId;
            _rosterRepository.AddToRoster(addRequest);
            uberModel.CourseName       = _teacherRepository.GetCourseById(classId).Name;
            uberModel.ClassId          = classId;
            uberModel.EnrolledStudents = _rosterRepository.GetStudentsEnrolledIn(classId);
            uberModel.SearchResults    = new List <RosterSearchRecord>();
            uberModel.SearchRequest    = new RosterSearchRequest();

            return(View("ClassRoster", uberModel));
        }
 private void RosterAddNewMessage(RosterAddRequest request)
 {
     FriendRequestWindow requestWindow = new FriendRequestWindow(request.uid, request.ruid, request.rjid, request.message, request.user, request.category_id);
     requestWindow.Show();
 }
        private void RosterAddNewMessage(RosterAddRequest request)
        {
            FriendRequestWindow requestWindow = new FriendRequestWindow(request.uid, request.ruid, request.rjid, request.message, request.user, request.category_id);

            requestWindow.Show();
        }
Beispiel #10
0
 public void Refresh()
 {
     try
     {
         this.lbMessageBox.Items.Clear();
         if (!this.dataModel.HasMessage())
         {
             NotifyIconUtil.Instance.SetFlashIcon(FlashIconType.Default);
             base.Close();
         }
         foreach (string key in this.dataModel.MessageBoxSort)
         {
             if (!string.IsNullOrEmpty(key))
             {
                 System.Collections.Generic.List <Message> list = this.dataModel.GetMessage(key);
                 if (list != null && list.Count > 0)
                 {
                     Message message = list[0];
                     if (message != null)
                     {
                         if (message.MessageObjectType == MessageActorType.EntStaff)
                         {
                             Staff staff = this.dataService.GetStaff((long)((ulong)Jid.GetUid(message.FromJid)));
                             if (staff != null)
                             {
                                 MessageBoxItem mbi = new MessageBoxItem(MessageActorType.EntStaff, staff.Uid, staff.Name, list.Count.ToString(), staff.HeaderImage);
                                 this.lbMessageBox.Items.Add(mbi);
                             }
                         }
                         if (message.MessageObjectType == MessageActorType.EntGroup)
                         {
                             EntGroup group = this.dataService.GetEntGroup(message.Gid);
                             if (group != null)
                             {
                                 MessageBoxItem mbi = new MessageBoxItem(MessageActorType.EntGroup, group.Gid, group.Name, list.Count.ToString(), this.imageService.GetIcon(ImageTypeIcon.Group));
                                 this.lbMessageBox.Items.Add(mbi);
                             }
                         }
                         if (message.MessageObjectType == MessageActorType.Roster)
                         {
                             Roster roster = this.dataService.GetRoster((long)((ulong)Jid.GetUid(message.FromJid)));
                             if (roster != null)
                             {
                                 MessageBoxItem mbi = new MessageBoxItem(MessageActorType.Roster, roster.Uid, roster.Name, list.Count.ToString(), roster.HeaderImage);
                                 this.lbMessageBox.Items.Add(mbi);
                             }
                         }
                         if (message.MessageObjectType == MessageActorType.AddRoster)
                         {
                             RosterAddRequest request = message.MessageObject as RosterAddRequest;
                             if (request != null && request.user != null)
                             {
                                 MessageBoxItem mbi = new MessageBoxItem(MessageActorType.AddRoster, request.uid, "验证消息", list.Count.ToString(), null);
                                 this.lbMessageBox.Items.Add(mbi);
                             }
                         }
                         if (message.MessageObjectType == MessageActorType.AddRosterAsk)
                         {
                             RosterAddResponse response = message.MessageObject as RosterAddResponse;
                             if (response != null && response.user != null)
                             {
                                 MessageBoxItem mbi = new MessageBoxItem(MessageActorType.AddRosterAsk, response.uid, "验证消息", list.Count.ToString(), null);
                                 this.lbMessageBox.Items.Add(mbi);
                             }
                         }
                         if (message.MessageObjectType == MessageActorType.CooperationStaff)
                         {
                             CooperationStaff staff2 = this.dataService.GetCooperationStaff((long)((ulong)Jid.GetUid(message.FromJid)), message.ProjectId);
                             if (staff2 != null)
                             {
                                 MessageBoxItem mbi = new MessageBoxItem(MessageActorType.CooperationStaff, staff2.Uid, staff2.UnitedProjectid, staff2.Name, list.Count.ToString(), staff2.HeaderImage);
                                 this.lbMessageBox.Items.Add(mbi);
                             }
                         }
                     }
                 }
             }
         }
         base.Top = SystemParameters.WorkArea.Height - 47.0 - (double)(this.lbMessageBox.Items.Count * 30);
     }
     catch (System.Exception e)
     {
         this.logger.Error(e.ToString());
     }
 }
Beispiel #11
0
 private void AddRosterEvent(RosterAddRequest request)
 {
     try
     {
         if (request != null && request.user != null)
         {
             this.AddRosterAskTip(new Message
             {
                 MessageObjectType = MessageActorType.AddRoster,
                 MessageObject = request
             }, request.uid);
         }
     }
     catch (System.Exception ex)
     {
         ServiceUtil.Instance.Logger.Error(ex.ToString());
     }
 }