Esempio n. 1
0
        public static bool ChangeLineUser(LineUser model)
        {
            using (var entity = new BusEntities())
            {
                var obj = entity.LineUser.FirstOrDefault(x => x.ID == model.ID);
                if (obj != null)
                {
                    obj.UserID = model.UserID;

                    return(entity.SaveChanges() > 0);
                }
                return(false);
            }
        }
Esempio n. 2
0
 public static int AddLineUser(LineUser model)
 {
     using (var entity = new BusEntities())
     {
         var id = 0;
         try
         {
             entity.AddToLineUser(model);
             entity.SaveChanges();
             id = model.ID;
         }
         catch { }
         return(id);
     }
 }
Esempio n. 3
0
        public static bool SaveEditLineUser(LineUser model)
        {
            using (var entity = new BusEntities())
            {
                var obj = entity.LineUser.FirstOrDefault(x => x.ID == model.ID);
                if (obj != null)
                {
                    obj.LineID       = model.LineID;
                    obj.UserID       = model.UserID;
                    obj.Names        = model.Names;
                    obj.Phone        = model.Phone;
                    obj.StartAddress = model.StartAddress;
                    obj.EndAddress   = model.EndAddress;
                    obj.EndTime      = model.EndTime;
                    obj.Memo         = model.Memo;
                    obj.EMail        = model.EMail;
                    obj.QQ           = model.QQ;
                    obj.StateID      = model.StateID;

                    return(entity.SaveChanges() > 0);
                }
                return(false);
            }
        }