public void OrderSetTotalTest() { const string TOTAL = "25"; _order.Total = TOTAL; Assert.AreEqual(TOTAL.ToString(), _target.GetProperty("Total")); }
private void Grid_Det_Sal_DoubleClick(object sender, EventArgs e) { if (Grid_Det_Sal.CurrentRow.Index != -1) { TOTAL = double.Parse(txtimporte.Text) - double.Parse(Grid_Det_Sal.CurrentRow.Cells[4].Value.ToString()); txtimporte.Text = TOTAL.ToString(); Grid_Det_Sal.Rows.RemoveAt(Grid_Det_Sal.CurrentRow.Index); } }
protected void btnPagar_Click(object sender, ImageClickEventArgs e) { string validar = Session["Registrar"].ToString(); if (validar == "SI") { if (lblsaldpend.Text == "0") { lblmensaje.Text = "no exite saldo pendiente"; lblmensaje.Visible = true; this.lblmensaje.ForeColor = System.Drawing.Color.Green; lblmensaje.Visible = true; } else { // cambio las comas por puntos string maskValores = "###########.##"; string formateado = Convert.ToDecimal(txtmontpaga.Text).ToString(maskValores, CultureInfo.GetCultureInfo("en-US")); //comienza el registro del pago SqlConnection Conn = new SqlConnection { ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["GESTION.Properties.Settings.CadenadeConeccion"].ToString() }; SqlCommand cmd = new SqlCommand(); SqlDataReader dr; Conn.Open(); DateTime Hoy = DateTime.Today; cmd.Connection = Conn; cmd.CommandText = "INSERT INTO Pagos_Facturas(User_Pago,Fecha_Pago,Banco,Monto_Pago,Detalle_Pago,NInvoice)VALUES('" + Session["Usuario"] + "','" + Hoy.ToString("yyyy-MM-dd") + "','" + ddlbanco.SelectedValue + "','" + formateado + "','" + txtdetallep.Text + "','" + lblninvoice.Text + "')"; dr = cmd.ExecuteReader(); dr.Read(); // si el saldo es 0 cambiar al estado pagado Deuda(); Pagos(); //aqui se calcula el saldo pendiente double TOTAL; TOTAL = Convert.ToDouble(lbltotdeuda.Text) - Convert.ToDouble(lblmontpag.Text); lblsaldpend.Text = TOTAL.ToString(); txtmontpaga.Text = lblsaldpend.Text; if (lblsaldpend.Text == "0") { txtmontpaga.Enabled = false; btnPagar.Enabled = false; cambiar_estado(); } // falta programar envio de correo aqui informando el pago } } else { lblmensaje.Text = "No Posee Permisos , Contacte al administrador"; this.lblmensaje.ForeColor = System.Drawing.Color.Red; lblmensaje.Visible = true; } }
public virtual Protocol createLayer(ProtocolStack prot_stack) { if (protocol_name == null) { return(null); } Protocol protocol = null; switch (protocol_name) { case "TCP": protocol = new TCP(); break; case "TCPPING": protocol = new TCPPING(); break; case "QUEUE": protocol = new QUEUE(); break; case "TOTAL": protocol = new TOTAL(); break; case "VIEW_ENFORCER": protocol = new VIEW_ENFORCER(); break; case "pbcast.GMS": protocol = new GMS(); break; } if (protocol != null) { prot_stack.NCacheLog.Info("Configurator.createLayer()", "Created Layer " + protocol.GetType().FullName); protocol.Stack = prot_stack; if (properties != null) { if (!protocol.setPropertiesInternal(properties)) { return(null); } } protocol.init(); } else { prot_stack.NCacheLog.Error("Configurator.createLayer()", "Couldn't create layer: " + protocol_name); } return(protocol); }
public string suma_costos() { string resp = ""; TOTAL = 0; for (int fila = 0; fila < Grid_Det_Sal.Rows.Count - 1; fila++) { TOTAL = TOTAL + double.Parse(Grid_Det_Sal.Rows[fila].Cells[4].Value.ToString()); } resp = TOTAL.ToString(); return(resp); }
static void Main(string[] args) { string nome; double SalarioFixo, TotalVendas, TOTAL; nome = Console.ReadLine(); SalarioFixo = double.Parse(Console.ReadLine()); TotalVendas = double.Parse(Console.ReadLine()); TOTAL = SalarioFixo + (TotalVendas * 0.15); Console.WriteLine("TOTAL = R$ " + TOTAL.ToString("F2")); }
static void Main(string[] args) { string nome; double salarioFixo, totalVendas, TOTAL; nome = (Console.ReadLine()); salarioFixo = double.Parse(Console.ReadLine()); totalVendas = double.Parse(Console.ReadLine()); TOTAL = (salarioFixo + ((totalVendas * 15) / 100)); Console.WriteLine("TOTAL = " + TOTAL.ToString("F2")); Console.ReadLine(); }
private void bt_agregar_Click(object sender, EventArgs e) { if (validar() == 0 && validar_sal() == 0) { return; } panel2.Enabled = false; Grid_Det_Sal.Rows.Insert(r, txtid.Text, txtnombre.Text, txtcantidad.Text, txtprecio.Text, txtcosto.Text, txtmarca.Text, txtrequisicion.Text, txtcaducidad.Text); r = r + 1; TOTAL = double.Parse(txtimporte.Text) + double.Parse(txtcosto.Text); txtimporte.Text = TOTAL.ToString(); limpiar(); cargar_det(); txtid.Focus(); }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { lblID.Text = Session["IDINVOICE"].ToString(); SqlConnection Conn = new SqlConnection { ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["GESTION.Properties.Settings.CadenadeConeccion"].ToString() }; SqlCommand cmd = new SqlCommand(); SqlDataReader dr; Conn.Open(); cmd.Connection = Conn; cmd.CommandText = "SELECT id_factura,empresa,agente,ninvoice,FINVOICE,nnc,vnc,fnc,linkpdf,moneda,tc,condicion,observ,detalle,usuario,fechaingreso,estado,fechapago FROM Facturas2 with(nolock) where id_factura ='" + lblID.Text + "'"; dr = cmd.ExecuteReader(); dr.Read(); lblninvoice.Text = dr["ninvoice"].ToString(); lblempresa.Text = dr["empresa"].ToString(); lblagente.Text = dr["agente"].ToString(); Session["montoNC"] = dr["vnc"].ToString(); Session["NUMInvoice"] = dr["ninvoice"].ToString(); Session["montoTC"] = dr["tc"].ToString(); Session["money"] = dr["moneda"].ToString(); Session["Fecha"] = dr["fechaingreso"].ToString(); Conn.Close(); Deuda(); Pagos(); //aqui se calcula el saldo pendiente double TOTAL; TOTAL = Convert.ToDouble(lbltotdeuda.Text) - Convert.ToDouble(lblmontpag.Text); lblsaldpend.Text = TOTAL.ToString(); txtmontpaga.Text = lblsaldpend.Text; if (lblsaldpend.Text == "0") { this.lblsaldpend.ForeColor = System.Drawing.Color.Green; txtmontpaga.Enabled = false; btnPagar.Enabled = false; } else { this.lblsaldpend.ForeColor = System.Drawing.Color.Red; } repetidos(); } }
static void Main(string[] args) { string NOME; double BONUS, SALARIO, TOTAL; NOME = (Console.ReadLine()); BONUS = double.Parse(Console.ReadLine(), CultureInfo.InvariantCulture); SALARIO = double.Parse(Console.ReadLine(), CultureInfo.InvariantCulture); TOTAL = (SALARIO * 0.15) + BONUS; Console.WriteLine("TOTAL = R$ " + TOTAL.ToString("F2", CultureInfo.InvariantCulture)); Console.ReadLine(); }
private void calcular() { //suma de operaciones double valortotal; valortotal = (Convert.ToDouble(monto0.Text) + Convert.ToDouble(monto1.Text) + Convert.ToDouble(monto2.Text) + Convert.ToDouble(monto3.Text) + Convert.ToDouble(monto4.Text) + Convert.ToDouble(monto5.Text)); txttotalop.Text = valortotal.ToString(); //asignar nc txtvnotac.Text = txtvnc.Text; //total entre op - nc txttneto.Text = (Convert.ToDouble(valortotal.ToString()) - Convert.ToDouble(txtvnc.Text)).ToString(); //total en pesos double TOTAL; TOTAL = Convert.ToDouble(txttneto.Text) * Convert.ToDouble(txttc.Text); CultureInfo elGR1t = CultureInfo.CreateSpecificCulture("el-GR"); Console.WriteLine(TOTAL.ToString("0,0", elGR1t)); txttotal.Text = String.Format(elGR1t, "{0:0,0}", TOTAL); }
public MCastCommand(TOTAL enclosingInstance) { InitBlock(enclosingInstance); }
private void InitBlock(TOTAL enclosingInstance) { this.enclosingInstance = enclosingInstance; }