protected void rdcbTaxType_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e) { // load tax percentage if (rdcbTaxType.SelectedValue != "") { taxTypeId = Int32.Parse(rdcbTaxType.SelectedValue); taxt = CntAriCli.GetTaxType(taxTypeId, ctx); txtTaxPercentage.Text = String.Format("{0:##0.00}", taxt.Percentage); } }
protected void LoadTicketData(Ticket tck) { taxt = tck.InsuranceService.Service.TaxType; LoadTaxTypeCombo(taxt); txtDescription.Text = tck.Description; txtTaxPercentage.Text = taxt.Percentage.ToString(); txtAmount.Text = tck.Amount.ToString(); }
protected void LoadTaxTypeCombo(TaxType taxt) { // clear previous items rdcbTaxType.Items.Clear(); foreach (TaxType t in ctx.TaxTypes) { rdcbTaxType.Items.Add(new RadComboBoxItem(t.Name, t.TaxTypeId.ToString())); } if (taxt != null) { rdcbTaxType.SelectedValue = taxt.TaxTypeId.ToString(); } else { rdcbTaxType.Items.Add(new RadComboBoxItem(" ", "")); rdcbTaxType.SelectedValue = ""; } }
protected void LoadData(ProfessionalInvoiceLine invl) { txtInvoiceLineId.Text = invl.InvoiceLineId.ToString(); inv = invl.ProfessionalInvoice; taxt = invl.TaxType; LoadInvoiceData(); //tck = invl.Ticket; //if (tck != null) //{ // txtTicketId.Text = tck.TicketId.ToString(); // txtTicketData.Text = String.Format("{0} ({1}: {2:###,##0.00})" // , tck.Policy.Customer.FullName // , tck.Description // , tck.Amount); //} LoadTaxTypeCombo(taxt); txtDescription.Text = invl.Description; txtTaxPercentage.Text = String.Format("{0:##0.00}", invl.TaxPercentage); txtAmount.Text = String.Format("{0:###,##0.00}", invl.Amount); }
/// <summary> /// Importa los tipos de IVA /// </summary> /// <param name="con"></param> /// <param name="ctx"></param> public static void ImportTaxTypes(OleDbConnection con, AriClinicContext ctx) { // (0) Borra tipos previos ctx.Delete(ctx.TaxTypes); ctx.SaveChanges(); // (1) Dar de alta los tipos de IVA importados. string sql = "SELECT * FROM TiposIva"; cmd = new OleDbCommand(sql, con); da = new OleDbDataAdapter(cmd); DataSet ds = new DataSet(); da.Fill(ds, "ConTiposIVA"); int nreg = ds.Tables["ConTiposIVA"].Rows.Count; int reg = 0; TaxType tt = null; foreach (DataRow dr in ds.Tables["ConTiposIVA"].Rows) { DataRow localDr = dr; reg++; Console.WriteLine("Tipos IVA {0:#####0} de {1:#####0} {2}", reg, nreg, (string)localDr["NomTipoIva"]); tt = (from ti in ctx.TaxTypes where ti.OftId == (int)localDr["IdTipoIVA"] select ti).FirstOrDefault<TaxType>(); if (tt == null) { tt = new TaxType(); ctx.Add(tt); } tt.Name = (string)localDr["NomTipoIva"]; Single p = (Single)localDr["Porcentaje"]; tt.Percentage = decimal.Parse(p.ToString()); tt.OftId = (int)localDr["IdTipoIva"]; } ctx.SaveChanges(); }
/// <summary> /// Importa los tipos de IVA /// </summary> /// <param name="con"></param> /// <param name="ctx"></param> public static void ImportTaxTypes(OleDbConnection con, AriClinicContext ctx) { // (0) Borra tipos previos ctx.Delete(ctx.TaxTypes); // (1) Dar de alta los tipos de IVA importados. string sql = "SELECT * FROM TiposIva"; cmd = new OleDbCommand(sql, con); da = new OleDbDataAdapter(cmd); DataSet ds = new DataSet(); da.Fill(ds, "ConTiposIVA"); int nreg = ds.Tables["ConTiposIVA"].Rows.Count; int reg = 0; foreach (DataRow dr in ds.Tables["ConTiposIVA"].Rows) { reg++; TaxType tt = new TaxType(); tt.Name = (string)dr["NomTipoIva"]; Single p = (Single)dr["Porcentaje"]; tt.Percentage = decimal.Parse(p.ToString()); tt.OftId = (int)dr["IdTipoIva"]; ctx.Add(tt); } ctx.SaveChanges(); }