Exemplo n.º 1
0
 public int AuthAdd(mAuth mauth)
 {
     Auth auth = new Auth();
     auth_repo.Add(mauth.ToDb(auth));
     SubmitChanges();
     return auth.id;
 }
Exemplo n.º 2
0
 public mAuth(Auth a)
 {
     Id = a.id;
     Act = (eAct)a.act;
     Name = a.name;
     Key1 = a.key1;
     Key2 = a.key2;
     Key3 = a.key3;
     Type = (eAuthType)a.type;
 }
Exemplo n.º 3
0
 public int SeatAdd(mSeat newseat)
 {
     Seat seat = new Seat();
     seat_repo.Add(newseat.ToDb(seat));
     SubmitChanges();
     Auth useseatauth = new Auth {
         name = EnumDescription.GetFieldText(eAuthType.UseSeat) + " - " + seat.name,
         type = (int)eAuthType.UseSeat,
         key1 = seat.id
     };
     auth_repo.Add(useseatauth);
     Auth editseatauth = new Auth {
         name = EnumDescription.GetFieldText(eAuthType.EditSeat) + " - " + seat.name,
         type = (int)eAuthType.EditSeat,
         key1 = seat.id
     };
     auth_repo.Add(editseatauth);
     foreach (eSelpropType etype in Enum.GetValues(typeof(eSelpropType))) {
         Auth selpropauth = new Auth {
             name = EnumDescription.GetFieldText(eAuthType.UseSeatProp) + " - " + EnumDescription.GetFieldText(etype) + " - " + seat.name,
             type = (int)eAuthType.UseSeatProp,
             key1 = seat.id,
             key2 = (int)etype
         };
         auth_repo.Add(selpropauth);
     }
     foreach (eItemPropType etype in Enum.GetValues(typeof(eItemPropType))) {
         Auth itempropauth = new Auth {
             name = EnumDescription.GetFieldText(eAuthType.UseSeatProp) + " - " + EnumDescription.GetFieldText(etype) + " - " + seat.name,
             type = (int)eAuthType.UseSeatProp,
             key1 = seat.id,
             key2 = (int)etype
         };
         auth_repo.Add(itempropauth);
     }
     SubmitChanges();
     return seat.id;
 }
Exemplo n.º 4
0
 partial void DeleteAuth(Auth instance);
Exemplo n.º 5
0
 partial void UpdateAuth(Auth instance);
Exemplo n.º 6
0
 partial void InsertAuth(Auth instance);
Exemplo n.º 7
0
 public Auth ToDb(Auth auth)
 {
     auth.act = (int)Act;
     auth.type = (int)Type;
     if (!string.IsNullOrEmpty(Name)) auth.name = Name;
     if (Key1.HasValue) auth.key1 = Key1.Value;
     if (Key2.HasValue) auth.key2 = Key2.Value;
     if (Key3.HasValue) auth.key3 = Key3.Value;
     return auth;
 }