protected async Task LoadRelAsync() { _cli = null; _dst = null; if (_dsp.dsp_clifor != 0) { try { _cli = await _dbcon.GetAsync <Clienti>(_dsp.dsp_clifor); } catch (System.Exception) { await DisplayAlert("Attenzione", "Cliente non trovato", "OK"); } if (_dsp.dsp_dst != 0) { try { _dst = await _dbcon.GetAsync <Destinazioni>(_dsp.dsp_dst); } catch (System.Exception) { await DisplayAlert("Attenzione", "Destinazione non trovata", "OK"); } } _dsrList = await _dbcon.QueryAsync <ScaPagRow>("SELECT * FROM scapagro WHERE dsr_relaz = ? AND dsr_codice = ?", _dsp.dsp_relaz, _dsp.dsp_codice); } }
protected override void OnInit(EventArgs e) { objSistema = new Sistema(); objClienti = new Clienti(); base.OnInit(e); }
override protected void OnInit(EventArgs e) { InitializeMyComponents(); objUtente = new Utente(); objClienti = new Clienti(); base.OnInit(e); }
public List <Clienti> GetClienti() { List <Clienti> clienti = new List <Clienti>(); try { using (StreamReader sr = new StreamReader(NumeFisier)) { string line; while ((line = sr.ReadLine()) != null) { if (line != "") { Clienti c = new Clienti(line); clienti.Add(c); } } } } catch (IOException eIO) { throw new Exception("Eroare la deschiderea fisierului. Mesaj: " + eIO.Message); } catch (Exception eGen) { throw new Exception("Eroare generica. Mesaj: " + eGen.Message); } return(clienti); }
public static string getDominioMailCliente(int idCliente) { string dominioMail = string.Empty; try { Clienti objClienti = new Clienti(); objClienti.Read(Convert.ToInt32(idCliente), "it"); //Metto it perchè tanto la lingua in questo caso non incide per le informazioni che mi servono if (!objClienti.Cli_dominio_mail.IsNull) { dominioMail = objClienti.Cli_dominio_mail.ToString(); } else { dominioMail = ""; } return(dominioMail); } catch (Exception ex) { return(ex.Message); } }
private void InitializeMyComponents() { this.PreRender += new System.EventHandler(this.frm_MSB_UTE_PreRender); objUtente = new Utente(); objCrossUtenteWorkflow = new CrossUtenteWorkflow(); objCrossUtenteCliente = new CrossUtenteCliente(); objClienti = new Clienti(); GridViewUtenti.DataSourceID = "ObjectDataSourceUtenti"; string[] utentiDataKeys = { "UTE_ID_UTENTE", "UTE_STATO_UTENTE", "ISONLINE" }; GridViewUtenti.DataKeyNames = utentiDataKeys; GridViewUtenti.RowCreated += new GridViewRowEventHandler(GridViewUtenti.MyGridViewRowCreated); GridViewUtenti.RowDataBound += new GridViewRowEventHandler(GridViewUtenti.MyGridViewDataBound); GridViewUtenti.SelectedIndexChanged += new EventHandler(GridViewUtenti_SelectedIndexChanged); GridViewUtenti.PageIndexChanged += new EventHandler(GridViewUtenti_PageIndexChanged); GridViewUtenti.RowCommand += new GridViewCommandEventHandler(GridViewUtenti_RowCommand); GridViewUtenti.DataBound += new EventHandler(GridViewUtenti_DataBound); ObjectDataSourceUtenti.TypeName = "SDG.GestioneUtenti.Utente"; ObjectDataSourceUtenti.SelectMethod = "List"; ObjectDataSourceUtenti.ObjectCreated += new ObjectDataSourceObjectEventHandler(ObjectDataSourceUtenti_SetProperties); ObjectDataSourceUtenti.Selected += new ObjectDataSourceStatusEventHandler(ObjectDataSourceUtenti_Selected); ButtonExportUtenti.Click += new EventHandler(ButtonExportUtenti_Click); //DropDownList DropDownListRecordPagina.Items.Insert(0, new ListItem("5", "5")); DropDownListRecordPagina.Items.Insert(1, new ListItem("10", "10")); DropDownListRecordPagina.Items.Insert(2, new ListItem("15", "15")); DropDownListRecordPagina.Items.Insert(3, new ListItem("25", "25")); DropDownListRecordPagina.Items.Insert(4, new ListItem("35", "35")); DropDownListRecordPagina.Items.Insert(5, new ListItem("75", "75")); DropDownListRecordPagina.Items.Insert(6, new ListItem("100", "100")); }
// UPDATE public static bool UpdateCliente(Clienti c) { bool ret = false; StringBuilder sql = new StringBuilder(); try { sql.AppendLine($"UPDATE TblClienti"); sql.AppendLine($"SET IdAmministratore = @IdAmministratore,"); sql.AppendLine($"RagSocCli = @RagSocCli,"); sql.AppendLine($"Indirizzo = @Indirizzo,"); sql.AppendLine($"cap = @cap,"); sql.AppendLine($"Città = @Città,"); sql.AppendLine($"Tel1 = @Tel1,"); sql.AppendLine($"Cell1 = @Cell1,"); sql.AppendLine($"PartitaIva = @PartitaIva,"); sql.AppendLine($"CodFiscale = @CodFiscale,"); sql.AppendLine($"Data = CONVERT(date,@Data),"); sql.AppendLine($"Provincia = @Provincia,"); sql.AppendLine($"Note = @Note"); sql.AppendLine($"WHERE IdCliente = @IdCliente"); using (SqlConnection cn = GetConnection()) { ret = cn.Execute(sql.ToString(), c) > 0; } } catch (Exception ex) { throw new Exception("Errore durante l'update di un cliente", ex); } return(ret); }
private void btnDelete_Click(object sender, EventArgs e) { if (lvClienti.SelectedItems.Count == 0) { MessageBox.Show("Alege un Client !"); return; } if (MessageBox.Show( "Esti sigur ca vrei sa stergi clientul ?", "Delete client", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes) { try { ListViewItem listViewItem = lvClienti.SelectedItems[0]; Clienti clienti = (Clienti)listViewItem.Tag; _clienti.Remove(clienti); //DeleteClienti(clienti); DisplayClienti(); } catch (Exception ex) { MessageBox.Show(ex.Message); } } }
public FatturaOrdinariaDataProviderWithSqlCommands(int FatturaId) { _cliente = new DB.Clienti(); _fattura = new DB.Documclienti(); _prestazioni = new List <DB.Prestazioni>(); _servizi = new List <DB.Servizi>(); string query = GetQuery(FatturaId); DataTable dt = new DataTable(); Load_DataTable(query, ref dt); if (dt.Rows.Count > 0) { MapFromDataRow <DB.Clienti>(_cliente, dt.Rows[0]); MapFromDataRow <DB.Documclienti>(_fattura, dt.Rows[0]); _prestazioni = MapFromDataTable <DB.Prestazioni>(new DB.Prestazioni(), dt); //_servizi = MapFromDataTable<DB.Servizi>(new DB.Servizi(), dt); _servizi = MapServiziFromDataTable(dt); } else { throw new Exception("Non è stato possibile creare la fattura, dati sul DB mancanti"); } SetRigheFattura(); }
// GET: api/Clienti/5 public Clienti Get(int id) { Clienti client = new Clienti(); //return "Un client"; return(client); }
/// <summary> /// Renderizza il footer comune a tutte le pagine. /// </summary> /// <returns></returns> public string renderFooter() { StringBuilder sb = new StringBuilder(); sb.Append("<div class='footerSDG'>© SDG " + DateTime.Today.Year + "</div>"); #region Logo Utente objUtente = new Utente(); Clienti objClienti = new Clienti(); int versione = 0; objUtente.Ute_id_utente = Convert.ToInt32(Session["UTE_ID_UTENTE"]); objUtente.Read(); objClienti.Read(objUtente.Cli_id_cliente.ToSqlInt16(), "it"); versione = objClienti.Cli_versione_reporting.Value; if (!objClienti.Cli_logo_cliente.IsNull && objClienti.Cli_logo_cliente.ToString() != "" && !isMobile()) { sb.Append("<div class='footerCliente'><img src='../Images/Loghi/" + objClienti.Cli_logo_cliente.ToString() + "' alt='" + objClienti.Cli_ragione_sociale.ToString() + "' /></div>"); } #endregion return(sb.ToString()); }
private void btnAdauga_Click(object sender, EventArgs e) { lblInfo.Visible = false; // Set default BackColor for all labels SetLblColor(); if (validare()) { // Add a new client if the data is valid Clienti client = new Clienti(); client.Nume = txtNume.Text; client.Prenume = txtPrenume.Text; client.NumarTelefon = txtNrTel.Text; client.Adresa = txtAdresa.Text; client.Cnp = txtCnp.Text; client.NrMasinaInc = cmbNrMasina.Text; client.dataInchiriere = dtpStartInc.Value; client.dataSfarsitInc = dtpSfarsitInc.Value; // Add a new client in the file adminClienti.AddClient(client); lblInfo.Text = "Clientul a fost adaugat"; lblInfo.Visible = true; // Reset all input text ResetareControale(); } }
protected async Task LoadRel() { _cli = null; _dst = null; if (_parent.doc.fat_inte != 0) { try { _cli = await _dbcon.GetAsync <Clienti>(_parent.doc.fat_inte); } catch (System.Exception) { await DisplayAlert("Attenzione", "Cliente non trovato", "OK"); } if (_parent.doc.fat_dest != 0) { try { _dst = await _dbcon.GetAsync <Destinazioni>(_parent.doc.fat_dest); } catch (System.Exception) { await DisplayAlert("Attenzione", "Destinazione non trovata", "OK"); } } } }
protected void Page_Load(object sender, EventArgs e) { PanelUpload.Visible = true; SetPageControlAccess(); BaseEnableControls(Page.Controls, allowEdit); if (!IsPostBack) { LabelTitolo.InnerText = GetValueDizionarioUI("IMPERSONATE"); LabelCliente.InnerText = GetValueDizionarioUI("CLIENTE"); LabelUtente.InnerText = GetValueDizionarioUI("UTENTE"); //Se sono amministratore posso filtrare per tutti i clienti, altrimenti filtro solo per il cliente di appartenenza if (dizionarioPermessi["ADM"] < objUtilita.AccessDelete) { whereClause = " WHERE CLI_ID_CLIENTE = " + Convert.ToInt32(Session["CLI_ID_CLIENTE"].ToString()); txtCliente.Enabled = false; } Clienti objClienti = new Clienti(); txtCliente.DataSource = objClienti.getDdlClienti(whereClause); txtCliente.DataValueField = "CLI_ID_CLIENTE"; txtCliente.DataTextField = "CLI_RAGIONE_SOCIALE"; txtCliente.DataBind(); txtCliente.SelectedIndex = 0; txtCliente_SelectedIndexChanged(null, null); } string js_msgCLIENTE = "var msgCLIENTE = '" + GetValueDizionarioUI("ERR_MSG_CAMPO_OBBLIGATORIO") + "'; "; Page.ClientScript.RegisterStartupScript(this.GetType(), "msgCLIENTE", js_msgCLIENTE, true); }
public Clienti GetClient(string CNP) { try { using (StreamReader sr = new StreamReader(NumeFisier)) { string line; while ((line = sr.ReadLine()) != null) { Clienti c = new Clienti(line); if (c.Cnp == CNP) { return(c); } } } } catch (IOException eIO) { throw new Exception("Eroare la deschiderea fisierului. Mesaj: " + eIO.Message); } catch (Exception eGen) { throw new Exception("Eroare generica. Mesaj: " + eGen.Message); } return(null); }
public bool UpdateClient(Clienti ClientActualizat) { List <Clienti> clienti = GetClienti(); bool actualizareCuSucces = false; try { using (StreamWriter swFisierText = new StreamWriter(NumeFisier, false)) { foreach (Clienti c in clienti) { if (c.IdClient != ClientActualizat.IdClient) { swFisierText.WriteLine(c.ConversieLaSir(DELIMITER)); } else { swFisierText.WriteLine(ClientActualizat.ConversieLaSir(DELIMITER)); } } actualizareCuSucces = true; } } catch (IOException eIO) { throw new Exception("Eroare la deschiderea fisierului. Mesaj: " + eIO.Message); } catch (Exception eGen) { throw new Exception("Eroare generica. Mesaj: " + eGen.Message); } return(actualizareCuSucces); }
private int GetId() { int IdClient = ID_PRIMUL_CLIENT; try { using (StreamReader sr = new StreamReader(NumeFisier)) { string line; while ((line = sr.ReadLine()) != null) { Clienti c = new Clienti(line); IdClient = c.IdClient + INCREMENT; } } } catch (IOException eIO) { throw new Exception("Eroare la deschiderea fisierului. Mesaj: " + eIO.Message); } catch (Exception eGen) { throw new Exception("Eroare generica. Mesaj: " + eGen.Message); } return(IdClient); }
public Clienti GetClientByIndex(int index) { try { int contor = 0; using (StreamReader sr = new StreamReader(NumeFisier)) { string line; while ((line = sr.ReadLine()) != null) { if (line == "") { continue; } Clienti c = new Clienti(line); if (contor == index) { return(c); } contor++; } } } catch (IOException eIO) { throw new Exception("Eroare la deschiderea fisierului. Mesaj: " + eIO.Message); } catch (Exception eGen) { throw new Exception("Eroare generica. Mesaj: " + eGen.Message); } return(null); }
private void btnCauta_Click(object sender, EventArgs e) { // Search for a client lblInfo.Visible = false; Clienti c = adminClienti.GetClient(txtCnp.Text); if (c == null) { lblInfo.Text = "Nu exista nici un client cu acest CNP"; lblInfo.Visible = true; } else { // Set client data to all imput fields FileToFormData(c); if (txtCnp.Enabled == true) { txtCnp.Enabled = false; } else { txtCnp.Enabled = true; } } }
async void OnClientiClicked(object sender, System.EventArgs e) { var page = new ClientiSearch(); page.CliList.ItemDoubleTapped += async(source, args) => { var cli = (Clienti)args.ItemData; m_cli_cod.Text = cli.cli_codice.ToString(); m_cli_des.Text = cli.cli_desc; await Navigation.PopAsync(); if ((_cli == null) || (_cli.cli_codice != cli.cli_codice)) { m_dst_cod.Text = ""; m_dst_des.Text = ""; _cli = cli; _dst = null; dataGrid.IsBusy = true; string sql = String.Format("SELECT sca_id, sca_data, sca_importo, (sca_importo * 0) AS sca_incasso, sca_fattura, sca_tot_fat, sca_desc, sca_locked FROM scadenze WHERE sca_relaz = 0 AND sca_pagato = 0 AND sca_cli_for = {0} ORDER BY sca_data, sca_num", cli.cli_codice); var scaList = await _dbcon.QueryAsync <IncassiInfo>(sql); var scaCollection = new ObservableCollection <IncassiInfo>(scaList); dataGrid.ItemsSource = scaCollection; dataGrid.IsBusy = false; } _cli_changed = false; _dst_changed = false; }; await Navigation.PushAsync(page); }
public async Task <IActionResult> Edit(int id, [Bind("IdClient,Nume,Adresa,Contact")] Clienti clienti) { if (id != clienti.IdClient) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(clienti); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ClientiExists(clienti.IdClient)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(clienti)); }
async void OnCliCodUnfocused(object sender, Xamarin.Forms.FocusEventArgs e) { GetField(); _cli = null; _dst = null; if (_parent.doc.fat_inte != 0) { try { _cli = await _dbcon.GetAsync <Clienti>(_parent.doc.fat_inte); if (_parent.doc.fat_tipo_ven == (short)DocTipoVen.VEN_TRASFERT) { _parent.doc.fat_listino = _cli.cli_listino_tra; } else { _parent.doc.fat_listino = _cli.cli_listino; } _parent.doc.fat_pag = _cli.cli_pag; if (_parent.doc.fat_tipo != (short)DocTipo.TIPO_FAT && _parent.doc.fat_tipo != (short)DocTipo.TIPO_ORD && _parent.doc.fat_tipo != (short)DocTipo.TIPO_PRE && _parent.doc.fat_tipo != (short)DocTipo.TIPO_BUO) { _parent.doc.fat_rag = _cli.cli_ragg; } _parent.doc.fat_spese = _cli.cli_spese; _parent.doc.fat_bolli = _cli.cli_bolli; _parent.doc.fat_iva_cli = _cli.cli_iva; _parent.doc.fat_ban = _cli.cli_ban; } catch (System.Exception ex) { System.Diagnostics.Debug.WriteLine(ex.Message); } if (_parent.doc.fat_dest != 0) { try { _dst = await _dbcon.GetAsync <Destinazioni>(_parent.doc.fat_dest); if (_dst.dst_cli_for != _cli.cli_codice || _dst.dst_rel != 0) { _dst = null; } } catch (System.Exception ex) { System.Diagnostics.Debug.WriteLine(ex.Message); } } } if (_cli == null) { _parent.doc.fat_inte = 0; } if (_dst == null) { _parent.doc.fat_dest = 0; } SetField(); }
private void ValidCommandHandler(object sender, ExecutedRoutedEventArgs e) { var request = conturiViewSource.View.CurrentItem as Conturi_Requests; //creez client nou Clienti client = new Clienti { Nume = request.Nume, Prenume = request.Prenume, CNP = request.CNP, Adresa = request.Adresa }; context.Clientis.Add(client); context.SaveChanges(); var codClient = (from c in context.Clientis where c.CNP == client.CNP select c.CodClient).FirstOrDefault(); //creez card nou Carduri card = new Carduri { Numar = RandomCreate.Instance.CreateDigitString(16), CVV = RandomCreate.Instance.CreateDigitString(3) }; context.Carduris.Add(card); context.SaveChanges(); var codCardNou = (from c in context.Carduris where c.Numar == card.Numar select c.CodCard).FirstOrDefault(); Conturi cont = new Conturi { IBAN = "RO24RNCB" + RandomCreate.Instance.CreateDigitString(16), Client = codClient, Sold = 0, CodCard = codCardNou }; context.Conturis.Add(cont); context.SaveChanges(); MessageBox.Show("Cont,client si card adaugate cu succes"); //sterg intrarea din Conturi_Requests var query_stergere = (from c in context.Conturi_Requests where c.CodConturiRequest == request.CodConturiRequest select c).FirstOrDefault(); context.Conturi_Requests.Remove(query_stergere); context.SaveChanges(); initializeCollectionView(); initializeBoxes(); }
protected override void OnInit(EventArgs e) { InitializeMyComponents(); objSistema = new Sistema(); objClienti = new Clienti(); base.OnInit(e); }
public ActionResult DeleteConfirmed(int id) { Clienti clienti = db.Clienti.Find(id); db.Clienti.Remove(clienti); db.SaveChanges(); return(RedirectToAction("Index")); }
public Incassi(Clienti cli, Destinazioni dst) { _dbcon = DependencyService.Get <ISQLiteDb>().GetConnection(); _cli = cli; _dst = dst; _on_edit = false; InitializeComponent(); if (Device.Idiom != TargetIdiom.Phone) { m_cli_cod.WidthRequest = 110; m_dst_cod.WidthRequest = 110; } m_cli_cod.Text = _cli != null?_cli.cli_codice.ToString() : ""; m_cli_des.Text = _cli != null ? _cli.cli_desc : ""; m_dst_cod.Text = _dst != null?_dst.dst_codice.ToString() : ""; m_dst_des.Text = _dst != null ? _dst.dst_desc : ""; GridTableSummaryRow summaryRow1 = new GridTableSummaryRow(); summaryRow1.Title = "Totale da Incassare {Totale} - Incasso : {Incasso}"; summaryRow1.ShowSummaryInRow = true; summaryRow1.Position = Position.Bottom; summaryRow1.SummaryColumns.Add(new GridSummaryColumn() { Name = "Totale", MappingName = "sca_importo", Format = "{Sum:c}", SummaryType = SummaryType.DoubleAggregate }); summaryRow1.SummaryColumns.Add(new GridSummaryColumn() { Name = "Incasso", MappingName = "sca_incasso", Format = "{Sum:c}", SummaryType = SummaryType.DoubleAggregate }); dataGrid.TableSummaryRows.Add(summaryRow1); dataGrid.LiveDataUpdateMode = LiveDataUpdateMode.AllowSummaryUpdate; /* * dataGrid.AllowEditing = true; * GridNumericColumn column = new GridNumericColumn(); * column.MappingName = "Incasso"; * column.AllowEditing = true; * dataGrid.EditTapAction = TapAction.OnTap; */ _cli_changed = false; _dst_changed = false; }
override protected void OnInit(EventArgs e) { InitializeMyComponents(); objUtente = new Utente(); objClienti = new Clienti(); objRuoli = new Ruoli(); objUtente.getAcronimoInstallazioneUtente(Convert.ToInt32(Session["UTE_ID_UTENTE"].ToString())); Session["ACRONIMO_INSTALLAZIONE"] = objUtente.Tpi_acronimo.ToString(); base.OnInit(e); }
public ActionResult Edit([Bind(Include = "ID,Codice,RagioneSociale,CAP,Comune,Provincia,Via,Tel1,Mail1,Tel2,Mail2,PIVA,Fax,GiorniPagamento,IsActive")] Clienti clienti) { if (ModelState.IsValid) { db.Entry(clienti).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(clienti)); }
public void DeleteClient(Guid id) { Clienti clientDb = dbContext.Clientis.FirstOrDefault(x => x.IdClient == id); if (clientDb != null) { dbContext.Clientis.DeleteOnSubmit(clientDb); dbContext.SubmitChanges(); } }
protected void Page_Load(object sender, EventArgs e) { //Ripresa parametri di pagina qMODALITA = Request.QueryString["MODALITA"]; SetPageControlAccess(); //Set controlli per i permessi //Prima di effettuare eventuali disabilitazioni di altro genere BaseEnableControls(Page.Controls, allowEdit); if (!IsPostBack) { LabelTitolo.InnerText = GetValueDizionarioUI("DETTAGLIO"); LabelFile.InnerText = GetValueDizionarioUI("SELEZ_FILE"); LabelCliente.InnerText = GetValueDizionarioUI("CLIENTE"); ButtonSalva.Text = GetValueDizionarioUI("CARICA"); ButtonAnnulla.Text = GetValueDizionarioUI("USCITA"); // Cliente - se diverso da Admin la tendina visualizza solo il proprio cliente string whereClause = ""; if (Convert.ToInt32(Session["UTE_ID_UTENTE"]) != 1) { Clienti objClienti = new Clienti(); objClienti.RicavaClienteUtente(Convert.ToInt32(Session["UTE_ID_UTENTE"])); whereClause = " WHERE CLI_ID_CLIENTE = " + objClienti.Cli_id_cliente; } txtCliente.DataSource = objClienti.getDdlClienti(whereClause); txtCliente.DataValueField = "CLI_ID_CLIENTE"; txtCliente.DataTextField = "CLI_RAGIONE_SOCIALE"; txtCliente.DataBind(); txtCliente.SelectedIndex = 0; } // Campi read-only string js_msgFILE = "var msgFILE = '" + GetValueDizionarioUI("ERR_MSG_CAMPO_OBBLIGATORIO") + "'; "; Page.ClientScript.RegisterStartupScript(this.GetType(), "msgFILE", js_msgFILE, true); string js_msgFILE_EXT = "var msgFILE_EXT = '" + GetValueDizionarioUI("ERR_MSG_FILE_EXT_TXT") + "'; "; Page.ClientScript.RegisterStartupScript(this.GetType(), "msgFILE_EXT", js_msgFILE_EXT, true); string js_msgCLIENTE = "var msgCLIENTE = '" + GetValueDizionarioUI("ERR_MSG_CAMPO_OBBLIGATORIO") + "'; "; Page.ClientScript.RegisterStartupScript(this.GetType(), "msgCLIENTE", js_msgCLIENTE, true); if (!this.ClientScript.IsStartupScriptRegistered("ButtonAnnulla_Js")) { this.ClientScript.RegisterStartupScript(GetType(), "ButtonAnnulla_Js", this.ButtonAnnulla_Js()); } }