/// <summary> /// Constructeur par défaut /// </summary> public Rubric() { dal = new DALClient(); ListTopicsByRubric = new List <Topic>(); IdRubric = Int_NullValue; NameRubric = String_NullValue; DTO = new RubricDTO(); }
/// <summary> /// Constructeur par défaut /// </summary> public Message() { dal = new DALClient(); IdMessage = Int_NullValue; IdTopic = Int_NullValue; ObjUser = null; DateMessage = DateTime_NullValue; ContentMessage = String_NullValue; DTO = new MessageDTO(); }
/// <summary> /// Constructeur par défaut /// </summary> public Topic() { dal = new DALClient(); ListMessagesByTopic = new List <Message>(); IdTopic = Int_NullValue; ObjUser = new Registered(); ObjRubric = new Rubric(); DateTopic = DateTime_NullValue; TitleTopic = String_NullValue; DescTopic = String_NullValue; DTO = new TopicDTO(); }
/// <summary> /// Constructeur par défaut /// </summary> public Forum() { dal = new DALClient(); User = new Registered(); TokenUser = new Token(); ListRubric = new List <Rubric>(); ListTraining = new List <Training>(); ListStatus = new List <Status>(); GetListRubrics(); GetListStatus(); GetListtraining(); }
public string DeleteRec(string IDX) { //ASK THE DAL DALClient client = new DALClient(); try { return(client.DoWork("ClientRecsRemove|" + IDX.ToString() + "|").ToString()); } catch { return("-1"); } }
public string EditRec(string IDX, int Type, string Description) { //ASK THE DAL DALClient client = new DALClient(); try { return(client.DoWork("ContactTypeRecsEdit|" + IDX.ToString() + "|" + Type.ToString() + "|" + Description + "|").ToString()); } catch { return("-1"); } }
public string EditRec(string IDX, string ClientIDX, string ContactTypeIDX, string Contact) { //ASK THE DAL DALClient client = new DALClient(); try { return(client.DoWork("ClientContactRecsEdit|" + IDX.ToString() + "|" + ClientIDX.ToString() + "|" + ContactTypeIDX + "|" + Contact.ToString() + "|").ToString()); } catch { return("-1"); } }
public async Task <List <Training> > GetListTrainings() { DALClient dal = new DALClient(); DALWSR_Result r = await dal.GetListTrainings(CancellationToken.None); List <TrainingDTO> listDTO = (List <TrainingDTO>)r.Data; List <Training> list = new List <Training>(); foreach (TrainingDTO item in listDTO) { list.Add(new Training(item)); } return(list); }
public string EditRec(string IDX, string Name, string Surname, int Gender, int Age) { //ASK THE DAL DALClient client = new DALClient(); try { return(client.DoWork("ClientRecsEdit|" + IDX.ToString() + "|" + Name.ToString() + "|" + Surname + "|" + Gender.ToString() + "|" + Age.ToString() + "|").ToString()); } catch { return("-1"); } }
/// <summary> /// Constructeur par défaut /// </summary> public Registered() { dal = new DALClient(); ListRegistered = new List <Registered>(); IdUser = Int_NullValue; ObjStatus = null; NameUser = String_NullValue; ObjTraining = null; FirstnameUser = String_NullValue; EmailUser = String_NullValue; LoginUser = String_NullValue; PwdUser = String_NullValue; KeywordUser = String_NullValue; DTO = new RegisteredDTO(); }
public DataTable GetData() { DataTable theData = new DataTable(); //ASK THE DAL DALClient client = new DALClient(); try { return(clsHelpers.DeSerializeToDT(client.DoWork("GetRecsForExport").ToString())); } catch (Exception ex) { return(new DataTable()); } }
public DataTable GetData(string IDX) { DataTable theData = new DataTable(); //ASK THE DAL DALClient client = new DALClient(); try { return(clsHelpers.DeSerializeToDT(client.DoWork("GetClientContactRecs|" + IDX + "|").ToString())); } catch (Exception ex) { return(new DataTable()); } }
private void cmdConnect_Click(object sender, RoutedEventArgs e) { Token token = new Token(0, txtLogin.Text, txtPwd.Password, 0); DALClient dal = new DALClient(); DALWSR_Result r = dal.LoginAsync(token, CancellationToken.None); if (r.Data != null) { token = (Token)r.Data; } else { mainVM.MessagePopup = "Problème de connexion."; ModalPopupError.IsOpen = true; //MessageDialog essai = new MessageDialog("Problème de connexion"); //essai.ShowAsync(); } if (token.Valid != false) { mainVM.MyForum.TokenUser = token; mainVM.MyForum.User = mainVM.MyForum.User.GetInfoUser(token.IdUser); if (mainVM.MyForum.User != null) { mainVM.MyRegistered = mainVM.MyForum.User; mainVM.IsLogged = true; Frame.Navigate(typeof(MainPage), DataContext); } else { mainVM.MessagePopup = "Problème de connexion."; ModalPopupError.IsOpen = true; //MessageDialog essai = new MessageDialog("Problème de connexion"); //essai.ShowAsync(); } } else { mainVM.MyForum.TokenUser = null; mainVM.IsLogged = false; mainVM.MessagePopup = "Login ou mot de passe incorrect."; ModalPopupError.IsOpen = true; //MessageDialog essai = new MessageDialog("Login ou mot de passe incorrect"); //essai.ShowAsync(); } }
static void Main(string[] args) { Console.BackgroundColor = ConsoleColor.White; Console.Clear(); Console.ForegroundColor = ConsoleColor.Magenta; /*WSR_Param p = new WSR_Param(); Token t = new Token(1, "Snosjean", "admin", DateTime.UtcNow.Ticks); //Response<RegisteredDTO>(p, "Users", "GET", 1); //reg.KeywordUser = "******"; p.Add("save", reg); p.Add("token", t); //Console.WriteLine("param : " + t); //essai(t, CancellationToken.None); essai<StatusDTO>(CancellationToken.None);*/ d = new DALClient(); essai(4, CancellationToken.None); //Console.WriteLine(s.Data.IdStatus);// + " " + s.Data.NameStatus); Console.ReadKey(); }
static void Main(string[] args) { Console.BackgroundColor = ConsoleColor.White; Console.Clear(); Console.ForegroundColor = ConsoleColor.Magenta; DALClient dal = new DALClient(); List <RegisteredDTO> lst = (List <RegisteredDTO>)dal.GetUsers(CancellationToken.None).Data; foreach (RegisteredDTO item in lst) { string hash = string.Join(":", new string[] { item.LoginUser, "2isaMillau%2016" }); string hashLeft = ""; string hashRight = ""; hashLeft = Convert.ToBase64String(Encoding.UTF8.GetBytes(string.Join(":", hash, item.PwdUser))); item.PwdUser = hashLeft; DALWSR_Result r = dal.SaveUser(item, null, CancellationToken.None); Console.WriteLine(item.PwdUser); } Console.ReadKey(); }
private void cmdConnect_Click(object sender, RoutedEventArgs e) { /*Token token = new Token(0, txtLogin.Text, txtPwd.Password, 0); * * DALClient dal = new DALClient(); * DALWSR_Result r = dal.LoginAsync(token, CancellationToken.None); * if(r.Data != null) * { * token = (Token)r.Data; * } * if(token.Valid != false) * { * mainVM.MyForum.TokenUser = token; * mainVM.MyForum.User = mainVM.MyForum.User.GetInfoUser(token.IdUser); * mainVM.MyRegistered = mainVM.MyForum.User; * mainVM.IsLogged = true; * Frame.Navigate(typeof(MainPage), DataContext); * } * else * { * mainVM.MyForum.TokenUser = null; * mainVM.IsLogged = false; * //todo montrer message comme quoi le login/mdp est incorrect * }*/ Token token = new Token(0, txtLogin.Text, txtPwd.Password, 0); DALClient dal = new DALClient(); DALWSR_Result r = dal.LoginAsync(token, CancellationToken.None); if (r.Data != null) { token = (Token)r.Data; } else { MessageDialog essai = new MessageDialog("Problème de connexion"); essai.ShowAsync(); } if (token.Valid != false) { mainVM.MyForum.TokenUser = token; mainVM.MyForum.User = mainVM.MyForum.User.GetInfoUser(token.IdUser); if (mainVM.MyForum.User != null) { mainVM.MyRegistered = mainVM.MyForum.User; mainVM.IsLogged = true; Frame.Navigate(typeof(MainPage), DataContext); } else { MessageDialog essai = new MessageDialog("Problème de connexion"); essai.ShowAsync(); } } else { mainVM.MyForum.TokenUser = null; mainVM.IsLogged = false; MessageDialog essai = new MessageDialog("Login ou mot de passe incorrect"); essai.ShowAsync(); } }
// Create public static Guid CreateClient(Client pClient) { return(DALClient.AddClient(pClient)); }
private void Init(System.Net.NetworkCredential nc, string user, string language, string pwd, string fwPassword) { myNC = nc; myUser = user; myPwd = pwd; myFWPassword = fwPassword; AtriumXURL = ServerInfo.AtriumX; if (ServerInfo.IsCompressionNull()) { Compression = true; } else { Compression = ServerInfo.Compression; } UseProxy = ServerInfo.useProxy; UseService = ServerInfo.useService; UseTrusted = serverInfo.trustedConnection; Connect = ServerInfo.dbConnect; if (language == "FRE") { atriumBE.Properties.Resources.Culture = new System.Globalization.CultureInfo("fr-CA"); this.myLanguage = language; } //WindowsFormsApplicationBase creates a talk-back channel if (!UseService) { if (UsingRemote) { //start proxy if (ServerInfo.useProxy) { StartProxy(ServerInfo, user, fwPassword); } DALMngr = (atriumDAL.atriumDALManager)RemoteDAL(nc.UserName, fwPassword); } else { DALMngr = new atriumDAL.atriumDALManager(nc.UserName, nc.Password, ServerInfo.dbConnect); } myDALClient = new DALClient(this); } //atSecurity.SecurityApp secApp= new atSecurity.SecurityApp(nc, user, ServerInfo.proxyUrl, ServerInfo.useRemote, ServerInfo.dbConnect, fwPassword); //SecurityManager = secApp.SecurityManager; AtMng = new atriumManager(this); StartPulse(); pulse.Elapsed += new System.Timers.ElapsedEventHandler(pulse_Elapsed1); }
public void SetUserCredential(Agent authenticatedUser, string companyName, bool isNewAgentAuthentication = false) { if (isNewAgentAuthentication) { Task.Factory.StartNew(() => { // Order DALOrder.progressBarManagement(ProgressBarFunc); DALOrder.setCompanyName(companyName); DALOrder.initializeCredential(authenticatedUser); DALOrder.cacheWebServiceData(); // Client DALClient.progressBarManagement(ProgressBarFunc); DALClient.setCompanyName(companyName); DALClient.initializeCredential(authenticatedUser); DALClient.cacheWebServiceData(); }); } else { Task.Factory.StartNew(() => { // Order DALOrder.progressBarManagement(ProgressBarFunc); DALOrder.setCompanyName(companyName); DALOrder.initializeCredential(authenticatedUser); DALOrder.cacheWebServiceData(); // Security DALSecurity.setCompanyName(companyName); DALSecurity.initializeCredential(authenticatedUser); // Agent DALAgent.progressBarManagement(ProgressBarFunc); DALAgent.setCompanyName(companyName); DALAgent.initializeCredential(authenticatedUser); DALAgent.cacheWebServiceData(); }).ContinueWith((tsk) => { // Referential DALReferential.progressBarManagement(ProgressBarFunc); DALReferential.setCompanyName(companyName); DALReferential.initializeCredential(authenticatedUser); DALReferential.cacheWebServiceData(); // Notification DALNotification.progressBarManagement(ProgressBarFunc); DALNotification.setCompanyName(companyName); DALNotification.initializeCredential(authenticatedUser); DALNotification.cacheWebServiceData(); // Statistic DALStatistic.progressBarManagement(ProgressBarFunc); DALStatistic.setCompanyName(companyName); DALStatistic.initializeCredential(authenticatedUser); DALStatistic.cacheWebServiceData(); }).ContinueWith((tsk) => { // Item DALItem.progressBarManagement(ProgressBarFunc); DALItem.setCompanyName(companyName); DALItem.initializeCredential(authenticatedUser); DALItem.cacheWebServiceData(); }).ContinueWith((tsk) => { // Client DALClient.progressBarManagement(ProgressBarFunc); DALClient.setCompanyName(companyName); DALClient.initializeCredential(authenticatedUser); DALClient.cacheWebServiceData(); }); } // ChatRoom DALChatRoom.setCompanyName(companyName); DALChatRoom.initializeCredential(authenticatedUser); }
private void cmdSaveUser_Click(object sender, RoutedEventArgs e) { string name; if (txtName.Text == "") { name = null; } else { name = txtName.Text; } string firstname; if (txtFirstname.Text == "") { firstname = null; } else { firstname = txtFirstname.Text; } string email; if (txtEmail.Text == "") { email = null; } else { email = txtEmail.Text; } string login; if (txtLoginUser.Text == "") { login = null; } else { login = txtLoginUser.Text; } string pwd; if (txtPwdUser.Text == "") { pwd = null; } else { pwd = txtPwdUser.Text; } string keyword; if (txtKeyword.Text == "") { keyword = null; } else { keyword = txtKeyword.Text; } mainVM.MyRegistered = new Registered(mainVM.MyForum.User.IdUser, (Status)cmbStatus.SelectedItem, (Training)cmbTraining.SelectedItem, name, firstname, email, login, pwd, keyword); List <ValidationError> lstErreur = mainVM.MyRegistered.Validate(); if (lstErreur.Count < 1) { if (mainVM.MyRegistered.SaveUser(mainVM.MyRegistered, mainVM.MyForum.TokenUser)) { mainVM.MyForum.TokenUser = null; Token token = new Token(0, login, pwd, 0); DALClient dal = new DALClient(); DALWSR_Result r = dal.LoginAsync(token, CancellationToken.None); if (r.Data != null) { token = (Token)r.Data; } else { mainVM.MessagePopup = "Problème de connexion."; ModalPopupError.IsOpen = true; //MessageDialog essai = new MessageDialog("Problème de connexion"); //essai.ShowAsync(); } if (token.Valid != false) { mainVM.MyForum.TokenUser = token; mainVM.MyForum.User = mainVM.MyForum.User.GetInfoUser(token.IdUser); if (mainVM.MyForum.User != null) { mainVM.MyRegistered = mainVM.MyForum.User; mainVM.IsLogged = true; mainVM.InfoUser = false; } else { mainVM.MessagePopup = "Problème de connexion."; ModalPopupError.IsOpen = true; //MessageDialog essai = new MessageDialog("Problème de connexion"); //essai.ShowAsync(); } } else { mainVM.MyForum.TokenUser = null; mainVM.IsLogged = false; mainVM.MessagePopup = "Problème d'authentification, veuillez contacter l'administrateur."; ModalPopupError.IsOpen = true; //MessageDialog essai = new MessageDialog("Problème d'authentification, veuillez contacter l'administrateur"); //essai.ShowAsync(); } } } else { string str = string.Empty; foreach (var item in lstErreur) { str = str + item.Information + Environment.NewLine; } mainVM.MessagePopup = str; ModalPopupError.IsOpen = true; //MessageDialog errorRegister = new MessageDialog(str); //errorRegister.ShowAsync(); } }
// Read public static List <Client> GetClients() { return(DALClient.GetClients()); }
private void cmdLogin_Click(object sender, RoutedEventArgs e) { if (mainVM.MyForum.TokenUser == null) { Token token = new Token(0, txtLogin.Text, txtPwd.Password, 0); DALClient dal = new DALClient(); DALWSR_Result r = dal.LoginAsync(token, CancellationToken.None); if (r.Data != null) { token = (Token)r.Data; } else { mainVM.MessagePopup = "Problème de connexion."; ModalPopupError.IsOpen = true; //MessageDialog essai = new MessageDialog("Problème de connexion"); //essai.ShowAsync(); } if (token.Valid != false) { mainVM.MyForum.TokenUser = token; mainVM.MyForum.User = mainVM.MyForum.User.GetInfoUser(token.IdUser); if (mainVM.MyForum.User != null) { mainVM.MyRegistered = mainVM.MyForum.User; mainVM.IsLogged = true; if (mainVM.MyRegistered.ObjStatus.NameStatus != "Stagiaire") { ShowEditDelete(lstMessage); ShowEditDelete(lstTopic); } } else { mainVM.MessagePopup = "Problème de connexion."; ModalPopupError.IsOpen = true; //MessageDialog essai = new MessageDialog("Problème de connexion"); //essai.ShowAsync(); } } else { mainVM.MyForum.TokenUser = null; mainVM.IsLogged = false; mainVM.MessagePopup = "Login ou mot de passe incorrect."; ModalPopupError.IsOpen = true; //MessageDialog essai = new MessageDialog("Login ou mot de passe incorrect"); //essai.ShowAsync(); } } else { mainVM.MyForum.TokenUser = null; txtLogin.Text = string.Empty; txtPwd.Password = string.Empty; //mainVM.MyForum.User = null; mainVM.MyRegistered = null; mainVM.IsLogged = false; mainVM.InfoUser = false; ShowEditDelete(lstMessage); ShowEditDelete(lstTopic); } }
// Delete public static bool DeleteClient(Client pClient) { return(DALClient.DeleteClient(pClient)); }
// Update public static bool UpdateClient(Client pClient) { return(DALClient.SetClient(pClient)); }
public static bool GetFacturesImpayees(Guid codeClient) { return(DALClient.GetFacturesImpayees(codeClient)); }
public static Client GetClient(Guid IdClient) { return(DALClient.GetClient(IdClient)); }