public void UpdateClient(int id, string clientName, string clientSurname, string clientCode, string phoneNo, string email, out bool status) { status = true; DAClient dAClient = new DAClient(); DataTable data = dAClient.GetClientList(-1, "", "", "", "", ""); for (int i = 0; i < data.Rows.Count; i++) { if (clientCode == data.Rows[i]["ClientCode"].ToString()) { status = false; return; } } if (status) { dAClient.Update(out status, id, clientName, clientSurname, clientCode, phoneNo, email); } //else // return; //ssssreturn; }
//FILTRU: public DataTable CautaUnClient(string ClientCode) { DAClient cauta = new DAClient(); var result = cauta.ListaSearchById(ClientCode); return(result); }
public string BIUpdateClient(string clientName, string clientSurname, string clientCode, string phoneNo, string email, int clientId, bool ok) { DAClient da = new DAClient(); string info = da.DAUpdateClient(clientName, clientSurname, clientCode, phoneNo, email, clientId, ok); return(info); }
//FILTRU private void LblSearch_Click(object sender, EventArgs e) { BlClient blClient = new BlClient(); DAClient cautaList = new DAClient(); GridViewClients.DataSource = cautaList.ListaSearchById(txtSearch.Text); }
// Adrese: //public ClientAddressModel FindAddress(int ClientIdcareVineDinUI) //{ // DaClientAddress daClientAddress = new DaClientAddress(); // var ListaClientAddress = daClientAddress.dataTableCA(ClientIdcareVineDinUI); //aici sunt toti clientii; // for (int i = 0; i < ListaClientAddress.Rows.Count; i++) // { // if (ListaClientAddress.Rows[i]["ClientId"].ToString() == ClientIdcareVineDinUI.ToString()) //verifica daca ClientId din DA == ClientId din UI, verifica daca randul care contine ClientID are valoarea == ClientId din winUi de la dublu click // { // ClientAddressModel clientaddress = new ClientAddressModel(); // clientaddress.AddressName = ListaClientAddress.Rows[i]["AdressName"].ToString(); // clientaddress.CityName = ListaClientAddress.Rows[i]["CityName"].ToString(); // clientaddress.CountyName = ListaClientAddress.Rows[i]["CountyName"].ToString(); // clientaddress.StreetName = ListaClientAddress.Rows[i]["StreetName"].ToString(); // clientaddress.StreetNo = ListaClientAddress.Rows[i]["StreetNo"].ToString(); // // clientaddress.StreetNo = // return clientaddress; // } // } // return null; //} // modify : public bool SalveazaClienti(string ClientName, int ClientId, string ClientSurname, string ClientCode, string PhoneNo, string Email) { DAClient modificaClienti = new DAClient(); var resultatmodificare = modificaClienti.ModifyClients(ClientName, ClientId, ClientSurname, ClientCode, PhoneNo, Email); //parametrii in ordine dupa metoda din DaClient return(resultatmodificare); }
public string InsertClientBI(string ClientName, string ClientSurname, string ClientCode, string PhoneNo, string Email, out int insertedId) { DAClient DAip = new DAClient(); string info = DAip.InsertClient(ClientName, ClientSurname, ClientCode, PhoneNo, Email, out insertedId); return(info); }
private void Button1_Click(object sender, EventArgs e) { DAClient daclients = new DAClient(); daclients.DeleteClients(ClientId); MessageBox.Show("Clientul a fost sters"); ClientForm clientformC = new ClientForm(); clientformC.Show(); this.Hide(); clientformC.FormClosed += ClientForm_FormClosed; }
private void BtnDelete_Click(object sender, EventArgs e) //sa mut Delete-ul langa gridview { DAClient daclients = new DAClient(); daclients.DeleteClients(ClientId); MessageBox.Show("Clientul a fost sters"); ClientForm clientformC = new ClientForm(); clientformC.Show(); this.Hide(); clientformC.FormClosed += ClientForm_FormClosed; }
private void BtnShowClients_Click(object sender, EventArgs e) { BusinessLogic.BlClient blClient = new BusinessLogic.BlClient(); DAClient clientList = new DAClient(); GridViewClients.DataSource = clientList.ListaSearch(); GridViewClients.Columns["ClientId"].Visible = false; //List<ClientModel> ListClientA = new List<ClientModel>(); //ListClientA = blClient.clientModels(); // GridViewClients.Columns["ClientName"].HeaderText = "Nume CLient"; }
public List <ClientFullNameModel> GetClientFullName(int clientId) { List <ClientFullNameModel> clients = new List <ClientFullNameModel>(); DAClient client = new DAClient(); DataTable data = client.GetClientFullName(clientId); for (int i = 0; i < data.Rows.Count; i++) { clients.Add(new ClientFullNameModel { ClientId = Convert.ToInt32(data.Rows[i]["ClientId"]), ClientFullName = data.Rows[i]["ClientFullName"].ToString(), }); } return(clients); }
public void OPCConnectAndReadTest() { // connect to local kepware server (UA) OPC.Client client = new UAClient("127.0.0.1", 49320); Assert.IsTrue(client.Connect()); // demand read a value OpcValue value = client.Read("Simulation Examples.Functions.Ramp2", 2); Assert.IsTrue(value.Status.IsGood); // subscribe to a value client.DataChange += Client_DataChange; client.Subscribe("Simulation Examples.Functions.Ramp2", 2); // this format is outdated // wait up to 2 seconds for a DataChanged event Thread.Sleep(2000); // and clean up client.DataChange -= Client_DataChange; client.Dispose(); // now do it again, using OPC DA client = new DAClient("127.0.0.1", "Kepware.KEPServerEX.V6", "{7BC0CC8E-482C-47CA-ABDC-0FE7F9C6E729}"); Assert.IsTrue(client.Connect()); // demand read a value value = client.Read("Simulation Examples.Functions.Ramp2", 2); Assert.IsTrue(value.Status.IsGood); // subscribe to a value client.DataChange += Client_DataChange; //client.Subscribe("Simulation Examples.Functions.Ramp2", 2); this format is outdated // wait up to 2 seconds for a DataChanged event Thread.Sleep(2000); // and clean up client.DataChange -= Client_DataChange; client.Dispose(); }
private List <SimpleFileInfo> GetDirtyAssetFilenames() { List <SimpleFileInfo> assets = null; DAClient client = null; // get new assets try { client = new DAClient(); assets = client.GetAssetsDirty(); } finally { client.Dispose(); } return(assets); }
private List <OxigenIIAdvertising.AppData.Channel> GetDirtyChannelData() { List <OxigenIIAdvertising.AppData.Channel> channels = null; DAClient client = null; // get "dirty channels" try { client = new DAClient(); channels = client.GetChannelsDirty(); } finally { client.Dispose(); } return(channels); }
private void BtnSave_Click(object sender, EventArgs e) { if (String.IsNullOrWhiteSpace(txtClientName.Text)) { MessageBox.Show("Numele nu este completat", "Eroare", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (String.IsNullOrWhiteSpace(txtClientSurname.Text)) { MessageBox.Show("Numele de familie nu este completat", "Eroare", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (String.IsNullOrWhiteSpace(txtClientCode.Text)) { MessageBox.Show("Codul nu este completat", "Eroare", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (String.IsNullOrWhiteSpace(txtClientPhoneNo.Text)) { MessageBox.Show("PhoneNo nu este completat", "Eroare", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (String.IsNullOrWhiteSpace(txtClientEmail.Text)) { MessageBox.Show("Email nu este completata", "Eroare", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } DAClient daClient = new DAClient(); //apelez datele(txt) din winUI, in locul parametrilor AddClients. daClient.AddClients(txtClientName.Text, txtClientSurname.Text, txtClientCode.Text, txtClientEmail.Text, txtClientPhoneNo.Text); MessageBox.Show("S-a salvat"); ClientForm clientformC = new ClientForm(); clientformC.Show(); this.Hide(); clientformC.FormClosed += ClientForm_FormClosed; }
private void MakeChannelsClean(HashSet <int> channelIDs) { DAClient client = null; try { client = new DAClient(); client.EditChannelsMakeClean(channelIDs); } catch (Exception ex) { LogException(_eventLog, ex.ToString()); } finally { if (client != null) { client.Dispose(); } } }
public ClientModel FindClientById(int ClientIdcareVineDinUI) { DAClient daClient = new DAClient(); var ListaClients = daClient.ListaSearch(); //aici sunt toti clientii; for (int i = 0; i < ListaClients.Rows.Count; i++) { if (ListaClients.Rows[i]["ClientId"].ToString() == ClientIdcareVineDinUI.ToString()) //verifica daca ClientId din DA == ClientId din UI, verifica daca randul care contine ClientID are valoarea == ClientId din winUi de la dublu click { ClientModel clientmodel = new ClientModel(); clientmodel.ClientCode = ListaClients.Rows[i]["ClientCode"].ToString(); clientmodel.ClientName = ListaClients.Rows[i]["ClientName"].ToString(); clientmodel.ClientSurname = ListaClients.Rows[i]["ClientSurname"].ToString(); clientmodel.Email = ListaClients.Rows[i]["Email"].ToString(); clientmodel.PhoneNo = ListaClients.Rows[i]["PhoneNo"].ToString(); return(clientmodel); } } return(null); }
public List <ClientModule> GetClientList(int clientId, string clientName, string clientSurname, string clientCode, string phoneNo, string email) { List <ClientModule> clients = new List <ClientModule>(); DAClient dAPartner = new DAClient(); DataTable data = dAPartner.GetClientList(clientId, clientName, clientSurname, clientCode, phoneNo, email); for (int i = 0; i < data.Rows.Count; i++) { clients.Add(new ClientModule { ClientId = Convert.ToInt32(data.Rows[i]["ClientId"]), ClientName = data.Rows[i]["ClientName"].ToString(), ClientSurname = data.Rows[i]["ClientSurname"].ToString(), ClientCode = data.Rows[i]["ClientCode"].ToString(), PhoneNo = data.Rows[i]["PhoneNo"].ToString(), Email = data.Rows[i]["Email"].ToString() }); } return(clients); }
private void MakeAssetsClean(HashSet <int> assetIDs) { DAClient client = null; try { client = new DAClient(); client.EditSlidesMakeClean(assetIDs); } catch (Exception ex) { LogException(_eventLog, ex.ToString()); } finally { if (client != null) { client.Dispose(); } } }
private void btnClick_Click(object sender, EventArgs e) { //UserDataMarshallerClient client = new UserDataMarshallerClient(); //client.Endpoint.Address = new EndpointAddress(@"http://relay-logs-a-1.obs-group.co.uk:81/Userdatamarshaller.svc"); //DateTimeErrorWrapper dt = client.GetCurrentServerTime("password"); //client.Dispose(); try { DAClient client = new DAClient(); DemographicData dg = client.GetUserDemographicData("31350825-4D31-48E3-8AFE-0F32C1D53096_A"); client.Dispose(); MessageBox.Show(dg.SocioEconomicgroup[0]); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
public BindingList <ClientModel> GetClientBi(string ClientName, string ClientSurname, string ClientCode, int?ClientId, int?skip_page, int?take_page) { DAClient dac = new DAClient(); DataTable dt = new DataTable(); dt = dac.GetClients(ClientName, ClientSurname, ClientCode, ClientId, skip_page, take_page); BindingList <ClientModel> list = new BindingList <ClientModel>(); for (int i = 0; i < dt.Rows.Count; i++) { ClientModel client = new ClientModel(); client.ClientId = Convert.ToInt32(dt.Rows[i]["ClientId"].ToString()); client.ClientName = dt.Rows[i]["ClientName"].ToString(); client.ClientSurname = dt.Rows[i]["ClientSurname"].ToString(); client.ClientCode = dt.Rows[i]["ClientCode"].ToString(); client.PhoneNo = dt.Rows[i]["PhoneNo"].ToString(); client.Email = dt.Rows[i]["Email"].ToString(); list.Add(client); } return(list); }
public ClientBLL() { dal = new DAClient(); }
public void DeleteClient(int id) { DAClient dAClient = new DAClient(); dAClient.Delete(id); }
public int BLGetTotalRow(string clientName, string clientSurname, string clientCode) { DAClient da = new DAClient(); return(da.GetTotalRowClient(clientName, clientSurname, clientCode)); }
public string DeleteClient(int selectedId) { DAClient dac = new DAClient(); return(dac.DADeleteClient(selectedId)); }
void softwareVersionInfoTimer_Elapsed(object sender, ElapsedEventArgs e) { int newTimerValue; int softwareVersionInfoFileLimit; int operationTimeout; try { // re-read timer interval if (!int.TryParse(System.Configuration.ConfigurationSettings.AppSettings["softwareVersionInfoTimeout"], out newTimerValue)) { eventLog.WriteEntry("Could not retrieve new timer value for softwareVersionInfoTimer.", EventLogEntryType.Error); return; } // re-read file limit if (!int.TryParse(System.Configuration.ConfigurationSettings.AppSettings["softwareVersionInfoFileLimit"], out softwareVersionInfoFileLimit)) { eventLog.WriteEntry("Could not retrieve new timer value for softwareVersionInfoFileLimit.", EventLogEntryType.Error); return; } if (!int.TryParse(System.Configuration.ConfigurationSettings.AppSettings["operationTimeout"], out operationTimeout)) { eventLog.WriteEntry("Could not retrieve new timer value for softwareVersionInfoTimer.", EventLogEntryType.Error); return; } _softwareVersionInfoTimer.Interval = newTimerValue * 60 * 1000; eventLog.WriteEntry("softwareVersionInfoTimer interval set to " + newTimerValue * 60 * 1000 + " ms.", EventLogEntryType.Information); using (var mdmClient = new MasterDataMarshallerClient()) { mdmClient.InnerChannel.OperationTimeout = TimeSpan.FromMinutes(operationTimeout); // this may take some time depending on the number of rows MachineVersionInfo[] mi = mdmClient.GetMachineVersionInfo(softwareVersionInfoFileLimit); _logger.Debug("Number of Machine Version Info Data retrieved: " + mi.Length); eventLog.WriteEntry("Number of Machine Version Info Data retrieved: " + mi.Length, EventLogEntryType.Information); HashSet <string> machineGUIDSFailedToUpdate = null; _logger.Debug("softwareVersionInfoTimer_Elapsed() Opening DA Client."); using (var daClient = new DAClient()) { daClient.InnerChannel.OperationTimeout = TimeSpan.FromMinutes(operationTimeout); _logger.Debug("softwareVersionInfoTimer_Elapsed() DA Client opened."); machineGUIDSFailedToUpdate = daClient.UpdateSoftwareVersionInfo(mi); _logger.Debug("rows inserted."); } eventLog.WriteEntry(machineGUIDSFailedToUpdate.Count + " files failed to update.", EventLogEntryType.Information); _logger.Debug("Calling DeleteSoftwareInfoFiles()..."); mdmClient.DeleteSoftwareInfoFiles(machineGUIDSFailedToUpdate); _logger.Debug("DeleteSoftwareInfoFiles() returned."); } } catch (Exception ex) { eventLog.WriteEntry(ex.ToString(), EventLogEntryType.Error); } finally { _softwareVersionInfoTimer.Start(); } }