public ActionResult UnMarkWhiteLabel(List <long> ids) { POSBLL bll = new POSBLL(); var result = bll.UnMarkWhiteLabel(ids, UserId, UserName); return(Json(result.toJson())); }
public ActionResult ImportWhiteLabelPOSSN() { POSBLL ab = new POSBLL(); //导入文件 HttpPostedFileBase file = Request.Files["importSN"]; DataTable dt = ExcelToDataTable(file); List <string> snList = new List <string>(); List <POSs> list = new List <POSs>(); foreach (DataRow item in dt.Rows) { if (!item[0].ToString().StartsWith("N3000")) { continue; } POSs pos = new POSs(); pos.Sn = item[0].ToString(); pos.Status = false; pos.Timestamp = DateTime.UtcNow; pos.WhiteLabel = Request.Form["WhiteLabel"]; pos.IsWhiteLabel = true; pos.FirstCrypto = Request.Form["FirstCrypto"]; if (item[1].ToString().Equals("Open")) { pos.IsMiningEnabled = true; } list.Add(pos); snList.Add(item[0].ToString()); } List <POSs> listRepeat = new List <POSs>(); if (list.Count > 0) { listRepeat = ab.Import(list, snList, UserId, UserName); if (listRepeat.Count > 0) { HSSFWorkbook book = new HSSFWorkbook(); ISheet sheet = book.CreateSheet("Sheet1"); IRow row1 = sheet.CreateRow(0); row1.CreateCell(0, CellType.String).SetCellValue("POS SN"); row1.CreateCell(1, CellType.String).SetCellValue("Imported file exist duplicate POS SN numbers, please try again after delete the duplicate SN numbers"); for (int i = 0; i < listRepeat.Count; i++) { IRow row = sheet.CreateRow(i + 1); row.CreateCell(0, CellType.String).SetCellValue(listRepeat[i].Sn); } ICellStyle cellStyle = book.CreateCellStyle(); Response.Charset = System.Text.Encoding.UTF8.BodyName; Response.ContentType = "application/octet-stream"; Response.AddHeader("Content-Disposition", "attachment; filename=\"POS SN List.xls\""); book.Write(Response.OutputStream); Response.Flush(); Response.End(); } } return(RedirectToAction("Index", new { id = Request["PageId"] })); }
public ActionResult BatchUpdate(List <long> ids, bool isEnable) { POSBLL bll = new POSBLL(); var result = bll.BatchUpdate(ids, isEnable, UserId, UserName); return(Json(result.toJson())); }
public ActionResult MarkWhiteLabel(List <long> ids, string whiteLabel, string firstCrypto) { POSBLL bll = new POSBLL(); var result = bll.MarkWhiteLabel(ids, whiteLabel, firstCrypto, UserId, UserName); return(Json(result.toJson())); }
public ActionResult LoadData(GridPager pager, string merchantName, string cellPhone, string username, string possn, AccountStatus?status, int?countryId) { POSBLL pb = new POSBLL(); var data = pb.GetPOSInfoList(merchantName, username, cellPhone, status, possn, countryId, ref pager); var coinList = FoundationDB.CryptocurrencyDb.GetList(); var cotunryList = FoundationDB.CountryDb.GetList(); var obj = data.ToGridJson(pager, r => new { id = r.Id, cell = new { Id = r.Id.ToString(), Username = r.Username, Sn = r.Sn, Cellphone = r.Cellphone, MerchantName = r.MerchantName, CountryName = cotunryList.Where(t => t.Id == r.CountryId).Select(t => t.Name).FirstOrDefault(), Email = r.Email, //DefaultCrypto = coinList.Where(x => x.Id == (FiiiPayDB.DB.Queryable<MerchantWallets>().Where(t => t.MerchantAccountId == r.Id).Where(t => t.IsDefault == 1).ToList().Select(t => t.CryptoId).FirstOrDefault())).Select(t => t.Name).FirstOrDefault(), Status = r.Status.ToString(), IsAllowWithdrawal = r.IsAllowWithdrawal.ToString(), IsAllowAcceptPayment = r.IsAllowAcceptPayment.ToString() } }); return(Json(obj, JsonRequestBehavior.AllowGet)); }
public ActionResult ResetPIN(Guid Id) { POSBLL pb = new POSBLL(); var model = pb.GetPOSInfoById(Id); return(PartialView(model)); }
public ActionResult Save(POSs oPos) { POSBLL ab = new POSBLL(); SaveResult result = new SaveResult(); result = ab.Create(oPos, UserId, UserName); return(Json(result.toJson())); }
public ActionResult Edit(Guid id) { POSBLL pb = new POSBLL(); var model = pb.GetPOSInfoById(id); model.Receivables_Tier = model.Receivables_Tier * 100; model.Markup = model.Markup * 100; List <SelectListItem> statusList = new List <SelectListItem>(); statusList.Add(new SelectListItem() { Text = "Actived", Value = "1" }); statusList.Add(new SelectListItem() { Text = "Locked", Value = "0" }); ViewBag.StatusList = statusList; List <SelectListItem> funcList = new List <SelectListItem>(); funcList.Add(new SelectListItem() { Text = "Enable", Value = "true" }); funcList.Add(new SelectListItem() { Text = "Disable", Value = "false" }); ViewBag.FuncList = funcList; var coinList = FoundationDB.CryptocurrencyDb.GetList(); var table = FiiiPayDB.DB.Queryable <MerchantWallets>().Where(t => t.MerchantAccountId == id).ToList(); List <SelectListItem> oList = new List <SelectListItem>(); if (table != null && table.Count > 0) { foreach (var item in table) { oList.Add(new SelectListItem() { Text = coinList.Where(t => t.Id == item.CryptoId).Select(t => t.Name).FirstOrDefault(), Value = item.Id.ToString() }); } } ViewBag.CURList = oList; return(PartialView(model)); }
public ActionResult LoadData(GridPager pager, string userName, string cellPhone, string sn) { var cotunryList = FoundationDB.CountryDb.GetList(); POSBLL pb = new POSBLL(); var data = pb.GetPOSInfoList(userName, cellPhone, sn, ref pager); var obj = data.ToGridJson(pager, r => new { id = r.Id, cell = new { Id = r.Id, Username = r.Username, Sn = r.Sn, Cellphone = r.Cellphone, MerchantName = r.MerchantName, CountryName = cotunryList.Where(t => t.Id == r.CountryId).Select(t => t.Name).FirstOrDefault() } }); return(Json(obj, JsonRequestBehavior.AllowGet)); }
public ActionResult Delete(int id) { POSBLL ab = new POSBLL(); return(Json(ab.DeleteById(id, UserId, UserName).toJson())); }
public ActionResult Save(POSViewModel oModel) { POSBLL pb = new POSBLL(); return(Json(pb.SaveEdit(oModel, UserId, UserName).toJson())); }
public ActionResult Unbind(Guid id) { POSBLL pb = new POSBLL(); return(Json(pb.GoogleUnbind(id, UserId, UserName).toJson())); }