コード例 #1
0
        public async Task <VmMailboxDto> LoadInmateAccountMailbox(String pin, String siteId)
        {
            List <SqlParameter> parameters = new List <SqlParameter>();

            parameters.AddSqlParam("@Pin", pin);
            parameters.AddSqlParam("@SiteId", siteId);

            VmMailboxDto result = await SqlParsedExecute.InvokeProcSingleAsync <VmMailboxDto>(_conStrIvxsvr, "uspLoadInmateAccountMailbox", parameters);

            DateTime createDateTime;

            if (DateTime.TryParseExact($"{result.CreateDate} {result.CreateTime}", "yyyyMMdd HHmmss", null, DateTimeStyles.None, out createDateTime))
            {
                result.CreateDateTime = createDateTime;
            }

            DateTime loginDateTime;

            if (DateTime.TryParseExact($"{result.LoginDate} {result.LoginTime}", "yyyyMMdd HHmmss", null, DateTimeStyles.None, out loginDateTime))
            {
                result.LoginDateTime = loginDateTime;
            }

            return(result);
        }
コード例 #2
0
        public async Task <List <VmBroadcastGroup> > LoadBroadcastGroups(String siteId)
        {
            List <SqlParameter> parameters = new List <SqlParameter>();

            parameters.AddSqlParam("@SiteId", siteId);

            IEnumerable <VmBroadcastGroup> result = await SqlParsedExecute.InvokeProcAsync <VmBroadcastGroup>(_conStrIvxsvr, "uspLoadBroadcastGroups", parameters);

            return(result.ToList());
        }
コード例 #3
0
        public async Task <List <CreateMailboxDto> > LoadMailboxesToCreate(String siteId)
        {
            List <SqlParameter> parameters = new List <SqlParameter>();

            parameters.AddSqlParam("@SiteId", siteId);

            IEnumerable <CreateMailboxDto> result = await SqlParsedExecute.InvokeProcAsync <CreateMailboxDto>(_conStrIvxsvr, "uspLoadMailboxesToCreate", parameters);

            return(result?.ToList());
        }
コード例 #4
0
        public async Task <List <CreateMailboxDto> > CreateMailboxes(List <CreateMailboxDto> mailboxes)
        {
            DataTable mailboxesDt = new DataTable();

            mailboxesDt.Columns.Add(new DataColumn("MailboxId", typeof(String)));
            mailboxesDt.Columns.Add(new DataColumn("CosId", typeof(Int32)));
            mailboxesDt.Columns.Add(new DataColumn("SiteId", typeof(String)));
            mailboxesDt.Columns.Add(new DataColumn("UserId", typeof(String)));
            mailboxesDt.Columns.Add(new DataColumn("UserName", typeof(String)));
            mailboxesDt.Columns.Add(new DataColumn("UserPassword", typeof(String)));
            mailboxesDt.Columns.Add(new DataColumn("CreateDateStr", typeof(String)));
            mailboxesDt.Columns.Add(new DataColumn("CreateTimeStr", typeof(String)));
            mailboxesDt.Columns.Add(new DataColumn("BroadcastGroupId", typeof(Int32)));
            mailboxesDt.Columns.Add(new DataColumn("BroadcastGroupName", typeof(String)));

            foreach (CreateMailboxDto dto in mailboxes)
            {
                DataRow row = mailboxesDt.NewRow();

                row["MailboxId"]          = dto.MailboxId;
                row["CosId"]              = dto.CosId;
                row["SiteId"]             = dto.SiteId;
                row["UserId"]             = dto.UserId;
                row["UserName"]           = dto.UserName;
                row["UserPassword"]       = dto.UserPassword;
                row["CreateDateStr"]      = dto.CreateDateStr;
                row["CreateTimeStr"]      = dto.CreateTimeStr;
                row["BroadcastGroupId"]   = dto.BroadcastGroupId;
                row["BroadcastGroupName"] = dto.BroadcastGroupName;

                mailboxesDt.Rows.Add(row);
            }

            List <SqlParameter> parameters = new List <SqlParameter>();

            parameters.AddSqlParamFromDt("@Mailboxes", mailboxesDt);

            IEnumerable <CreateMailboxDto> result = await SqlParsedExecute.InvokeProcAsync <CreateMailboxDto>(_conStrIvxsvr, "uspCreateMailboxes", parameters);

            return(result.ToList());
        }
コード例 #5
0
        public async Task <List <VmSiteNameDto> > LoadAllSiteNames()
        {
            IEnumerable <VmSiteNameDto> result = await SqlParsedExecute.InvokeProcAsync <VmSiteNameDto>(_conStrIvxsvr, "uspLoadAllSiteNames");

            return(result.ToList());
        }
コード例 #6
0
        public async Task <List <String> > LoadAllMailboxIds()
        {
            IEnumerable <MailboxIdDto> result = await SqlParsedExecute.InvokeProcAsync <MailboxIdDto>(_conStrIvxsvr, "uspLoadAllMailboxIds");

            return(result.Select(r => r.MailboxId.Trim()).ToList());
        }