Beispiel #1
0
        public async Task <JsonResult> GetUserList(PublicQuery query)
        {
            try
            {
                PublicView publicView = await _userService.GetListByPage(query);

                foreach (var item in publicView.UserList)
                {
                    if (item.Role != null)
                    {
                        item.RoleName = item.Role.CName;
                    }
                    if (item.Department != null)
                    {
                        item.DepartmentName = item.Department.Name;
                    }
                    if (item.Area != null)
                    {
                        item.AreaName = item.Area.Name;
                    }
                }
                return(Json(new { total = publicView.TotalCount, rows = publicView.UserList }));
            }
            catch (Exception ex)
            {
                _logService.Error(string.Format("获取用户列表失败!query = 【{0}】", query.ToJSON()), ex);
                return(Json(new { total = 0, data = "" }));
            }
        }
Beispiel #2
0
        static void Main()
        {
            PrintStatus("Loading config..", ConsoleColor.Green);
            try
            {
                Config = JsonConvert.DeserializeObject <Config>(File.ReadAllText(Path.Combine(Environment.CurrentDirectory, "config.json")));
            }
            catch (JsonReaderException e)
            {
                SetError(e.Message);
            }
            catch (FileNotFoundException ex)
            {
                SetError(ex.Message);
            }

            if (string.IsNullOrWhiteSpace(Config.DisplayName))
            {
                SetError("No display name specified!");
            }

            if (string.IsNullOrWhiteSpace(Config.AuthToken))
            {
                SetError("No authentication token provided!");
            }

            PrintStatus("Setting up account..", ConsoleColor.Green);
            Account = new DliveAccount(Config.AuthToken);
            try
            {
                Account.Query.GetMyInfo();
            }
            catch (JsonSerializationException)
            {
                SetError("Invalid authentication token provided!");
            }
            catch (Exception e)
            {
                SetError(e.Message);
            }

            PublicUserData usr = PublicQuery.GetPublicInfoByDisplayName(Config.DisplayName);

            if (usr.Username == "invalid user")
            {
                SetError("Invalid display name provided!");
            }

            PrintStatus("Connecting to event stream..", ConsoleColor.Green);
            Subscription subscription = Subscription.SubscriptionByDisplayName(Config.DisplayName);

            subscription.OnChatEvent += OnChat;
            subscription.OnConnected += () => PrintStatus($"Connected to {Config.DisplayName}!", ConsoleColor.Green);
            subscription.OnError     += (err) => SetError(err);
            subscription.Connect();

            Console.WriteLine("Press enter to stop the program");
            Console.ReadLine();
        }
Beispiel #3
0
 private void QXMC()
 {
     this.drop_qxdm.Items.Clear();
     this.drop_qxdm.DataSource     = PublicQuery.GetDataQxmcTable(" and qxmc<>'武汉支队'");
     this.drop_qxdm.DataTextField  = "ZZJG";
     this.drop_qxdm.DataValueField = "QXDM";
     this.drop_qxdm.DataBind();
     this.drop_qxdm.Items.Insert(0, "请选择支队");
     this.drop_qxdm.Items[0].Value = "";
 }
Beispiel #4
0
        /// <summary>
        /// 获取所有(分页)
        /// </summary>
        /// <returns>The products.</returns>
        public PublicView GetListByPage(PublicQuery query)
        {
            var list = _coreDbContext.UserMenu.Where(w => w.IsDelete == false);

            list = list.OrderByDescending(t => t.CreatedTime).Paging <UserMenu>(out int totalCount, query.Page, query.PageSize);

            return(new PublicView {
                TotalCount = totalCount, UserMenuList = list.AsNoTracking().ToList()
            });
        }
Beispiel #5
0
 public PublicView GetListByPage([FromBody] PublicQuery query)
 {
     try
     {
         return(_userDao.GetListByPage(query));
     }
     catch (Exception ex)
     {
         nlog.Error(ex, "获取所有用户失败!", query.ToJSON());
         return(null);
     }
 }
