public bool SetKonto(Konto input, int[] classes, string pass) { if (this.konto == null) { return(false); } string hash = pass + "a6s8d"; DBKonto newKon = new DBKonto() { Login = input.Login, Haslo = md5Hash.GetMD5Hash(hash), Salt = "a6s8d", Clear = input.Clear, Class_Haslo = classes[1], Class = classes[3], Class_Login = classes[0], Class_salt = classes[2] }; if (Locker <DBKonto> .Lock(newKon, LockWriteKonta)) { ctx.Konto.Add(newKon); ctx.SaveChanges(); return(true); } return(false); }
public bool SetZam_prody(zam_prod input, int[] classes) { if (this.konto == null) { return(false); } DBzam_prod newProdOrd = new DBzam_prod() { ID_Produkt = input.ID_Produkt, ID_Zamowienia = input.ID_Zamowienia, Ilosc = input.Ilosc, Class_Ilosc = classes[0], Class = classes[1] }; if (Locker <DBzam_prod> .Lock(newProdOrd, LockWriteZam_prod)) { ctx.zam_prod.Add(newProdOrd); ctx.SaveChanges(); return(true); } return(false); }
public bool SetZam(Zamowienia input, int[] classes) { if (this.konto == null) { return(false); } DBZamowienia newOrder = new DBZamowienia() { ID_Klienta = input.ID_Klienta, Data_zlozenia = input.Data_zlozenia, Class_Data_zlozenia = classes[1], Status = input.Status, Class_Status = classes[0], Class = classes[2] }; if (Locker <DBZamowienia> .Lock(newOrder, LockWriteZamowienia)) { ctx.Zamowienia.Add(newOrder); ctx.SaveChanges(); return(true); } return(false); }