Example #1
0
        public async Task <Users> InsertAsync(Users users, EntityContextWEB context)
        {
            users.AddBy = Current.UserID;
            context.Users.Add(users);
            await context.SaveChangesAsync();

            return(users);
        }
Example #2
0
        public async Task UpdateAsync(Users users, EntityContextWEB context)
        {
            var Users = context.Users;
            var u     = Users.Attach(users);

            u.Property(c => c.EmployeeCode).IsModified = true;
            u.Property(c => c.AddBy).CurrentValue      = Current.UserID;
            await context.SaveChangesAsync();
        }
Example #3
0
        public async Task InsertAsync(AnnounceMathDocs model, EntityContextWEB context)
        {
            var isexists = await model.IsExistsDocsNameAsync(model.File.FileName, context);

            if (isexists)
            {
                await context.AnnounceDocs
                .Where(t => t.DocsName == model.DocsName)
                .UpdateAsync(t => new AnnounceMathDocs {
                    LastModifyDate = DateTime.Now, LastModifyBy = Current.UserID
                });
            }
            else
            {
                context.AnnounceDocs.Add(model);
                await context.SaveChangesAsync();
            }
        }
Example #4
0
 public async Task DeleteAsync(Users users, EntityContextWEB context)
 {
     context.Users.Remove(users);
     await context.SaveChangesAsync();
 }
Example #5
0
 public async Task DeleteAsync(CommRates commRate, EntityContextWEB context)
 {
     context.CommRates.Remove(commRate);
     await context.SaveChangesAsync();
 }
Example #6
0
 public async Task UpdateAsync(CommRates commRate, EntityContextWEB context)
 {
     context.Entry(commRate).State = EntityState.Modified;
     await context.SaveChangesAsync();
 }
Example #7
0
 public async Task DeleteAsync(int id, EntityContextWEB context)
 {
     context.PlanDocs.Remove(context.PlanDocs.Find(id));
     await context.SaveChangesAsync();
 }