Beispiel #6
0
        public async Task <JsonResult> GetRoleList(PublicQuery query)
        {
            try
            {
                PublicView publicView = await _roleService.GetListByPage(query);

                return(Json(new { total = publicView.TotalCount, rows = publicView.RoleList }));
            }
            catch (Exception ex)
            {
                _logService.Error(string.Format("获取角色列表失败!query = 【{0}】", query.ToJSON()), ex);
                return(Json(new { total = 0, data = "" }));
            }
        }
Beispiel #7
0
        public async Task <JsonResult> GetAppLogList(PublicQuery query)
        {
            try
            {
                PublicView publicView = await _applogService.GetAppLogs(query);

                return(Json(new { total = publicView.TotalCount, rows = publicView.ApplicationLogList }));
            }
            catch (Exception ex)
            {
                _logService.Error(string.Format("获取异常日志列表失败!query = 【{0}】", query.ToJSON()), ex);
                return(Json(new { total = 0, data = "" }));
            }
        }
Beispiel #8
0
        /// <summary>
        /// 获取所有(分页)
        /// </summary>
        /// <returns>The products.</returns>
        public PublicView GetListByPage(PublicQuery query)
        {
            var list = _coreDbContext.Menu.Where(w => w.IsDelete == false);

            if (query.KeyWorld.IsNotNullOrEmpty())
            {
                list = list.Where(w => w.CName.Contains(query.KeyWorld));
            }
            list = list.OrderByDescending(t => t.CreatedTime).Paging <Menu>(out int totalCount, query.Page, query.PageSize);

            return(new PublicView {
                TotalCount = totalCount, MenuList = list.AsNoTracking().ToList()
            });
        }
Beispiel #9
0
        /// <summary>
        /// 获取所有(分页)
        /// </summary>
        /// <returns>The products.</returns>
        public PublicView GetListByPage(PublicQuery query)
        {
            var list = _coreDbContext.ConfigInfo.Where(w => w.IsDelete == false && w.Type == query.ConfigType);

            if (query.KeyWorld.IsNotNullOrEmpty())
            {
                list = list.Where(w => w.Name.Contains(query.KeyWorld));
            }
            list = list.OrderBy(t => t.Id).Paging <ConfigInfo>(out int totalCount, query.Page, query.PageSize);

            return(new PublicView {
                TotalCount = totalCount, ConfigInfoList = list.AsNoTracking().ToList().OrderBy(x => x.SortNumber)
            });
        }
Beispiel #10
0
        /// <summary>
        /// 获取所有用户(分页)
        /// </summary>
        /// <returns>The products.</returns>
        public PublicView GetListByPage(PublicQuery query)
        {
            var list = _coreDbContext.User.Include(t => t.Role).Include(t => t.Area).Include(t => t.Department)
                       .Where(w => w.IsDelete == false);

            if (query.KeyWorld.IsNotNullOrEmpty())
            {
                list = list.Where(w => w.UserName.Contains(query.KeyWorld) ||
                                  w.Email.Contains(query.KeyWorld) ||
                                  w.Phone.Contains(query.KeyWorld));
            }
            list = list.OrderByDescending(t => t.CreatedTime).Paging <User>(out int totalCount, query.Page, query.PageSize);

            return(new PublicView {
                TotalCount = totalCount, UserList = list.AsNoTracking().ToList()
            });
        }
        public async Task <JsonResult> GetAreas(PublicQuery query)
        {
            try
            {
                query.ConfigType = (int)ConfigInfoType.Area;
                var configInfos = await _configInfoService.GetListByPage(query);

                if (configInfos == null)
                {
                    return(Json(new { isGet = false, msg = "未获取到区域!" }));
                }
                return(Json(new { total = configInfos.TotalCount, rows = configInfos.ConfigInfoList }));
            }
            catch (Exception ex)
            {
                _logService.Error(string.Format("获取区域失败!"), ex);
                return(Json(new { isGet = false, Msg = "获取区域失败!" }));
            }
        }
