private void cleanForm() { FormUtils.clearTextbox(textControls()); selectedProfile = null; //btnSaveModify.Text = "Guardar"; chbStatus.Checked = true; }
// GET: Perfiles/Delete/5 public ActionResult Delete(int?id) { Perfile perfile = db.Perfiles.Find(id); db.Perfiles.Remove(perfile); db.SaveChanges(); return(RedirectToAction("Index", new { id = int.Parse(TempData.Peek("id").ToString()) })); }
// GET: Perfiles/Create public ActionResult Create(int sid) { DefaultListMateriales(); Perfile perfil = new Perfile(); perfil.id_subestacion = sid; return(View(perfil)); }
public ActionResult Edit(Perfile perfile) { DefaultListMateriales(); perfile.t2__mm_ = perfile.t3___mm_; perfile.tw__mm_ = perfile.tf__mm_; perfile.Uso_del_perfil = ""; perfile.Tipo_del_perfil = "Angle"; if (ModelState.IsValid) { Repositori.agregarPerfil(perfile); return(RedirectToAction("Index", new { id = int.Parse(TempData.Peek("id").ToString()) })); } return(View(perfile)); }
private void updateData(Perfile currentSection) { Operation <Perfile> operation = profileController.updateRecord(currentSection); if (operation.State) { MessageBox.Show("Perfil actualizado con exito"); loadTable(); cleanForm(); } else { MessageBox.Show(operation.Error); } }
// GET: Perfiles/Edit/5 public ActionResult Edit(int?id) { DefaultListMateriales(); if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Perfile perfile = db.Perfiles.Find(id); if (perfile == null) { return(HttpNotFound()); } return(View(perfile)); }
public ActionResult Create(Perfile perfile) { perfile.t2__mm_ = perfile.t3___mm_; perfile.tw__mm_ = perfile.tf__mm_; perfile.Uso_del_perfil = ""; perfile.Tipo_del_perfil = "Angle"; if (ModelState.IsValid) { db.Perfiles.Add(perfile); db.SaveChanges(); return(RedirectToAction("Index", new { id = int.Parse(TempData.Peek("id").ToString()) })); } DefaultListMateriales(); return(View(perfile)); }
private void saveData() { Perfile tempProfile = new Perfile { nombre = txtName.Text, baja = chbStatus.Checked }; Operation <Perfile> operation = profileController.addRecord(tempProfile); if (operation.State) { MessageBox.Show("Perfil agregado con exito"); loadTable(); cleanForm(); } else { MessageBox.Show(operation.Error); } }
public void initQuery(List <string> Qterms) { Stopwatch stopwatch = Stopwatch.StartNew(); stopwatch = Stopwatch.StartNew(); if (monthA == 1 && monthB == 12) { withM = false; } else { withM = true; } Qterms.Sort(); List <string> Perfile = new List <string>(); int tmp = indexerDic[indexerDic.Keys.First()]; foreach (string str in Qterms) { if (indexerDic.ContainsKey(str)) { if (tmp != indexerDic[str]) { if (Perfile.Count != 0) { Search(Perfile, tmp); } tmp = indexerDic[str]; Perfile = new List <string>(); Perfile.Add(str); } else { Perfile.Add(str); } } } Search(Perfile, tmp); double st = stopwatch.ElapsedMilliseconds; }
private void dgvProfiles_CellClick(object sender, DataGridViewCellEventArgs e) { try { int index = e.RowIndex; if (index >= 0) { selectedProfile = profiles[index]; if (selectedProfile.nombre.Equals("Administrador")) { MessageBox.Show("El perfil de administrador no puede ser modificado"); return; } // btnSaveModify.Text = "Modificar"; fillSelectedData(selectedProfile); } } catch (Exception ex) { FormUtils.defaultErrorMessage(ex); } }
private void fillSelectedData(Perfile currentPerfile) { txtName.Text = currentPerfile.nombre; chbStatus.Checked = currentPerfile.baja; }