public PartialViewResult BillOpen(string id) { string sid = MyHtmlHelpers.ConvertByteStrToId(id); var cSBILLs = db.CSBILLs.Where(x => x.CONO == sid); return(PartialView("Partial/BillOpen", cSBILLs)); }
public ActionResult DeleteConfirmed(string id) { CSBILL cSBILL = db.CSBILLs.Find(MyHtmlHelpers.ConvertByteStrToId(id)); try { db.CSBILLs.Remove(cSBILL); db.SaveChanges(); int page = (int)Session["CSBillPage"]; return(RedirectToAction("Index", new { page = page })); } catch (DbEntityValidationException dbEx) { foreach (var validationErrors in dbEx.EntityValidationErrors) { foreach (var validationError in validationErrors.ValidationErrors) { //string message = string.Format("{0}:{1}", // validationErrors.Entry.Entity.ToString(), // validationError.ErrorMessage); // raise a new exception nesting // the current instance as InnerException ModelState.AddModelError(validationError.PropertyName, validationError.ErrorMessage); } } } catch (DbUpdateException ex) { UpdateException updateException = (UpdateException)ex.InnerException; if (updateException != null) { if (updateException.InnerException != null) { var sqlException = (FirebirdSql.Data.FirebirdClient.FbException)updateException.InnerException; foreach (var error in sqlException.Errors) { if (error.Message != null) { ModelState.AddModelError(string.Empty, error.Message); } } } else { ModelState.AddModelError(string.Empty, updateException.Message); } } else { ModelState.AddModelError(string.Empty, updateException.Message); } } ViewBag.page = Session["CSBillPage"]; ViewBag.Title = "Delete Billing Item"; return(CallView("Edit", cSBILL)); }
// GET: CSCNMs/Delete/5 public ActionResult Delete(string id, int?page) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } CSCNM cSCNM = db.CSCNMs.Find(MyHtmlHelpers.ConvertByteStrToId(id)); if (cSCNM == null) { return(HttpNotFound()); } int refcnt = cSCNM.CSCNDs.Sum(x => x.refcnt); if (refcnt > 0) { ModelState.AddModelError(string.Empty, refcnt.ToString() + " Details has been touched. Cannot Delete record"); } ViewBag.page = page ?? 1; Session["CSCNMPage"] = ViewBag.page; ViewBag.CSCND = db.CSCNDs.Where(x => x.TRNO == cSCNM.TRNO); ViewBag.CONAME = db.CSCOMSTRs.Where(x => x.CONO == cSCNM.CONO).Select(y => y.CONAME).FirstOrDefault(); ViewBag.CONO = new SelectList(db.CSCOMSTRs.Select(x => new { CONO = x.CONO, CONAME = x.CONAME + " (" + x.CONO + ")" }).OrderBy(y => y.CONAME), "CONO", "CONAME", cSCNM.CONO); ViewBag.ATTNDESC = new SelectList(db.CSCOPICs.Where(x => x.CONO == cSCNM.CONO).Select(x => new { PRSNAME = x.CSPR.PRSNAME, PRSDESC = x.CSPR.PRSNAME }).OrderBy(y => y.PRSDESC), "PRSNAME", "PRSDESC", cSCNM.ATTN); ViewBag.COADDR = new SelectList(db.CSCOADDRs.Where(x => x.CONO == cSCNM.CONO).Select(x => new { COADDR = x.CONO + "|" + x.ADDRID, COADDRDESC = x.ADDRTYPE + " | " + x.MAILADDR + " | " + x.ADDR1 + " " + x.ADDR2 + " " + x.ADDR3 }), "COADDR", "COADDRDESC", cSCNM.COADDR); ViewBag.Title = "Delete Discounted Bill"; return(View("Edit", cSCNM)); }
// GET: CSBILLs/Edit/5 public ActionResult Edit(string id, int?page) { ViewBag.Title = "Edit Billing Item"; if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } CSBILL cSBILL = db.CSBILLs.Find(MyHtmlHelpers.ConvertByteStrToId(id)); if (cSBILL == null) { return(HttpNotFound()); } //ViewBag.JOBCASE = new SelectList(db.CSJOBDs.Include(c => c.CSJOBM).Where(x => (x.JOBNO == cSBILL.JOBNO && x.CASENO == cSBILL.CASENO) || (x.CSJOBM.CONO == cSBILL.CONO && x.CSJOBM.JOBPOST == "Y" && x.COMPLETE == "N" && x.CSJOBM.VDATE <= cSBILL.ENTDATE)). // Select(s => new { JOBCASE = s.JOBNO + "-" + s.CASENO, JOBDESC = s.JOBNO + " | " + s.CASENO + " | " + s.CSJOBM.VDATE.ToString() + " | " + s.CASECODE + " | " + s.CASEREM + " | " + s.CASEMEMO }). // OrderBy(y => y.JOBCASE), "JOBCASE", "JOBDESC", cSBILL.JOBCASE); //ViewBag.ITEMTYPE = new SelectList(db.CSITEMs, "ITEMTYPE", "ITEMDESC", cSBILL.ITEMTYPE); //ViewBag.CONO = new SelectList(db.CSCOMSTRs.Select(x => new { CONO = x.CONO, CONAME = x.CONAME + " (" + x.CONO + ")" }).OrderBy(y => y.CONAME), "CONO", "CONAME", cSBILL.CONO); //ViewBag.BILLDESC = new SelectList(db.CSBILLDESCs.Select(x => new { BILLDESC = x.BILLDESC, BILLSPEC = x.BILLDESC + " | " + x.BILLSPEC }).OrderBy(y => y.BILLDESC), "BILLDESC", "BILLDESC", cSBILL.ITEMDESC); //ViewBag.CASECODE = new SelectList(db.CSCASEs, "CASECODE", "CASEDESC", cSBILL.CASECODE); ViewBag.page = page ?? 1; Session["CSBillPage"] = ViewBag.page; return(CallView(cSBILL)); }
// GET: CSPRFs/Edit/5 public ActionResult Edit(string id, int?page) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } CSPRF cSPRF = db.CSPRFs.Find(MyHtmlHelpers.ConvertByteStrToId(id)); if (cSPRF == null) { return(HttpNotFound()); } ViewBag.page = page ?? 1; Session["CSPRFPage"] = ViewBag.page; ViewBag.CONO = new SelectList(db.CSCOMSTRs.Select(x => new { CONO = x.CONO, CONAME = x.CONAME + " (" + x.CONO + ")" }).OrderBy(y => y.CONAME), "CONO", "CONAME", cSPRF.CONO); ViewBag.ATTNDESC = new SelectList(db.CSCOPICs.Where(x => x.CONO == cSPRF.CONO).Select(x => new { PRSNAME = x.CSPR.PRSNAME, PRSDESC = x.CSPR.PRSNAME }).OrderBy(y => y.PRSDESC), "PRSNAME", "PRSDESC", cSPRF.ATTN); ViewBag.COADDR = new SelectList(db.CSCOADDRs.Where(x => x.CONO == cSPRF.CONO).Select(x => new { COADDR = x.CONO + "|" + x.ADDRID, COADDRDESC = x.ADDRTYPE + " | " + x.MAILADDR + " | " + x.ADDR1 + " " + x.ADDR2 + " " + x.ADDR3 }), "COADDR", "COADDRDESC", cSPRF.COADDR); ViewBag.DETAILS = db.CSBILLs.Where(x => x.PRFNO == cSPRF.PRFNO); ViewBag.CONAME = db.CSCOMSTRs.Where(x => x.CONO == cSPRF.CONO).Select(y => y.CONAME).FirstOrDefault(); ViewBag.Title = "Edit Proforma Bill " + cSPRF.PRFNO; ViewBag.PRFNO = cSPRF.PRFNO; return(View("Edit", cSPRF)); }
public ActionResult DeleteConfirmed(string id, int seq) { CSCOAR cSCOAR = db.CSCOARs.Find(MyHtmlHelpers.ConvertByteStrToId(id), seq); try { db.CSCOARs.Remove(cSCOAR); db.SaveChanges(); //return RedirectToAction("Details", "CSCOMSTRs", new { id = MyHtmlHelpers.ConvertIdToByteStr(cSCOAR.CONO) }); return(new RedirectResult(Url.Action("Details", "CSCOMSTRs", new { id = MyHtmlHelpers.ConvertIdToByteStr(cSCOAR.CONO) }) + "#Annual")); } catch (DbEntityValidationException dbEx) { foreach (var validationErrors in dbEx.EntityValidationErrors) { foreach (var validationError in validationErrors.ValidationErrors) { //string message = string.Format("{0}:{1}", // validationErrors.Entry.Entity.ToString(), // validationError.ErrorMessage); // raise a new exception nesting // the current instance as InnerException ModelState.AddModelError(validationError.PropertyName, validationError.ErrorMessage); } } } catch (DbUpdateException ex) { UpdateException updateException = (UpdateException)ex.InnerException; if (updateException != null) { if (updateException.InnerException != null) { var sqlException = (FirebirdSql.Data.FirebirdClient.FbException)updateException.InnerException; foreach (var error in sqlException.Errors) { if (error.Message != null) { ModelState.AddModelError(string.Empty, error.Message); } } } else { ModelState.AddModelError(string.Empty, updateException.Message); } } else { ModelState.AddModelError(string.Empty, updateException.Message); } } catch (Exception e) { ModelState.AddModelError(string.Empty, e.Message); } cSCOAR.CSCOMSTR = db.CSCOMSTRs.Find(cSCOAR.CONO); return(View(cSCOAR)); }
public ActionResult Proforma(string id) { string sid = MyHtmlHelpers.ConvertByteStrToId(id); CSPRF cSPRF = getProforma(sid); //string html = RenderViewToString(ControllerContext, "~/views/CSPRFs/Proforma.cshtml", cSPRF, true); //EmailFormModel model = new WebApplication1.EmailFormModel(); //model.Message = html; //model.FromEmail = "*****@*****.**"; //model.FromName = "my tester"; //var body = "<p>Email From: {0} ({1})</p><p>Message:</p><p>{2}</p>"; //var message = new MailMessage(); //message.To.Add(new MailAddress("*****@*****.**")); //replace with valid value //message.Subject = "Your email subject"; //message.Body = string.Format(body, model.FromName, model.FromEmail, model.Message); //message.IsBodyHtml = true; //using (var smtp = new SmtpClient()) //{ // smtp.Send(message); // //} return(View(cSPRF)); }
// GET: CSDNMs/Details/5 public ActionResult Details(string id, int?page) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } CSDNM cSDNM = db.CSDNMs.Find(MyHtmlHelpers.ConvertByteStrToId(id)); if (cSDNM == null) { return(HttpNotFound()); } ViewBag.page = page ?? 1; Session["CSDNMPage"] = ViewBag.page; ViewBag.CSDND = db.CSDNDs.Where(x => x.TRNO == cSDNM.TRNO); ViewBag.CONAME = db.CSCOMSTRs.Where(x => x.CONO == cSDNM.CONO).Select(y => y.CONAME).FirstOrDefault(); ViewBag.CONO = new SelectList(db.CSCOMSTRs.Select(x => new { CONO = x.CONO, CONAME = x.CONAME + " (" + x.CONO + ")" }).OrderBy(y => y.CONAME), "CONO", "CONAME", cSDNM.CONO); ViewBag.ATTNDESC = new SelectList(db.CSCOPICs.Where(x => x.CONO == cSDNM.CONO).Select(x => new { PRSNAME = x.CSPR.PRSNAME, PRSDESC = x.CSPR.PRSNAME }).OrderBy(y => y.PRSDESC), "PRSNAME", "PRSDESC", cSDNM.ATTN); ViewBag.COADDR = new SelectList(db.CSCOADDRs.Where(x => x.CONO == cSDNM.CONO).Select(x => new { COADDR = x.CONO + "|" + x.ADDRID, COADDRDESC = x.ADDRTYPE + " | " + x.MAILADDR + " | " + x.ADDR1 + " " + x.ADDR2 + " " + x.ADDR3 }), "COADDR", "COADDRDESC", cSDNM.COADDR); ViewBag.Title = "View Debit Note"; return(View("Edit", cSDNM)); }
public ActionResult Edit([Bind(Include = "PRSCODE,ADDRID,MAILADDR,MAILADDRBool,ADDRTYPE,ADDR1,ADDR2,ADDR3,POSTAL,CITYCODE,STATECODE,CTRYCODE,PHONE1,PHONE2,FAX1,FAX2,REM,STAMP")] CSPRSADDR cSPRSADDR) { if (ModelState.IsValid) { try { cSPRSADDR.STAMP = cSPRSADDR.STAMP + 1; db.Entry(cSPRSADDR).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Edit", "CSPRs", new { id = MyHtmlHelpers.ConvertIdToByteStr(cSPRSADDR.PRSCODE) })); } catch (DbEntityValidationException dbEx) { foreach (var validationErrors in dbEx.EntityValidationErrors) { foreach (var validationError in validationErrors.ValidationErrors) { //string message = string.Format("{0}:{1}", // validationErrors.Entry.Entity.ToString(), // validationError.ErrorMessage); // raise a new exception nesting // the current instance as InnerException ModelState.AddModelError(validationError.PropertyName, validationError.ErrorMessage); } } } catch (DbUpdateException ex) { UpdateException updateException = (UpdateException)ex.InnerException; if (updateException != null) { if (updateException.InnerException != null) { var sqlException = (FirebirdSql.Data.FirebirdClient.FbException)updateException.InnerException; foreach (var error in sqlException.Errors) { if (error.Message != null) { ModelState.AddModelError(string.Empty, error.Message); } } } else { ModelState.AddModelError(string.Empty, updateException.Message); } } else { ModelState.AddModelError(string.Empty, updateException.Message); } } } ViewBag.ADDRTYPE = cSPRSADDR.addrtypeList; ViewBag.CITYCODE = new SelectList(db.HKCITies.OrderBy(x => x.CITYCODE), "CITYCODE", "CITYDESC", cSPRSADDR.CITYCODE); ViewBag.STATECODE = new SelectList(db.HKSTATEs.OrderBy(x => x.STATECODE), "STATECODE", "STATEDESC", cSPRSADDR.STATECODE); ViewBag.CTRYCODE = new SelectList(db.HKCTRies.OrderBy(x => x.CTRYCODE), "CTRYCODE", "CTRYDESC", cSPRSADDR.CTRYCODE); return(View(cSPRSADDR)); }
// GET: CSCASEFEEs/Create public ActionResult Create(string id) { ViewBag.Parent = MyHtmlHelpers.ConvertByteStrToId(id); string sid = ViewBag.Parent; CSCASEFEE lastRec = db.CSCASEFEEs.Where(m => m.CASECODE == sid).OrderByDescending(n => n.FEEID).FirstOrDefault(); CSCASEFEE curRec = new CSCASEFEE(); CSPARAM paramRec = db.CSPARAMs.FirstOrDefault(); if (paramRec != null) { curRec.TAXRATE = paramRec.TAXRATE; } if (lastRec != null) { curRec.CASECODE = sid; curRec.FEEID = lastRec.FEEID + 1; } else { curRec.CASECODE = sid; curRec.FEEID = 1; }; curRec.STAMP = 1; ViewBag.ITEMTYPE = new SelectList(db.CSITEMs, "ITEMTYPE", "ITEMDESC"); return(View(curRec)); }
// GET: CSJOBSTs/Create public ActionResult Create(string id, int row) { string sid = MyHtmlHelpers.ConvertByteStrToId(id); CSJOBST lastRec = db.CSJOBSTs.Where(x => x.JOBNO == sid && x.CASENO == row).OrderByDescending(x => x.INIDX).FirstOrDefault(); CSJOBST cSJOBST = new CSJOBST(); cSJOBST.JOBNO = sid; cSJOBST.CASENO = row; if (lastRec == null) { cSJOBST.STAGEFR = "New"; } else { cSJOBST.STAGEFR = lastRec.STAGETO; } cSJOBST.INDATE = DateTime.Today; cSJOBST.INTIME = DateTime.Now.ToString("HH:mm:ss"); cSJOBST.STAMP = 0; ViewBag.SENDMODE = GetSendModeList(); ViewBag.STAGETO = new SelectList(db.CSSTGs.OrderBy(x => x.STAGESEQ), "STAGE", "STAGE"); ViewBag.Title = "Create Job Case Status "; return(View("Edit", cSJOBST)); }
public ActionResult DeleteConfirmed(string id, string person, DateTime adate, int row) { CSCOAGTCHG cSCOAGTCHG = db.CSCOAGTCHGs.Find(MyHtmlHelpers.ConvertByteStrToId(id), person, adate, row); try { db.CSCOAGTCHGs.Remove(cSCOAGTCHG); db.SaveChanges(); return(new RedirectResult(Url.Action("Edit", "CSCOAGTs", new { id = MyHtmlHelpers.ConvertIdToByteStr(cSCOAGTCHG.CONO), person = cSCOAGTCHG.PRSCODE, adate = cSCOAGTCHG.ADATE }))); } catch (DbEntityValidationException dbEx) { foreach (var validationErrors in dbEx.EntityValidationErrors) { foreach (var validationError in validationErrors.ValidationErrors) { //string message = string.Format("{0}:{1}", // validationErrors.Entry.Entity.ToString(), // validationError.ErrorMessage); // raise a new exception nesting // the current instance as InnerException ModelState.AddModelError(validationError.PropertyName, validationError.ErrorMessage); } } } catch (DbUpdateException ex) { UpdateException updateException = (UpdateException)ex.InnerException; if (updateException != null) { if (updateException.InnerException != null) { var sqlException = (FirebirdSql.Data.FirebirdClient.FbException)updateException.InnerException; foreach (var error in sqlException.Errors) { if (error.Message != null) { ModelState.AddModelError(string.Empty, error.Message); } } } else { ModelState.AddModelError(string.Empty, updateException.Message); } } else { ModelState.AddModelError(string.Empty, updateException.Message); } } catch (Exception e) { ModelState.AddModelError(string.Empty, e.Message); } return(View(cSCOAGTCHG)); }
public ActionResult DeleteConfirmed(string id, int row) { CSCOPARENT cSCOPARENT = db.CSCOPARENTs.Find(MyHtmlHelpers.ConvertByteStrToId(id), row); try { db.CSCOPARENTs.Remove(cSCOPARENT); db.SaveChanges(); return(new RedirectResult(Url.Action("Edit", "CSCOMSTRs", new { id = MyHtmlHelpers.ConvertIdToByteStr(cSCOPARENT.CONO) }) + "#Parent")); } catch (DbEntityValidationException dbEx) { foreach (var validationErrors in dbEx.EntityValidationErrors) { foreach (var validationError in validationErrors.ValidationErrors) { //string message = string.Format("{0}:{1}", // validationErrors.Entry.Entity.ToString(), // validationError.ErrorMessage); // raise a new exception nesting // the current instance as InnerException ModelState.AddModelError(validationError.PropertyName, validationError.ErrorMessage); } } } catch (DbUpdateException ex) { UpdateException updateException = (UpdateException)ex.InnerException; if (updateException != null) { if (updateException.InnerException != null) { var sqlException = (FirebirdSql.Data.FirebirdClient.FbException)updateException.InnerException; foreach (var error in sqlException.Errors) { if (error.Message != null) { ModelState.AddModelError(string.Empty, error.Message); } } } else { ModelState.AddModelError(string.Empty, updateException.Message); } } else { ModelState.AddModelError(string.Empty, updateException.Message); } } catch (Exception e) { ModelState.AddModelError(string.Empty, e.Message); } ViewBag.CONAME = db.CSCOMSTRs.Where(x => x.CONO == cSCOPARENT.CONO).Select(x => x.CONAME).FirstOrDefault(); return(View(cSCOPARENT)); }
public ActionResult Create([Bind(Include = "PRSCODE,CTRYCODE,REGTYPE,REGNO,REM,STAMP")] CSPRSREG cSPRSREG) { if (ModelState.IsValid) { try { cSPRSREG.STAMP = 0; db.CSPRSREGs.Add(cSPRSREG); db.SaveChanges(); return(RedirectToAction("Edit", "CSPRs", new { id = MyHtmlHelpers.ConvertIdToByteStr(cSPRSREG.PRSCODE) })); } catch (DbEntityValidationException dbEx) { foreach (var validationErrors in dbEx.EntityValidationErrors) { foreach (var validationError in validationErrors.ValidationErrors) { //string message = string.Format("{0}:{1}", // validationErrors.Entry.Entity.ToString(), // validationError.ErrorMessage); // raise a new exception nesting // the current instance as InnerException ModelState.AddModelError(validationError.PropertyName, validationError.ErrorMessage); } } } catch (DbUpdateException ex) { UpdateException updateException = (UpdateException)ex.InnerException; if (updateException != null) { if (updateException.InnerException != null) { var sqlException = (FirebirdSql.Data.FirebirdClient.FbException)updateException.InnerException; foreach (var error in sqlException.Errors) { if (error.Message != null) { ModelState.AddModelError(string.Empty, error.Message); } } } else { ModelState.AddModelError(string.Empty, updateException.Message); } } else { ModelState.AddModelError(string.Empty, updateException.Message); } } } ViewBag.PRSCODE = MyHtmlHelpers.ConvertByteStrToId(cSPRSREG.PRSCODE); ViewBag.REGTYPE = new SelectList(db.HKREGTYPEs.Select(x => new { REGTYPE = x.REGTYPE, REGDESC = x.CTRYOPR + " | " + x.REGTYPE }), "REGTYPE", "REGDESC"); ViewBag.CTRYCODE = new SelectList(db.HKCTRies.OrderBy(x => x.CTRYCODE), "CTRYCODE", "CTRYDESC", cSPRSREG.CTRYCODE); return(View(cSPRSREG)); }
public PartialViewResult CSPRSADDR(string id) { string sid = MyHtmlHelpers.ConvertByteStrToId(id); var cSPRSADDRs = db.CSPRSADDRs.Where(x => x.PRSCODE == sid).OrderByDescending(y => y.ADDRID); ViewBag.PRSCODE = sid; return(PartialView("Partial/CSPRSADDR", cSPRSADDRs)); }
public async Task <ActionResult> Email(string id) { string sid = MyHtmlHelpers.ConvertByteStrToId(id); V_CSCOAR vCSCOAR = getReminder(sid); int cnt = await SendEmail(vCSCOAR); return(RedirectToAction("Sent", "Home", new { cnt = cnt })); }
public ActionResult DeleteConfirmed(string id) { SACOMP sACOMP = db.SACOMPs.Find(MyHtmlHelpers.ConvertByteStrToId(id)); db.SACOMPs.Remove(sACOMP); db.SaveChanges(); return(RedirectToAction("Index")); }
public PartialViewResult CSPRSREG(string id) { string sid = MyHtmlHelpers.ConvertByteStrToId(id); var cSPRSREGs = db.CSPRSREGs.Where(x => x.PRSCODE == sid).OrderBy(y => y.REGNO); ViewBag.PRSCODE = sid; return(PartialView("Partial/CSPRSREG", cSPRSREGs)); }
// GET: CSGRPDs/Create public ActionResult Create(string id) { CSGRPD cSGRPD = new WebApplication1.CSGRPD(); cSGRPD.GRPCODE = MyHtmlHelpers.ConvertByteStrToId(id); ViewBag.CONO = new SelectList(db.CSCOMSTRs.OrderBy(x => x.CONAME), "CONO", "CONAME"); return(View(cSGRPD)); }
public ActionResult DeleteConfirmed(string id) { CSCASE cSCASE = db.CSCASEs.Find(MyHtmlHelpers.ConvertByteStrToId(id)); db.CSCASEs.Remove(cSCASE); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult DeleteConfirmed(string id, int row) { CSCOSTAT cSCOSTAT = db.CSCOSTATs.Find(MyHtmlHelpers.ConvertByteStrToId(id), row); db.CSCOSTATs.Remove(cSCOSTAT); db.SaveChanges(); // return RedirectToAction("Details", "CSCOMSTRs", new { id = MyHtmlHelpers.ConvertIdToByteStr(cSCOSTAT.CONO) }); return(new RedirectResult(Url.Action("Details", "CSCOMSTRs", new { id = MyHtmlHelpers.ConvertIdToByteStr(cSCOSTAT.CONO) }) + "#Status")); }
public PartialViewResult PartialCSCOPICs(string id) { string sid = MyHtmlHelpers.ConvertByteStrToId(id); ViewBag.Parent = sid; var csCOPIC = db.CSCOPICs.Where(x => x.CONO == sid).OrderBy(y => y.CSPR.PRSNAME).ToList(); return(PartialView("Partial/PartialCSCOPICs", csCOPIC)); }
// GET: CSCASEFEEs public PartialViewResult IndexByCase(string id) { string sid = MyHtmlHelpers.ConvertByteStrToId(id); ViewBag.Parent = sid; var cSCASEFEEs = db.CSCASEFEEs.Where(m => m.CASECODE == sid).Include(c => c.CSITEM); return(PartialView(cSCASEFEEs.ToList())); }
public PartialViewResult PartialCSCOARs(string id) { string sid = MyHtmlHelpers.ConvertByteStrToId(id); ViewBag.Parent = sid; var csCOAR = db.CSCOARs.Where(x => x.CONO == sid).OrderByDescending(y => y.ARNO).ToList(); return(PartialView("Partial/PartialCSCOARs", csCOAR)); }
public ActionResult DeleteConfirmed(string id, int row) { string trno = DeleteRow(db, id, row); try { db.SaveChanges(); return(RedirectToAction("Edit", "CSCNMs", new { id = MyHtmlHelpers.ConvertIdToByteStr(trno) })); } catch (DbEntityValidationException dbEx) { foreach (var validationErrors in dbEx.EntityValidationErrors) { foreach (var validationError in validationErrors.ValidationErrors) { //string message = string.Format("{0}:{1}", // validationErrors.Entry.Entity.ToString(), // validationError.ErrorMessage); // raise a new exception nesting // the current instance as InnerException ModelState.AddModelError(validationError.PropertyName, validationError.ErrorMessage); } } } catch (DbUpdateException ex) { UpdateException updateException = (UpdateException)ex.InnerException; if (updateException != null) { if (updateException.InnerException != null) { var sqlException = (FirebirdSql.Data.FirebirdClient.FbException)updateException.InnerException; foreach (var error in sqlException.Errors) { if (error.Message != null) { ModelState.AddModelError(string.Empty, error.Message); } } } else { ModelState.AddModelError(string.Empty, updateException.Message); } } else { ModelState.AddModelError(string.Empty, updateException.Message); } } CSCND cSCND = db.CSCNDs.Find(MyHtmlHelpers.ConvertByteStrToId(id), row); ViewBag.CASECODE = new SelectList(db.CSCASEs, "CASECODE", "CASEDESC", cSCND.CASECODE); ViewBag.ITEMTYPE = new SelectList(db.CSITEMs, "ITEMTYPE", "ITEMDESC", cSCND.ITEMTYPE); return(View(cSCND)); }
// GET: CSCOPICs/Create public ActionResult Create(string id) { CSCOPIC cSCOPIC = new CSCOPIC(); cSCOPIC.CONO = MyHtmlHelpers.ConvertByteStrToId(id); cSCOPIC.CSCOMSTR = db.CSCOMSTRs.Find(cSCOPIC.CONO); ViewBag.PRSCODE = new SelectList(db.CSPRS.Where(x => x.HKCONST.CONSTTYPE == "Individual").OrderBy(x => x.PRSNAME), "PRSCODE", "PRSNAME", cSCOPIC.PRSCODE); return(View(cSCOPIC)); }
public PartialViewResult BillAllocated(string id) { string sid = MyHtmlHelpers.ConvertByteStrToId(id); var cSBILLs = db.CSBILLs.Where(x => x.PRFNO == sid).OrderBy(y => y.PRFID); ViewBag.PRFNO = sid; ViewBag.PRFNOB = id; return(PartialView("Partial/BillAllocated", cSBILLs)); }
public PartialViewResult BillOpen(string id, string prfno) { string sid = MyHtmlHelpers.ConvertByteStrToId(id); var cSBILLs = db.CSBILLs.Where(x => x.CONO == sid && x.PRFNO == null); ViewBag.PRFNO = MyHtmlHelpers.ConvertByteStrToId(prfno); ViewBag.PRFNOB = prfno; return(PartialView("Partial/BillOpen", cSBILLs)); }
public ActionResult DeleteConfirmed(string id, int seq) { CSCOAGM cSCOAGM = db.CSCOAGMs.Find(MyHtmlHelpers.ConvertByteStrToId(id), seq); db.CSCOAGMs.Remove(cSCOAGM); db.SaveChanges(); //return RedirectToAction("Details", "CSCOMSTRs", new { id = MyHtmlHelpers.ConvertIdToByteStr(cSCOAGM.CONO) }); return(new RedirectResult(Url.Action("Details", "CSCOMSTRs", new { id = MyHtmlHelpers.ConvertIdToByteStr(cSCOAGM.CONO) }) + "#AGM")); }
public PartialViewResult PartialCOSHSplit(string id) { ViewBag.Parent = MyHtmlHelpers.ConvertByteStrToId(id); string sid = ViewBag.Parent; var curRec = db.CSCOSHEQs.Where(x => x.CONO == sid && x.MVTYPE == "Split").OrderBy(x => x.MVNO).ThenBy(x => x.MVID); return(PartialView("Partial/PartialCOSHSplit", curRec)); }