Beispiel #12
0
        /// <summary>
        /// 获取所有异常(分页)
        /// </summary>
        /// <returns>The products.</returns>
        public PublicView GetApplicationLogs(PublicQuery query)
        {
            var list = _coreDbContext.ApplicationLog.Where(w => w.Id > 0);

            if (query.Level.IsNotNullOrEmpty())
            {
                list = list.Where(t => t.Level == query.Level);
            }

            if (query.AddTime.IsNotNullOrEmpty())
            {
                DateTime tempTime = query.AddTime.ToDateTime();
                DateTime stime    = new DateTime(tempTime.Year, tempTime.Month, tempTime.Day, 0, 0, 0);
                DateTime etime    = new DateTime(tempTime.Year, tempTime.Month, tempTime.Day, 23, 59, 59);
                list = list.Where(w => w.Logged >= stime && w.Logged <= etime);
            }
            list = list.OrderByDescending(t => t.Logged).Paging(out int totalCount, query.Page, query.PageSize);

            return(new PublicView {
                TotalCount = totalCount, ApplicationLogList = list.AsNoTracking().ToList()
            });
        }
Beispiel #13
0
    /// <summary>
    /// 绑定数据源
    /// </summary>
    private void BindDataList()
    {
        //执法案卷类别名称
        DataTable dtSource = Utility.GetFileClassTree(); //获取数据信息

        if (AccessDataSet.HasDataTable(dtSource))
        {
            rptList.DataSource = dtSource;
            rptList.DataBind();
        }
        //执法档案目录号
        DataTable dtfile = filedal.GetDataTable("");

        if (AccessDataSet.HasDataTable(dtfile))
        {
            FileDirectoryID.DataSource          = dtfile;
            this.FileDirectoryID.DataTextField  = "FileDirName";
            this.FileDirectoryID.DataValueField = "ID";
            this.FileDirectoryID.DataBind();
            this.FileDirectoryID.Items.Insert(0, new ListItem("--请选择--", ""));
        }
        //执法档案保管期限
        DataTable dtS = savedal.GetDataTable("");

        if (AccessDataSet.HasDataTable(dtS))
        {
            SaveDeadlineID.DataSource          = dtS;
            this.SaveDeadlineID.DataTextField  = "YearName";
            this.SaveDeadlineID.DataValueField = "ID";
            this.SaveDeadlineID.DataBind();
            this.SaveDeadlineID.Items.Insert(0, new ListItem("--请选择--", ""));
        }
        //执法档案处罚类型
        DataTable dtwy = pusdal.GetDataTable("");

        if (AccessDataSet.HasDataTable(dtwy))
        {
            rxwhy.DataSource = dtwy;
            rxwhy.DataBind();
        }
        //执法档案承办单位
        DataTable dtor = ordal.GetDataTable("");

        if (AccessDataSet.HasDataTable(dtor))
        {
            this.drop_EnforcementName.DataSource     = dtor;
            this.drop_EnforcementName.DataTextField  = "OrganizerName";
            this.drop_EnforcementName.DataValueField = "ID";
            this.drop_EnforcementName.DataBind();
            this.drop_EnforcementName.Items.Insert(0, new ListItem("--请选择--", ""));
        }
        this.drop_EnforcementName.SelectedValue = LoginUser.OrganizerId;
        this.drop_EnforcementName.Enabled       = false;
        //执法档案库室
        DataTable dtfl = fldal.GetDataTable(" and qxdm='" + LoginUser.CountyId + "'");

        if (AccessDataSet.HasDataTable(dtfl))
        {
            this.drop_FileLibraryName.DataSource     = dtfl;
            this.drop_FileLibraryName.DataTextField  = "FileLibraryName";
            this.drop_FileLibraryName.DataValueField = "ID";
            this.drop_FileLibraryName.DataBind();
            this.drop_FileLibraryName.Items.Insert(0, new ListItem("--请选择--", ""));
        }

        //民族信息
        DataTable dtmz = PublicQuery.GetDataMZTable();

        if (AccessDataSet.HasDataTable(dtmz))
        {
            this.PenalDocNation.DataSource     = dtmz;
            this.PenalDocNation.DataTextField  = "MzName";
            this.PenalDocNation.DataValueField = "MzId";
            this.PenalDocNation.DataBind();
        }

        //行政区名称
        #region 行政区名称
        DataTable dtxzq = ardal.GetDataTable("");
        //建设工程地址
        if (AccessDataSet.HasDataTable(dtxzq))
        {
            this.BuildAdsArea.DataSource     = dtxzq;
            this.BuildAdsArea.DataTextField  = "Name";
            this.BuildAdsArea.DataValueField = "ID";
            this.BuildAdsArea.DataBind();
            this.BuildAdsArea.Items.Insert(0, new ListItem("--请选择--", ""));
        }
        //检查地址
        if (AccessDataSet.HasDataTable(dtxzq))
        {
            this.CheckAdsArea.DataSource     = dtxzq;
            this.CheckAdsArea.DataTextField  = "Name";
            this.CheckAdsArea.DataValueField = "ID";
            this.CheckAdsArea.DataBind();
            this.CheckAdsArea.Items.Insert(0, new ListItem("--请选择--", ""));
        }
        //举报建设工程地址
        if (AccessDataSet.HasDataTable(dtxzq))
        {
            this.ComplainAdsArea.DataSource     = dtxzq;
            this.ComplainAdsArea.DataTextField  = "Name";
            this.ComplainAdsArea.DataValueField = "ID";
            this.ComplainAdsArea.DataBind();
            this.ComplainAdsArea.Items.Insert(0, new ListItem("--请选择--", ""));
        }
        //活动举办地址
        if (AccessDataSet.HasDataTable(dtxzq))
        {
            this.MassSportsAdsArea.DataSource     = dtxzq;
            this.MassSportsAdsArea.DataTextField  = "Name";
            this.MassSportsAdsArea.DataValueField = "ID";
            this.MassSportsAdsArea.DataBind();
            this.MassSportsAdsArea.Items.Insert(0, new ListItem("--请选择--", ""));
        }
        //违法人(单位)地址
        if (AccessDataSet.HasDataTable(dtxzq))
        {
            this.PunishAdsArea.DataSource     = dtxzq;
            this.PunishAdsArea.DataTextField  = "Name";
            this.PunishAdsArea.DataValueField = "ID";
            this.PunishAdsArea.DataBind();
            this.PunishAdsArea.Items.Insert(0, new ListItem("--请选择--", ""));
        }
        //临时查封场所地址
        if (AccessDataSet.HasDataTable(dtxzq))
        {
            this.TempCloseArea.DataSource     = dtxzq;
            this.TempCloseArea.DataTextField  = "Name";
            this.TempCloseArea.DataValueField = "ID";
            this.TempCloseArea.DataBind();
            this.TempCloseArea.Items.Insert(0, new ListItem("--请选择--", ""));
        }
        //强制执行对象地址
        if (AccessDataSet.HasDataTable(dtxzq))
        {
            this.ForceRunAdsArea.DataSource     = dtxzq;
            this.ForceRunAdsArea.DataTextField  = "Name";
            this.ForceRunAdsArea.DataValueField = "ID";
            this.ForceRunAdsArea.DataBind();
            this.ForceRunAdsArea.Items.Insert(0, new ListItem("--请选择--", ""));
        }
        //申请复议、诉讼人(单位)地址
        if (AccessDataSet.HasDataTable(dtxzq))
        {
            this.ApplyFYArea.DataSource     = dtxzq;
            this.ApplyFYArea.DataTextField  = "Name";
            this.ApplyFYArea.DataValueField = "ID";
            this.ApplyFYArea.DataBind();
            this.ApplyFYArea.Items.Insert(0, new ListItem("--请选择--", ""));
        }
        //申请国家赔偿人(单位)地址
        if (AccessDataSet.HasDataTable(dtxzq))
        {
            this.CountryPayAdsArea.DataSource     = dtxzq;
            this.CountryPayAdsArea.DataTextField  = "Name";
            this.CountryPayAdsArea.DataValueField = "ID";
            this.CountryPayAdsArea.DataBind();
            this.CountryPayAdsArea.Items.Insert(0, new ListItem("--请选择--", ""));
        }
        //嫌疑人地址
        if (AccessDataSet.HasDataTable(dtxzq))
        {
            this.PenalDocAdsArea.DataSource     = dtxzq;
            this.PenalDocAdsArea.DataTextField  = "Name";
            this.PenalDocAdsArea.DataValueField = "ID";
            this.PenalDocAdsArea.DataBind();
            this.PenalDocAdsArea.Items.Insert(0, new ListItem("--请选择--", ""));
        }
        //案发地址
        if (AccessDataSet.HasDataTable(dtxzq))
        {
            this.PenalDocCrimeAdsArea.DataSource     = dtxzq;
            this.PenalDocCrimeAdsArea.DataTextField  = "Name";
            this.PenalDocCrimeAdsArea.DataValueField = "ID";
            this.PenalDocCrimeAdsArea.DataBind();
            this.PenalDocCrimeAdsArea.Items.Insert(0, new ListItem("--请选择--", ""));
        }
        #endregion

        //如果没有录入人默认显示当前用户名
        this.txtEnterPeople.Text = LoginUser.GetUserName;
    }
    /// <summary>
    /// 保存操作
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnSave_Click(object sender, EventArgs e)
    {
        //获取界面数值赋值给model对象
        int    FileClassID     = this.GetRequestInt("txtFileClassID");
        string FileClassName   = this.txtFileClassID.SelectedItem.Text.Trim('-');
        string FileEnterName   = this.GetRequestStr("txtFileEnterName");
        string ApproverPeople  = this.GetRequestStr("txtApproverPeople");
        string ApproverUnit    = this.GetRequestStr("txtApproverUnit");
        string SupervisePeople = this.GetRequestStr("txtSupervisePeople");
        string SuperviseUnit   = this.GetRequestStr("txtSuperviseUnit");
        string DestroyPeople   = this.GetRequestStr("txtDestroyPeople");
        string DestroyDate     = this.GetRequestStr("txtDestroyDate");
        string DestroyAds      = this.GetRequestStr("txtDestroyAds");//归还时间--暂不需要
        string Remark          = this.GetRequestStr("txtRemark");
        int    id = this.GetRequestInt("id");

        #region 判断输入信息
        if (FileClassID.ToString() == "0")
        {
            new MessageBox(this.Page).Show("请选择案卷类型名称!");
            return;
        }
        if (FileEnterName == "")
        {
            new MessageBox(this.Page).Show("请输入案卷名称!");
            return;
        }
        if (ApproverPeople == "")
        {
            new MessageBox(this.Page).Show("请输入批准人姓名!");
            return;
        }
        if (ApproverUnit == "")
        {
            new MessageBox(this.Page).Show("请选择批准人承办单位!");
            return;
        }
        if (SupervisePeople == "")
        {
            new MessageBox(this.Page).Show("请输入监督人姓名!");
            return;
        }
        if (SuperviseUnit == "")
        {
            new MessageBox(this.Page).Show("请选择监督人承办单位!");
            return;
        }
        if (DestroyPeople == "")
        {
            new MessageBox(this.Page).Show("请输入销毁人姓名!");
            return;
        }
        if (DestroyAds == "")
        {
            new MessageBox(this.Page).Show("请输入销毁地点!");
            return;
        }
        if (DestroyDate == "")
        {
            new MessageBox(this.Page).Show("请选择销毁时间!");
            return;
        }
        #endregion


        int line = 0;  //定义增加受影响的行数

        //判断该档案是否存在
        DataTable dtfl = PublicQuery.GetDataDNJYTable(FileEnterName, FileClassID.ToString());
        if (!AccessDataSet.HasDataTable(dtfl))
        {
            new MessageBox(this.Page).Show("你案卷类型下不存在此案卷名称的案卷!");
            return;
        }

        if (this.GetRequestInt("id") > 0)
        {
            line = dal.Update(
                dtfl.Rows[0]["id"].ToString(),
                FileClassID,
                FileClassName,
                FileEnterName,
                ApproverPeople,
                ApproverUnit,
                SupervisePeople,
                SuperviseUnit,
                DestroyPeople,
                DestroyDate,
                DestroyAds,
                DateTime.Now.ToString(),
                Remark, LoginUser.GetUserId, LoginUser.GetUserName, LoginUser.CountyId, id);
            if (line > 0)
            {
                fedal.UpdateFileEnterSLLX("", 1, FileClassID.ToString(), FileEnterName);
                new MessageBox(Page).ShowAndJump("编辑成功!", "FileDestroyList.aspx");
                //操作日志
                LogListDal.Insert(DateTime.Now, "档案销毁编辑成功", LoginUser.GetUserId, LoginUser.GetUserName);
            }
            else
            {
                new MessageBox(this.Page).Show("编辑失败!");
            }
        }
        else
        {
            line = dal.Insert(
                dtfl.Rows[0]["id"].ToString(),
                FileClassID,
                FileClassName,
                FileEnterName,
                ApproverPeople,
                ApproverUnit,
                SupervisePeople,
                SuperviseUnit,
                DestroyPeople,
                DestroyDate,
                DestroyAds,
                DateTime.Now.ToString(),
                Remark, LoginUser.GetUserId, LoginUser.GetUserName, LoginUser.CountyId);
            if (line > 0)
            {
                fedal.UpdateFileEnterSLLX("", 1, FileClassID.ToString(), FileEnterName);
                new MessageBox(Page).ShowAndJump("增加成功!", "FileDestroyList.aspx");
                //操作日志
                LogListDal.Insert(DateTime.Now, "档案销毁增加成功", LoginUser.GetUserId, LoginUser.GetUserName);
            }
            else
            {
                new MessageBox(this.Page).Show("增加失败!");
            }
        }
    }
