removed migration ,altered Guid to int
This commit is contained in:
@@ -42,10 +42,10 @@ namespace _2021_backend.Pages.Message
|
||||
|
||||
public IActionResult Construct(int PageId)
|
||||
{
|
||||
List<Guid> stus;
|
||||
IQueryable<Guid> q;
|
||||
if (!String.IsNullOrEmpty(SearchString)) q = from e in Context.Students where e.Name.Contains(SearchString) select e.Guid;
|
||||
else q = from e in Context.Students select e.Guid;
|
||||
List<int> stus;
|
||||
IQueryable<int> q;
|
||||
if (!String.IsNullOrEmpty(SearchString)) q = from e in Context.Students where e.Name.Contains(SearchString) select e.Id;
|
||||
else q = from e in Context.Students select e.Id;
|
||||
stus = q.ToList();
|
||||
var q2 = from e in Context.SMS where stus.Contains(e.Host) select e;
|
||||
if (showReceive && !showSend) q2 = from e in q2 where e.Type == SMSType.Reply select e;
|
||||
@@ -94,7 +94,7 @@ namespace _2021_backend.Pages.Message
|
||||
foreach (var e in stu)
|
||||
{
|
||||
if (e.Status == status.刚报名)
|
||||
await Utils.TencentSMS.Send(Context, SMSType.Signed, e, Context.Users.Find(Guid.Parse(User.Claims.FirstOrDefault(c => c.Type == ClaimTypes.Sid).Value)).Name);
|
||||
await Utils.TencentSMS.Send(Context, SMSType.Signed, e, Context.Users.Find(int.Parse(User.Claims.FirstOrDefault(c => c.Type == ClaimTypes.Sid).Value)).Name);
|
||||
}
|
||||
|
||||
return Construct(PageId);
|
||||
@@ -107,8 +107,8 @@ namespace _2021_backend.Pages.Message
|
||||
{
|
||||
if (e.Status == status.不通过)
|
||||
{
|
||||
if (!Context.SMS.Any(it => it.Host == e.Guid && it.Type == SMSType.Reject))
|
||||
await Utils.TencentSMS.Send(Context, SMSType.Reject, e, Context.Users.Find(Guid.Parse(User.Claims.FirstOrDefault(c => c.Type == ClaimTypes.Sid).Value)).Name);
|
||||
if (!Context.SMS.Any(it => it.Host == e.Id && it.Type == SMSType.Reject))
|
||||
await Utils.TencentSMS.Send(Context, SMSType.Reject, e, Context.Users.Find(int.Parse(User.Claims.FirstOrDefault(c => c.Type == ClaimTypes.Sid).Value)).Name);
|
||||
}
|
||||
}
|
||||
return Construct(PageId);
|
||||
@@ -121,7 +121,7 @@ namespace _2021_backend.Pages.Message
|
||||
{
|
||||
if (e.Status != status.不通过 && e.Status != status.已选时间)
|
||||
{
|
||||
await Utils.TencentSMS.Send(Context, SMSType.TimeSelect, e, Context.Users.Find(Guid.Parse(User.Claims.FirstOrDefault(c => c.Type == ClaimTypes.Sid).Value)).Name);
|
||||
await Utils.TencentSMS.Send(Context, SMSType.TimeSelect, e, Context.Users.Find(int.Parse(User.Claims.FirstOrDefault(c => c.Type == ClaimTypes.Sid).Value)).Name);
|
||||
}
|
||||
}
|
||||
Context.SaveChanges();
|
||||
@@ -135,8 +135,8 @@ namespace _2021_backend.Pages.Message
|
||||
{
|
||||
if (e.Status == status.通过)
|
||||
{
|
||||
if (!Context.SMS.Any(it => it.Host == e.Guid && it.Type == SMSType.Accept))
|
||||
await Utils.TencentSMS.Send(Context, SMSType.Accept, e, Context.Users.Find(Guid.Parse(User.Claims.FirstOrDefault(c => c.Type == ClaimTypes.Sid).Value)).Name);
|
||||
if (!Context.SMS.Any(it => it.Host == e.Id && it.Type == SMSType.Accept))
|
||||
await Utils.TencentSMS.Send(Context, SMSType.Accept, e, Context.Users.Find(int.Parse(User.Claims.FirstOrDefault(c => c.Type == ClaimTypes.Sid).Value)).Name);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -149,9 +149,9 @@ namespace _2021_backend.Pages.Message
|
||||
foreach(var e in stu)
|
||||
{
|
||||
var t = Context.Sessions.Find(e.InterviewTime);
|
||||
if(t != null && t.Students.Find(s => s==e.Guid)!= Guid.Empty && e.Status == status.已选时间)
|
||||
if(t != null && t.Students.Find(s => s==e.Id)!= 0 && e.Status == status.已选时间)
|
||||
{
|
||||
await Utils.TencentSMS.Send(Context, SMSType.TimeSet, e, Context.Users.Find(Guid.Parse(User.Claims.FirstOrDefault(c => c.Type == ClaimTypes.Sid).Value)).Name);
|
||||
await Utils.TencentSMS.Send(Context, SMSType.TimeSet, e, Context.Users.Find(int.Parse(User.Claims.FirstOrDefault(c => c.Type == ClaimTypes.Sid).Value)).Name);
|
||||
e.Status = status.已确认时间;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user