static public IntPtr FindData(int width, int height, LibLoader2 lib, res_table tdata, ImageType tobyte) { IntPtr hImage; IntPtr res = FindData(lib, tdata); IntPtr lr = LoadResource(lib.hModule, res); IntPtr lo = LockResource(lr); using (Mart name = (_isint(tdata._n)) ? new Mart(_i(tdata.name), false) : new Mart(tdata.name, false, true)) { if (tobyte == ImageType.bitmap) { hImage = User32.LoadBitmap(lib.hModule, (IntPtr)name); } else if (tobyte == ImageType.srcbitmap) { //hImage = User32.LoadBitmap(lib.hModule,(IntPtr)name); hImage = LoadImage(lib.hModule, (IntPtr)name, (uint)tobyte, width, height, (uint)iflags.LR_COPYFROMRESOURCE); } else { hImage = LoadImage(lib.hModule, (IntPtr)name, (uint)tobyte, 0, 0, (uint)iflags.LR_VGACOLOR); } } FreeResource(lr); return(hImage); }
private void FrnComprasEmpleados_Load(object sender, EventArgs e) { foreach (var item in Mart.View()) { richTextBox1.Text = item.mostrar(); } }
unsafe static public object get_typ(IntPtr obj, bool istype, bool ucase) { object tobj; RT_STR rd = new RT_STR(); using (Mart _obj = new Mart(obj, false)) { Int32 i32 = obj.ToInt32(); if (_obj.IsIntResource) { if (!istype) { tobj = i32; } else if (rd.ContainsKey(i32)) { tobj = tutil._u(rd[i32], ucase); } else { tobj = obj.ToInt32(); } } else { tobj = (string)_obj.GetStringAnsi().Clone(); } _obj.data = null; } rd.Clear(); rd = null; return(tobj); }
public async Task <IActionResult> Edit(int id, [Bind("MartId,CustomerId")] Mart mart) { if (id != mart.MartId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(mart); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MartExists(mart.MartId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(mart)); }
private void button2_Click(object sender, EventArgs e) { foreach (Producto item in Compras.View()) { Invetario.ModificacionLista(item.Codigo, (item.Unidades) * -1); } if (Validaciones.ValidarEmpleado(this.textBox1.Text.ToString())) { for (int i = 0; i < Mart.View().Count; i++) { if (Mart.View()[i].GetDni == int.Parse(this.textBox1.Text.ToString())) { Mart.View()[i].Setventa(Compras.mostar()); } } } Compras.LimpiarLista(); dataGridView1.DataSource = null; label2.Text = ""; this.RecargarInventario(); if (textBox1.Text != string.Empty && lblTotal.Text != "Gracias por su comprass") { lblTotal.Text = "Gracias por su comprass"; SoundPlayer soundPlayer = new SoundPlayer(@"C:\Users\miguel.landaeta\Downloads\Cash Register Cha Ching-SoundBible.com-184076484.wav"); soundPlayer.Play(); } }
public async Task <IActionResult> Edit(int id, [Bind("Id")] Mart mart) { if (id != mart.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(mart); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MartExists(mart.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction("Index")); } ViewData["Id"] = new SelectList(_context.Customer, "Id", "Id", mart.Id); return(View(mart)); }
public ActionResult DeleteConfirmed(int id) { Mart mart = db.Marts.Find(id); db.Marts.Remove(mart); db.SaveChanges(); return(RedirectToAction("Index")); }
private void button1_Click(object sender, EventArgs e) { int dni; int.TryParse(txtDni.Text.ToString(), out dni); Mart.AddCliente(new Cliente(dni, txtNombre.Text.ToString())); this.txtNombre.Clear(); this.txtDni.Clear(); this.Close(); }
//הוספת עגלה ללקוח חדש שהתחבר public async Task <IActionResult> CreateMart(Customer customer) { Mart m = new Mart(); m.Id = customer.Id; _context.Add(m); await _context.SaveChangesAsync(); return(RedirectToAction("Index", "Home")); }
public ActionResult Edit([Bind(Include = "ProductID,ItemName,ExpiryDate,Amount,Price")] Mart mart) { if (ModelState.IsValid) { db.Entry(mart).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(mart)); }
public ActionResult Create([Bind(Include = "ProductID,ItemName,ExpiryDate,Amount,Price")] Mart mart) { if (ModelState.IsValid) { db.Marts.Add(mart); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(mart)); }
public async Task <IActionResult> Create([Bind("MartId,CustomerId")] Mart mart) { if (ModelState.IsValid) { _context.Add(mart); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(mart)); }
public async Task <IActionResult> Create([Bind("Id")] Mart mart) { if (ModelState.IsValid) { _context.Add(mart); await _context.SaveChangesAsync(); return(RedirectToAction("Index")); } ViewData["Id"] = new SelectList(_context.Customer, "Id", "Id", mart.Id); return(View(mart)); }
private void Reporte_Load(object sender, EventArgs e) { dataGridView1.EnableHeadersVisualStyles = false; dataGridView1.ColumnHeadersDefaultCellStyle.BackColor = Color.Aquamarine; dataGridView1.ColumnHeadersDefaultCellStyle.Font = new System.Drawing.Font("Calibri", 15.75F, System.Drawing.FontStyle.Bold); dataGridView1.DataSource = null; dataGridView1.DataSource = Mart.Reporte(); dataGridView1.RowHeadersVisible = false; //dataGridView3.DataSource = null; //dataGridView3.DataSource = Invetario.View(); }
static public BITMAPFILEHEADER CreateMemory(byte[] bitmap_bytes) { BITMAPFILEHEADER bih = new BITMAPFILEHEADER(); int siz = Marshal.SizeOf(bih); byte[] bits = new byte[siz]; Array.Copy(bitmap_bytes, bits, siz); using (Mart mrt = new Mart(bits)) { bih = (BITMAPFILEHEADER)Marshal.PtrToStructure((IntPtr)mrt, typeof(BITMAPFILEHEADER)); } return(bih); }
// GET: Marts/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Mart mart = db.Marts.Find(id); if (mart == null) { return(HttpNotFound()); } return(View(mart)); }
private void RepoteStock(object sender, EventArgs e) { foreach (Producto item in Invetario.View()) { if (item.Unidades < 10) { Mart.AddReporte(item); } } Reporte frmReporte = new Reporte(); frmReporte.ShowDialog(); }
static public byte[] FindData(LibLoader2 lib, res_table tdata, bool tobyte) { IntPtr res = FindData(lib, tdata); int siz = SizeofResource(lib.hModule, res); byte[] newmemory = new byte[siz]; IntPtr lr = LoadResource(lib.hModule, res); IntPtr lo = LockResource(lr); using (Mart newmem = new Mart(new byte[siz])) { Kernel32.CopyMemory((IntPtr)newmem, lo, siz); newmemory = newmem.GetByteData(siz); } FreeResource(lr); lr = IntPtr.Zero; // Global.cstat(ConsoleColor.Green,"{0}:{1}",(IntPtr)type,nam); return(newmemory); }
private void AgregarProductoInventario(object sender, EventArgs e) { int codigo; float precio; int unidades; if (txtCodigoProducto.Text != string.Empty && txtNombreProducto.Text != string.Empty) { int.TryParse(txtUnidades.Text, out unidades); int.TryParse(txtCodigoProducto.Text, out codigo); float.TryParse(txtPrecioProducto.Text, out precio); Mart.AgregarProductoCategoria(codigo, txtMarcaProducto.Text, txtNombreProducto.Text, precio, unidades, cbCategoria.Text.ToString()); // Invetario.Add(new Producto(codigo, txtMarcaProducto.Text.ToString(), txtNombreProducto.Text.ToString(), precio, unidades)); this.Close(); } else { MessageBox.Show("Es nesesario Completar todos los campos"); } }
private void agregarArticulo(object sender, DataGridViewCellMouseEventArgs e) { int codigo = int.Parse(dataGridView3.Rows[e.RowIndex].Cells["Codigo"].FormattedValue.ToString()); string marca = dataGridView3.Rows[e.RowIndex].Cells["Marca"].FormattedValue.ToString(); string nombre = dataGridView3.Rows[e.RowIndex].Cells["Nombre"].FormattedValue.ToString(); float precio = float.Parse(dataGridView3.Rows[e.RowIndex].Cells["Precio"].FormattedValue.ToString()); if (Validaciones.ValidarCliente(textBox1.Text.ToString()) == "Cliente no registrado" || textBox1.Text.ToString() == "") { MessageBox.Show("Cliente no registrado Ingresar DNI en la casilla o registre el cliente."); } else { label2.Text = Validaciones.ValidarCliente(textBox1.Text.ToString()); if (e.RowIndex >= 0) { if (Invetario.GetUnidades(int.Parse(dataGridView3.Rows[e.RowIndex].Cells["Codigo"].FormattedValue.ToString())) > 0 && Compras.GetUnidades(int.Parse(dataGridView3.Rows[e.RowIndex].Cells["Codigo"].FormattedValue.ToString())) < Invetario.GetUnidades(int.Parse(dataGridView3.Rows[e.RowIndex].Cells["Codigo"].FormattedValue.ToString()))) { if (Compras.Existe(int.Parse(dataGridView3.Rows[e.RowIndex].Cells["Codigo"].FormattedValue.ToString()))) { Compras.ModificacionLista(int.Parse(dataGridView3.Rows[e.RowIndex].Cells["Codigo"].FormattedValue.ToString())); } else { Mart.AgregarProductoCategoriaCompras(codigo, marca, nombre, precio, 1, dataGridView3.Rows[e.RowIndex].Cells["CategoriaP"].FormattedValue.ToString()); // Compras.Add(new Producto(int.Parse(dataGridView3.Rows[e.RowIndex].Cells["Codigo"].FormattedValue.ToString()), dataGridView3.Rows[e.RowIndex].Cells["Marca"].FormattedValue.ToString(), dataGridView3.Rows[e.RowIndex].Cells["Nombre"].FormattedValue.ToString(), float.Parse(dataGridView3.Rows[e.RowIndex].Cells["Precio"].FormattedValue.ToString()), 1)); } this.Caltulo(); } else { MessageBox.Show("Sin stock"); } } } }