示例#1
0
 public void CreateMember(string text, string pathAvatar, string pathPlate, string pathFull)
 {
     using (var context = new admin_dangkythitoeicEntities())
     {
         Member member = new Member
         {
             CreateDT     = DateTime.Now,
             UpdateDT     = DateTime.Now,
             Address      = "",
             UniversityID = 0,
             IsDeleted    = false,
         };
         context.Members.Add(member);
         GoLeave goLeave = new GoLeave
         {
             GoAvatar = pathAvatar,
             GoDT     = DateTime.Now,
             GoFull   = pathFull,
             GoPlate  = pathPlate,
             GoOCR    = text,
             OwnerID  = member.ID
         };
         context.GoLeaves.Add(goLeave);
         context.SaveChanges();
     }
 }
示例#2
0
 public void CreateGoLeave(int ID, string text, string pathAvatar, string pathPlate, string pathFull)
 {
     try
     {
         using (var context = new admin_dangkythitoeicEntities())
         {
             var old = context.GoLeaves
                       .OrderByDescending(p => p.GoDT)
                       .First();
             if (DateTime.Now.Subtract(old.GoDT.Value).Seconds > 4)
             {
                 GoLeave goLeave = new GoLeave
                 {
                     GoAvatar = pathAvatar,
                     GoDT     = DateTime.Now,
                     GoFull   = pathFull,
                     GoPlate  = pathPlate,
                     GoOCR    = text,
                     OwnerID  = ID
                 };
                 context.GoLeaves.Add(goLeave);
                 context.SaveChanges();
             }
         }
     }
     catch { }
 }
示例#3
0
 public void CreateReason(string goText, string leaveText,
                          string goPathAvatar, string leavePathAvatar,
                          string goPathPlate, string leavePathPlate,
                          string goPathFull, string leavePathFull)
 {
     using (var context = new admin_dangkythitoeicEntities())
     {
         Member member = new Member
         {
             CreateDT     = DateTime.Now,
             UpdateDT     = DateTime.Now,
             Address      = "",
             UniversityID = 0,
             IsDeleted    = false,
         };
         context.Members.Add(member);
         GoLeave goLeave = new GoLeave
         {
             GoAvatar    = goPathAvatar,
             GoDT        = DateTime.Now,
             GoFull      = goPathFull,
             GoPlate     = goPathPlate,
             GoOCR       = goPathPlate,
             LeavePlate  = leavePathPlate,
             leaveAvatar = leavePathAvatar,
             LeaveDT     = DateTime.Now,
             LeaveFull   = leavePathFull,
             IsFinish    = true,
             OutOCR      = leaveText,
             OwnerID     = member.ID,
         };
         context.GoLeaves.Add(goLeave);
         context.SaveChanges();
     }
 }