private void ULSLogEntriesGridControl_Load(object sender, EventArgs e) { //LogEntriesGrid.SelectionMode = DataGridViewSelectionMode.FullRowSelect; //LogEntriesGrid.MultiSelect = false; control.MouseDoubleClick += LogEntriesGrid_MouseDoubleClick; control.MouseDoubleClick += delegate { System.Data.DataRow row = ((System.Data.DataRowView)control.SelectedItem).Row; List <string> ulsEntry = new List <string>(); foreach (string value in row.ItemArray) { ulsEntry.Add(value); } EntryDetail detailForm = new EntryDetail(new ULSLogEntry(ulsEntry.ToArray())); detailForm.Show(); }; control.SelectionChanged += control_SelectionChanged; }
public ActionResult DeleteConfirmed(int id) { EntryDetail entryDetail = db.EntryDetails.Find(id); db.EntryDetails.Remove(entryDetail); db.SaveChanges(); return(RedirectToAction("Index")); }
public void CreateFullNachaFileMethod() { var achNachaFile = new AchFile(); var listOfBatch = new List <Batch>(); achNachaFile.Header = new FileHeader() { FileCreationDateTime = DateTime.Now, FileIdModifier = "A", ImmediateDestination = "1234567890", ImmediateDestinationName = "ACHDesination", ImmediateOrigin = "123456789", ImmediateOriginName = "LessorCapitalLease", PriorityCode = 1 }; foreach (var CreateBatch in Enumerable.Range(1, 4)) { var batch = new Batch(); batch.Header = new BatchHeader() { ServiceClass = ServiceClassCode.DebitsOnly, OriginatingDfiIdentification = "", CompanyDescriptiveDate = new DateTime(), //settlementdate CompanyDiscreationaryData = "LEASECHG-", CompanyId = "TAXID1123", CompanyName = "ODESSATECH", EffectiveEntryDate = new DateTime(), EntryDescription = "ACH AUTO DEDUCT" }; var listOfEntries = new List <EntryDetail>(); foreach (var CreateEntries in Enumerable.Range(1, 2)) { var entriesRecord = new EntryDetail() { Amount = 100.00M, CheckDigit = '1', DfiAccountNumber = "11231231233567890", IndividualIdentificationNumber = "12321312", IndividualName = "Deep", ReceivingDfiIdentification = "12312345", TraceNumber = "000001", TransactionCode = TransactionCode.CheckingDebit }; listOfEntries.Add(entriesRecord); } batch.Entries = listOfEntries; // batch.Control = BatchControl(batch); no need as auto generate it listOfBatch.Add(batch); } achNachaFile.Batches = listOfBatch; var resultString = achNachaFile.Generate(); }
public ActionResult Edit([Bind(Include = "EntryDetailId,Cantidad,Lote,FechaVence,EntradaId,ProductDetailId")] EntryDetail entryDetail) { if (ModelState.IsValid) { db.Entry(entryDetail).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.EntradaId = new SelectList(db.Entries, "EntradaId", "Aprobado", entryDetail.EntradaId); ViewBag.ProductDetailId = new SelectList(db.ProductDetails, "ProductDetailId", "CodBarras", entryDetail.ProductDetailId); return(View(entryDetail)); }
// GET: EntryDetails/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } EntryDetail entryDetail = db.EntryDetails.Find(id); if (entryDetail == null) { return(HttpNotFound()); } return(View(entryDetail)); }
// GET: EntryDetails/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } EntryDetail entryDetail = db.EntryDetails.Find(id); if (entryDetail == null) { return(HttpNotFound()); } ViewBag.EntradaId = new SelectList(db.Entries, "EntradaId", "Aprobado", entryDetail.EntradaId); ViewBag.ProductDetailId = new SelectList(db.ProductDetails, "ProductDetailId", "CodBarras", entryDetail.ProductDetailId); return(View(entryDetail)); }
public JsonResult Borrar(int ID) { bool Probar = true; string Mensaje = ""; Entry Entradas = db.Entries.Find(ID); if (Entradas == null) { Probar = false; Mensaje = " No se encuentra el registro: "; } else { try { var IdABorrar = (from E in db.EntryDetails where E.EntradaId == ID select E).ToList(); if (IdABorrar != null) { foreach (var detalle in IdABorrar) { EntryDetail EntradaDetalle = db.EntryDetails.Find(detalle.EntryDetailId); db.EntryDetails.Remove(EntradaDetalle); db.SaveChanges(); } } db.Entries.Remove(Entradas); db.SaveChanges(); Mensaje = " Registro eliminado con exito."; } catch (Exception) { Probar = false; Mensaje = " Se produjo un error al borrar el registro."; } } return(Json(new { Probar, Mensaje }, JsonRequestBehavior.AllowGet)); }
private void ULSLogEntriesGridControl_Load(object sender, EventArgs e) { LogEntriesGrid.SelectionMode = DataGridViewSelectionMode.FullRowSelect; LogEntriesGrid.MultiSelect = false; LogEntriesGrid.CellContentDoubleClick += delegate { DataGridViewRow row = LogEntriesGrid.Rows[_logHitTestInfo.RowIndex]; List <string> ulsEntry = new List <string>(); foreach (DataGridViewCell cell in row.Cells) { ulsEntry.Add(cell.Value.ToString()); } EntryDetail detailForm = new EntryDetail(new ULSLogEntry(ulsEntry.ToArray())); detailForm.Show(); }; }
// Access and read items from the Entry iCollection public List <EntryDetail> ConvertDataEntitiesToViewModel(List <Entry> entries) { // instantiate a new List<EntryDetail> List <EntryDetail> returnList = new List <EntryDetail>(); // assign the values from the entity.AllEntries[i] foreach (var entry in entries) { var entryDetail = new EntryDetail(); entryDetail.EntryId = entry.EntryId; entryDetail.EntryTitle = entry.EntryTitle; entryDetail.EntryContent = entry.EntryContent; entryDetail.ForGoal = entry.ForGoal; entryDetail.GoalId = entry.GoalId; entryDetail.CreatedUtc = entry.CreatedUtc; entryDetail.ModifiedUtc = entry.ModifiedUtc; returnList.Add(entryDetail); } return(returnList); }
public static EntryDetail CreateEntryDetail(int id, int userID) { EntryDetail entryDetail = new EntryDetail(); entryDetail.ID = id; entryDetail.UserID = userID; return entryDetail; }
public void AddToEntryDetails(EntryDetail entryDetail) { base.AddObject("EntryDetails", entryDetail); }
public JsonResult Crear(List <EDEntryDetails> DetalleEntrada, EDEntry Entradas, List <int> IdABorrar) { bool Probar = true; string Mensaje = ""; EDEntry EDEntry = new EDEntry(); EDEntry.EntryId = Entradas.EntryId; EDEntry.FechaIngreso = Entradas.FechaIngreso; EDEntry.Aprobado = Entradas.Aprobado; EDEntry.TerceroId = Entradas.TerceroId; List <EDEntryDetails> EDEntryDetails = new List <EDEntryDetails>(); foreach (var item in DetalleEntrada) { EDEntryDetails EDEntryDetail = new EDEntryDetails(); EDEntryDetail.EntryDetailId = item.EntryDetailId; EDEntryDetail.Cantidad = item.Cantidad; EDEntryDetail.Lote = item.Lote; EDEntryDetail.FechaVence = item.FechaVence; EDEntryDetail.ProductDetailId = item.ProductDetailId; EDEntryDetails.Add(EDEntryDetail); } try { Entry Entry = new Entry(); if (EDEntry.EntryId > 0) { Entry entrada = db.Entries.Find(EDEntry.EntryId); Entry = entrada; } Entry.FechaIngreso = DateTime.Parse(EDEntry.FechaIngreso); Entry.TerceroId = EDEntry.TerceroId; Entry.Aprobado = EDEntry.Aprobado = Entradas.Aprobado; if (EDEntry.EntryId > 0) { db.Entry(Entry).State = EntityState.Modified; db.SaveChanges(); } else { db.Entries.Add(Entry); db.SaveChanges(); } int IdEntrada = Entry.EntradaId; if (IdABorrar != null) { foreach (var detalle in IdABorrar) { EntryDetail EntradaDetalle = db.EntryDetails.Find(detalle); db.EntryDetails.Remove(EntradaDetalle); db.SaveChanges(); } } foreach (var item1 in EDEntryDetails) { EntryDetail EntryDetail = new EntryDetail(); if (item1.EntryDetailId > 0) { EntryDetail entradaDetalle = db.EntryDetails.Find(item1.EntryDetailId); EntryDetail = entradaDetalle; } EntryDetail.Cantidad = item1.Cantidad; EntryDetail.Lote = item1.Lote; EntryDetail.FechaVence = DateTime.Parse(item1.FechaVence); EntryDetail.EntradaId = IdEntrada; EntryDetail.ProductDetailId = item1.ProductDetailId; if (EntryDetail.EntryDetailId > 0) { db.Entry(EntryDetail).State = EntityState.Modified; db.SaveChanges(); } else { db.EntryDetails.Add(EntryDetail); db.SaveChanges(); } if (Entry.Aprobado == "S") { ProductDetail ProductDetail = db.ProductDetails.Find(EntryDetail.ProductDetailId); ProductDetail.Existencias += EntryDetail.Cantidad; db.Entry(ProductDetail).State = EntityState.Modified; db.SaveChanges(); } } Mensaje = " Registro Agregado con exito."; } catch (Exception) { Probar = false; Mensaje = " Se produjo un error al agregar el registro."; } return(Json(new { Probar, Mensaje }, JsonRequestBehavior.AllowGet)); }
public void ChangeDisplay(NtfsUsnJournal usnJournal, double top, double left, Win32Api.UsnEntry usnEntry, EntryDetail entryDetail) { Top = top; Left = left; _nameLbl.Text = string.Format(CultureInfo.InvariantCulture, usnEntry.IsFolder ? "Directory: {0}" : "File: {0}", usnEntry.Name); string path; var lastError = usnJournal.GetPathFromFileReference(usnEntry.ParentFileReferenceNumber, out path); if (lastError == (int)NtfsUsnJournal.UsnJournalReturnCode.USN_JOURNAL_SUCCESS && null != path) { path = string.Format(CultureInfo.InvariantCulture, "{0}{1}\\", usnJournal.VolumeName.TrimEnd('\\'), path); } _pathLbl.Text = path; var sb = new StringBuilder(); sb.AppendFormat(" File Ref No: {0}", usnEntry.FileReferenceNumber); sb.AppendFormat("\n Parent FRN {0}", usnEntry.ParentFileReferenceNumber); if (entryDetail == EntryDetail.UsnEntry) { sb.AppendFormat("\n Length: {0}", usnEntry.RecordLength); sb.AppendFormat("\n USN: {0}", usnEntry.USN); AddReasonData(sb, usnEntry); } if (!usnEntry.IsFolder) { var fullPath = Path.Combine(_pathLbl.Text, usnEntry.Name); if (File.Exists(fullPath)) { var fi = new FileInfo(fullPath); sb.AppendFormat("\n File Length: {0} (bytes)", fi.Length); sb.AppendFormat("\n Creation Time: {0} - {1}", fi.CreationTime.ToShortDateString(), fi.CreationTime.ToShortTimeString()); sb.AppendFormat("\n Last Modify: {0} - {1}", fi.LastWriteTime.ToShortDateString(), fi.LastWriteTime.ToShortTimeString()); sb.AppendFormat("\n Last Access: {0} - {1}", fi.LastAccessTime.ToShortDateString(), fi.LastAccessTime.ToShortTimeString()); } } _entryDetailLbl.Content = sb.ToString(); Visibility = Visibility.Visible; }