Beispiel #15
0
 public PublicView GetListByPage([FromBody] PublicQuery query)
 {
     return(_roleMenuDao.GetListByPage(query));
 }
Beispiel #16
0
 public PublicView GetAppLogs([FromBody] PublicQuery publicQuery)
 {
     return(_applicationLogDao.GetApplicationLogs(publicQuery));
 }
Beispiel #17
0
        private void BuildChatMessage(string channel, dynamic data)
        {
            Enum.TryParse(data[0].type.ToString().ToUpper(), out ChatEventType type);
            Enum.TryParse(data[0].roomRole.ToString().ToUpper(), out RoomRole roomRole);

            #if DEBUG
            Console.WriteLine(data[0].ToString());
            #endif

            switch (type)
            {
            case ChatEventType.MESSAGE:
                OnChatEvent?.Invoke(new ChatTextMessage(channel, data[0].id.ToString(), Util.DliveUserObjectToPublicUserData(data[0].sender), roomRole, bool.Parse(data[0].subscribing.ToString()), data[0].content.ToString(), long.Parse(data[0].subLength.ToString())));
                break;

            case ChatEventType.GIFT:
                Enum.TryParse(data[0].gift.ToString(), out GiftType giftType);
                OnChatEvent?.Invoke(new ChatGiftMessage(channel, data[0].id.ToString(), Util.DliveUserObjectToPublicUserData(data[0].sender), roomRole, bool.Parse(data[0].subscribing.ToString()), giftType, int.Parse(data[0].amount.ToString()), data[0].message.ToString()));
                break;

            case ChatEventType.SUBSCRIPTION:
                OnChatEvent?.Invoke(new ChatSubscriptionMessage(channel, data[0].id.ToString(), Util.DliveUserObjectToPublicUserData(data[0].sender), roomRole, bool.Parse(data[0].subscribing.ToString()), int.Parse(data[0].month.ToString())));
                break;

            case ChatEventType.HOST:
                OnChatEvent?.Invoke(new ChatHostMessage(channel, data[0].id.ToString(), Util.DliveUserObjectToPublicUserData(data[0].sender), roomRole, bool.Parse(data[0].subscribing.ToString()), int.Parse(data[0].viewer.ToString())));
                break;

            case ChatEventType.CHAT_MODE:
                Enum.TryParse(data[0].mode.ToString(), out ChatMode mode);
                OnChatEvent?.Invoke(new ChatModeChangeMessage(channel, data[0].id.ToString(), Util.DliveUserObjectToPublicUserData(data[0].sender), roomRole, bool.Parse(data[0].subscribing.ToString()), mode));
                break;

            case ChatEventType.BAN:
                Enum.TryParse(data[0].bannedByRoomRoleToString().ToUpper(), out RoomRole bannedByRoomRole);
                OnChatEvent?.Invoke(new ChatBanMessage(channel, data[0].id.ToString(), Util.DliveUserObjectToPublicUserData(data[0].sender), roomRole, Util.DliveUserObjectToPublicUserData(data[0].bannedBy), bannedByRoomRole));
                break;

            case ChatEventType.MOD:
                ModeratorStatusChange change = bool.Parse(data[0].add.ToString()) ? ModeratorStatusChange.PROMOTED : ModeratorStatusChange.DEMOTED;
                OnChatEvent?.Invoke(new ChatModStatusChangeMessage(channel, data[0].id.ToString(), Util.DliveUserObjectToPublicUserData(data[0].sender), roomRole, bool.Parse(data[0].subscribing.ToString()), change));
                break;

            case ChatEventType.EMOTE:
                OnChatEvent?.Invoke(new ChatEmoteMessage(channel, data[0].id.ToString(), Util.DliveUserObjectToPublicUserData(data[0].sender), roomRole, bool.Parse(data[0].subscribing.ToString()), data[0].emote.ToString()));
                break;

            case ChatEventType.TIMEOUT:
                Enum.TryParse(data[0].bannedByRoomRoleToString().ToUpper(), out RoomRole timedoutByRoomRole);
                OnChatEvent?.Invoke(new ChatTimeoutMessage(channel, data[0].id.ToString(), int.Parse(data[0].minute.ToString()), Util.DliveUserObjectToPublicUserData(data[0].sender), roomRole, Util.DliveUserObjectToPublicUserData(data[0].bannedBy), timedoutByRoomRole));
                break;

            case ChatEventType.CLIP:
                OnChatEvent?.Invoke(new ChatClipMessage(channel, data[0].id.ToString(), Util.DliveUserObjectToPublicUserData(data[0].sender), roomRole, bool.Parse(data[0].subscribing.ToString()), new Uri($"https://dlive.tv/clip/{data[0].url.ToString()}")));
                break;

            case ChatEventType.GIFTSUB:
                if (!int.TryParse(data[0].count.ToString(), out int months))
                {
                    months = 1;
                }

                OnChatEvent?.Invoke(new ChatGiftSubscriptionMessage(channel, data[0].id.ToString(), months, Util.DliveUserObjectToPublicUserData(data[0].sender), PublicQuery.GetPublicInfoByDisplayName(data[0].receiver.ToString()), roomRole));
                break;

            default:
                dynamic user = data[0].sender;
                OnChatEvent?.Invoke(user != null ? new UserChatMessage(type, channel, data[0].id.ToString(), Util.DliveUserObjectToPublicUserData(user), roomRole, bool.Parse(data[0].subscribing.ToString())) : new ChatMessage(type, channel, data[0].id.ToString()));
                break;
            }
        }
