public ActionResult Create(chqBook_CheckBookFieldDec chqbook_checkbookfielddec) { if (ModelState.IsValid) { db.chqBook_CheckBookFieldDecs.Add(chqbook_checkbookfielddec); db.SaveChanges(); return RedirectToAction("Index"); } return View(chqbook_checkbookfielddec); }
public ActionResult Edit(chqBook_CheckBookFieldDec chqbook_checkbookfielddec) { if (ModelState.IsValid) { db.Entry(chqbook_checkbookfielddec).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } return View(chqbook_checkbookfielddec); }
private void updateFileDetails(string fileCreationDate, string runNumber, string branchCode, string acc_no, string ch_digit, string cheqbkVoucherUdf1, string cheqbkVoucherUdf2, string bookStyle, string no_of_bks, string ckStartSerial, string creditStartSerial, string personalisation, string branchTitle, string branchAddress, string OysDate) { chqBook_CheckBookFieldDec chkbook = new chqBook_CheckBookFieldDec(); chkbook.fileCreationDate = fileCreationDate; chkbook.runNumber = runNumber; chkbook.branchCode = branchCode; chkbook.acc_no = acc_no; chkbook.ch_digit = ch_digit; chkbook.cheqbkVoucherUdf1 = cheqbkVoucherUdf1; chkbook.cheqbkVoucherUdf2 = cheqbkVoucherUdf2; chkbook.bookStyle = bookStyle; chkbook.no_of_bks = no_of_bks; chkbook.ckStartSerial = ckStartSerial; chkbook.creditStartSerial = creditStartSerial; chkbook.personalisation = personalisation; chkbook.branchTitle = branchTitle; chkbook.branchAddress = branchAddress; chkbook.OysDate = OysDate; //update chkbook if (!isRunFileExist(chkbook)) { db.chqBook_CheckBookFieldDecs.Add(chkbook); db.SaveChanges(); } }
private bool isRunFileExist(chqBook_CheckBookFieldDec book) { bool returnType = false; try { string data = db.chqBook_CheckBookFieldDecs.Single(b => b.branchAddress == book.branchAddress && b.branchCode == book.branchCode && b.branchTitle == book.branchTitle && b.ckStartSerial == book.ckStartSerial && b.creditStartSerial == book.creditStartSerial).ch_digit; returnType = true; } catch (Exception e) { } return returnType; }