public VoucherInfo3 FindVoucherTRSByVoucherNumber(int countryId, int voucherId, string s1, string s2) { try { SecurityCheckThrow(s1, s2); RecordCallHistory("FindVoucherTRSByVoucherNumber"); var da = new PTFDataAccess(); var v = da.FindVoucher(countryId, voucherId); return(new VoucherInfo3(v)); } catch (Exception ex) { throw new FaultException <MyApplicationFault>(new MyApplicationFault(), ex.Message); } }
public VoucherInfo3 FindVoucherTRSBySiteCode(string siteCode, int location, string s1, string s2) { try { SecurityCheckThrow(s1, s2); RecordCallHistory("FindVoucherTRSBySiteCode"); var da = new PTFDataAccess(); var v = da.FindVoucher(siteCode, location); return(new VoucherInfo3(v)); } catch (Exception ex) { throw new FaultException <MyApplicationFault>(new MyApplicationFault(), ex.Message); } }
public ActionResult NotaDebitoEmail(NotaDebitoEmail_Model model) { if (this.ModelState.IsValid) { ViewData["NotaDebitoList"] = PTFDataAccess.SelectForNotaDebitosPerHeadOffice(model.Country, model.FromDate, model.ToDate, model.HeadOffice); } ViewData["CountryList"] = HttpContext.Application.Get <List <CountryDetail> >("CountryList", Helper.CreateCountryDropDownLoadFunction()).CreateSelectList( (c) => string.Format("{0} - {1}", c.Country, c.Iso2), (c) => c.Number.ToString()); ViewData["HeadOfficeList"] = HttpContext.Session.Get <List <SelectListItem> >("Empty", Helper.CreateEmptyLoadFunction()); ViewData["RetailerList"] = HttpContext.Session.Get <List <SelectListItem> >("Empty", Helper.CreateEmptyLoadFunction()); return(View(model)); }
public ActionResult Scanbarcode(BarcodeModel b) { string barcode = this.Request.Params["Barcode"]; if (!string.IsNullOrWhiteSpace(barcode)) { BarcodeData data = new BarcodeDecoder().Match(barcode); if (data != null) { //data.CountryID = 826; //data.VoucherID = 15715619; // Ravi: Don't test! //if (PTFDataAccess.CheckP1Exists(data.CountryID, data.VoucherID)) { PTFDataAccess.ExcudeFromDebitRun(data.CountryID, data.RetailerID, data.VoucherID, CurrentUser.UserID); PTFDataAccess.LogVoucher(data.CountryID, data.VoucherID, CurrentUser.UserID); ViewBag.Info = PTFDataAccess.SelectVoucherInfo(data.CountryID, data.VoucherID); //return RedirectToAction("Index", "Home"); } //else //{ // ViewBag.Err = // string.Format("P1 doesn't exist for Iso:'{0}' Branch:'{1}' Voucher:'{2}'. Please process voucher by using voucher entry in TRS.", data.CountryID, data.RetailerID, data.VoucherID); //} } else { ViewBag.Err = string.Format("Wrong barcode '{0}'. Please renter.", barcode); } } else { ViewBag.Err = "Barcode may not be empty."; } return(View(b)); }
public ActionResult Search(InvoiceSearch_Model model) { model.Validate(this.ModelState); if (this.ModelState.IsValid) { if (model.UseNumber) { ViewData["InvoiceSearchList"] = PTFDataAccess.SelectForNotaDebitosByNumber(model.Country, model.Number, model.FromDate, model.ToDate); } else { ViewData["InvoiceSearchList"] = PTFDataAccess.SelectForNotaDebitosPerHeadOffice(model.Country, model.HeadOffice, model.FromDate, model.ToDate); } } ViewData["HeadOfficeList"] = HttpContext.Session.Get <int, List <HeadOffice> >("HeadOfficeList" + CurrentUser.CountryID, Helper.CreateHeadOfficeDropDownLoadFunction(), CurrentUser.CountryID).CreateSelectList((h) => string.Format("{0} - {1}", h.Name, h.Id), (h) => h.Id.ToString()); ViewData["RetailerList"] = HttpContext.Session.Get <List <SelectListItem> >("Empty", Helper.CreateEmptyDropDownLoadFunction()); return(View(model)); }