Beispiel #18
0
 public static string DliveDisplayNameToUsername(string displayName)
 {
     return(PublicQuery.GetPublicInfoByDisplayName(displayName).Username);
 }
Beispiel #19
0
 public async Task <PublicView> GetListByPage(PublicQuery query)
 {
     return(await _webapiHelper.PostAsync <PublicView>(ApiUrls.Menu.GetListByPage, query));
 }
Beispiel #20
0
 public async Task <PublicView> GetAppLogs(PublicQuery publicQuery)
 {
     return(await _webapiHelper.PostAsync <PublicView>(ApiUrls.AppLog.GetAppLogs, publicQuery));
 }
    /// <summary>
    /// 保存操作
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnSave_Click(object sender, EventArgs e)
    {
        //获取界面数值赋值给model对象
        int    FileClassID    = this.GetRequestInt("txtFileClassID");
        string FileClassName  = this.txtFileClassID.SelectedItem.Text.Trim('-');
        string FileEnterName  = this.GetRequestStr("txtFileEnterName");
        string BorrowPeople   = this.GetRequestStr("txtBorrowPeople");
        string BorrowUnit     = this.GetRequestStr("txtBorrowUnit");
        string ApproverPeople = this.GetRequestStr("txtApproverPeople");
        string ApproverUnit   = this.GetRequestStr("txtApproverUnit");
        string HandlePeople   = this.GetRequestStr("txtHandlePeople");
        string BorrowDate     = this.GetRequestStr("txtBorrowDate");
        string ReturnDate     = this.GetRequestStr("txtReturnDate");//归还时间--暂不需要
        //string OperateTime = this.GetRequestStr("txtAddTime");
        string Remark = this.GetRequestStr("txtRemark");
        int    id     = this.GetRequestInt("id");

        int line = 0;  //定义增加受影响的行数

        #region 判断输入信息
        if (FileClassID.ToString() == "0")
        {
            new MessageBox(this.Page).Show("请选择案卷类型名称!");
            return;
        }
        if (FileEnterName == "")
        {
            new MessageBox(this.Page).Show("请输入案卷名称!");
            return;
        }
        if (BorrowPeople == "")
        {
            new MessageBox(this.Page).Show("请输入借阅人姓名!");
            return;
        }
        if (BorrowUnit == "")
        {
            new MessageBox(this.Page).Show("请选择借阅人承办单位!");
            return;
        }
        if (ApproverPeople == "")
        {
            new MessageBox(this.Page).Show("请输入批准人姓名!");
            return;
        }
        if (ApproverUnit == "")
        {
            new MessageBox(this.Page).Show("请选择批准人承办单位!");
            return;
        }
        if (HandlePeople == "")
        {
            new MessageBox(this.Page).Show("请输入经办人姓名!");
            return;
        }
        if (BorrowDate == "")
        {
            new MessageBox(this.Page).Show("请选择借阅时间!");
            return;
        }
        #endregion

        //判断该档案是否存在
        DataTable dtfl = PublicQuery.GetDataDNJYTable(FileEnterName, FileClassID.ToString());
        if (!AccessDataSet.HasDataTable(dtfl))
        {
            new MessageBox(this.Page).Show("你案卷类型下不存在此案卷名称的案卷!");
            return;
        }

        if (this.GetRequestInt("id") > 0)
        {
            line = dal.Update(
                dtfl.Rows[0]["id"].ToString(),
                FileClassID,
                FileClassName,
                FileEnterName,
                BorrowPeople,
                BorrowUnit,
                ApproverPeople,
                ApproverUnit,
                HandlePeople,
                BorrowDate,
                ReturnDate,            //归还时间--暂不需要
                DateTime.Now.ToString(),
                Remark, LoginUser.GetUserId, LoginUser.GetUserName, LoginUser.CountyId, id);
            if (line > 0)
            {
                if (ReturnDate == "")
                {
                    fedal.UpdateFileEnterSLLX("", 2, FileClassID.ToString(), FileEnterName);
                }
                else
                {
                    fedal.UpdateFileEnterSLLX("", 0, FileClassID.ToString(), FileEnterName);
                }
                new MessageBox(Page).ShowAndJump("编辑成功!", "FileBorrowList.aspx");
                //操作日志
                LogListDal.Insert(DateTime.Now, "档案借阅编辑成功", LoginUser.GetUserId, LoginUser.GetUserName);
            }
            else
            {
                new MessageBox(this.Page).Show("编辑失败!");
            }
        }
        else
        {
            line = dal.Insert(
                dtfl.Rows[0]["id"].ToString(),
                FileClassID,
                FileClassName,
                FileEnterName,
                BorrowPeople,
                BorrowUnit,
                ApproverPeople,
                ApproverUnit,
                HandlePeople,
                BorrowDate,
                ReturnDate,            //归还时间--暂不需要
                DateTime.Now.ToString(),
                Remark, LoginUser.GetUserId, LoginUser.GetUserName, LoginUser.CountyId);
            if (line > 0)
            {
                if (ReturnDate == "")
                {
                    fedal.UpdateFileEnterSLLX("", 2, FileClassID.ToString(), FileEnterName);
                }
                else
                {
                    fedal.UpdateFileEnterSLLX("", 0, FileClassID.ToString(), FileEnterName);
                }
                new MessageBox(Page).ShowAndJump("增加成功!", "FileBorrowList.aspx");
                //操作日志
                LogListDal.Insert(DateTime.Now, "档案借阅增加成功", LoginUser.GetUserId, LoginUser.GetUserName);
            }
            else
            {
                new MessageBox(this.Page).Show("增加失败!");
            }
        }
    }
Beispiel #22
0
 public static string DliveUsernameToDisplayName(string username)
 {
     return(PublicQuery.GetPublicInfo(username).Displayname);
 }