public async Task UpdateBillStatus(long id, BillStatus status) { var param = new DynamicParameters(); param.Add("@ID", id); param.Add("@Status", status); await SqlMapper.ExecuteAsync(_unitOfWork.Connection, "UpdateBillStatus", param, commandType : CommandType.StoredProcedure, transaction : _unitOfWork.Transaction); }
public Bill(int id, string customerName, string customerAddress, string customerMobile, string customerMessage, PaymentMethod paymentMethod, BillStatus billStatus, DateTime dateCreated, DateTime dateModified, Status status, string customerId) { Id = id; CustomerName = customerName; CustomerAddress = customerAddress; CustomerMoblie = customerMobile; CustomerMessage = customerMessage; BillStatus = billStatus; PaymentMethod = paymentMethod; Status = status; CustomerId = customerId; }
public Bill(int id, string customerName, string customerAddress, string customerMobile, string customerMessage, BillStatus billStatus, PaymentMethod paymentMethod, Status status, Guid customerId) { Id = id; CustomerName = customerName; CustomerAddress = customerAddress; CustomerMobile = customerMobile; CustomerMessage = customerMessage; BillStatus = billStatus; PaymentMethod = paymentMethod; Status = status; CustomerId = customerId; }
public static IEnumerable <WeBill> QueryByStatus(BillStatus status, DateTime begintime, DateTime endtime) { string url = WeUtil.GetUrl(WeShopConst.BILL_STATUS_URL); WeBillStatus request = new WeBillStatus() { Status = status, BeginTime = begintime, EndTime = endtime }; var result = WeUtil.PostToUri(url, request.WriteJson(), new WeBillList()); return(result.OrderList); }
public Bill(int id, string customerName, string customerAddress, string customerMobile, string customerMessage, BillStatus billStatus, PaymentMethod paymentMethod, Status status, Guid?customerId) { this.Id = id; this.CustomerName = customerName; this.CustomerAddress = customerAddress; this.CustomerMobile = customerMobile; this.CustomerMessage = customerMessage; this.BillStatus = billStatus; this.PaymentMethod = paymentMethod; this.Status = status; this.CustomerId = customerId; }
public Bill(string customerName, string customerAddress, string customerMobile, string customerMessage, BillStatus billStatus, PaymentMethod paymentMethod, Status status, Guid?customerId, string code, long shipcodeId) { CustomerName = customerName; CustomerAddress = customerAddress; CustomerMobile = customerMobile; CustomerMessage = customerMessage; BillStatus = billStatus; PaymentMethod = paymentMethod; Status = status; CustomerId = customerId; Code = code; ShipCodeId = shipcodeId; }
public Bill(Guid customerId, string customerName, string customerMobile, string customerAddress, string customerMessage, string customerFacebook, decimal?shippingFee, PaymentMethod paymentMethod, BillStatus billStatus, Status status) { CustomerId = customerId; CustomerName = customerName; CustomerMobile = customerMobile; CustomerAddress = customerAddress; CustomerMessage = customerMessage; CustomerFacebook = customerFacebook; ShippingFee = shippingFee; PaymentMethod = paymentMethod; BillStatus = billStatus; Status = status; }
public GenericResult UpdateStatus(int orderId, BillStatus status) { try { var order = _orderRepository.FindById(orderId); order.BillStatus = status; _orderRepository.Update(order); return(new GenericResult(true, "Update Successful", "Successful")); } catch (Exception) { return(new GenericResult(false, "Update Failed", "Error")); } }
public Bill(string customerName, string customerAddress, string customerMobile, string customerMessage, BillStatus billStatus, PaymentMethod paymentMethod, Status status, Guid?customerId, DateTime dateCreated) { CustomerName = customerName; CustomerAddress = customerAddress; CustomerMobile = customerMobile; CustomerMessage = customerMessage; BillStatus = billStatus; PaymentMethod = paymentMethod; Status = status; DateCreated = dateCreated; DateModified = DateTime.Now; CustomerId = customerId; }
public Bill(int id, Guid?customerId, string customerName, string customerAddress, string customerMobile, string customerEmail, string customerMessage, BillStatus billStatus, PaymentMethod paymentMethod, Status status) { CustomerId = customerId; CustomerName = customerName; CustomerAddress = customerAddress; CustomerMobile = customerMobile; CustomerEmail = customerEmail; CustomerMessage = customerMessage; PaymentMethod = paymentMethod; BillStatus = billStatus; Status = status; BillDetails = new List <BillDetail>(); }
public Bill(int id, string customerName, string customerAddress, string customerMobile, string customerMessage, BillStatus billStatus, decimal?total, PaymentMethod paymentMethod, Status status, DateTime dateCreated, Guid?customerId) { Id = id; CustomerName = customerName; CustomerAddress = customerAddress; CustomerMobile = customerMobile; CustomerMessage = customerMessage; BillStatus = billStatus; Total = total; PaymentMethod = paymentMethod; Status = status; DateCreated = dateCreated; CustomerId = customerId; }
public Bill(Guid id, string customerName, string customerAddress, string customerMobile, string customerMessage, BillStatus billStatus, PaymentMethod paymentMethod, string customerFacebook, decimal?shippingFee) { Id = id; CustomerName = customerName; CustomerAddress = customerAddress; CustomerMobile = customerMobile; CustomerMessage = customerMessage; BillStatus = billStatus; PaymentMethod = paymentMethod; CustomerFacebook = customerFacebook; ShippingFee = shippingFee; }
public List <BillStatus> DsToBillStatusList(DataSet ds) { List <BillStatus> bses = new List <BillStatus>(); if (DataValidate.CheckDataSetNotEmpty(ds)) { foreach (DataRow dr in ds.Tables[0].Rows) { BillStatus bs = new BillStatus(); bs.BillStatusId = Convert.ToInt32(dr["BillStatus_Id"]); bs.BillStatusName = dr["BillStatus_Name"].ToString(); bses.Add(bs); } } return(bses); }
public void UpdateStatus(int billId, BillStatus status) { var order = _orderRepository.FindById(billId); order.BillStatus = status; order.BillDetails = _orderDetailRepository.FindAll(x => x.BillId == billId).ToList(); if (status == BillStatus.Completed) { foreach (var item in order.BillDetails) { var product = item.Product; product.Quality -= item.Quantity; _productRepository.Update(product); } } _orderRepository.Update(order); }
public Bill(string customerName, string customerAddress, string customerMobile, string customerMessage, BillStatus billStatus, PaymentMethod paymentMethod, Status status, Guid customerId, int quantity, decimal totalPrice, decimal discount, string coupon, int bonusPoints) { CustomerName = customerName; CustomerAddress = customerAddress; CustomerMobile = customerMobile; CustomerMessage = customerMessage; BillStatus = billStatus; PaymentMethod = paymentMethod; Status = status; CustomerId = customerId; Quantity = quantity; TotalPrice = totalPrice; Discount = discount; Coupon = coupon; BonusPoints = bonusPoints; }
public async Task <IActionResult> Get(string startDate, string endDate, string customerName, BillStatus billStatus, int pageSize, int page = 1) { var hasPermission = await _authorizationService.AuthorizeAsync(User, "BILL", Operations.Read); if (hasPermission.Succeeded == false) { return(new BadRequestObjectResult(CommonConstants.Forbidden)); } List <BillViewModel> listBillVm = _billService.GetList(startDate, endDate, customerName, billStatus, page, pageSize, out int totalRows); return(new OkObjectResult(new ApiResultPaging <BillViewModel>() { Items = listBillVm, TotalRows = totalRows, PageIndex = page, PageSize = pageSize, })); }
public void AddToBillStatuses(BillStatus billStatus) { base.AddObject("BillStatuses", billStatus); }
public void UpdateStatus(int billId, BillStatus status) { var order = _orderRepository.FindById(billId); order.BillStatus = status; _orderRepository.Update(order); }
public async Task <IActionResult> UpdateStatus(int orderId, BillStatus status) { await _orderSerivce.UpdateStatus(orderId, status); return(new OkObjectResult(orderId)); }
public static BillStatus CreateBillStatus(int billStatusID) { BillStatus billStatus = new BillStatus(); billStatus.BillStatusID = billStatusID; return billStatus; }
public async Task <IActionResult> Update([FromBody] BillViewModel billVmPost) { var hasPermission = await _authorizationService.AuthorizeAsync(User, "BILL", Operations.Update); if (hasPermission.Succeeded == false) { return(new BadRequestObjectResult(CommonConstants.Forbidden)); } if (ModelState.IsValid) { if (billVmPost.BillStatus == BillStatus.Completed) { List <BillDetailViewModel> billDetailVm = _billService.GetBillDetails(billVmPost.Id); foreach (var item in billDetailVm) { Product productDb = _productService.GetProductDbById(item.ProductId); productDb.ViewCount = productDb.ViewCount + item.Quantity; _productService.UpdateDb(productDb); ProductQuantity productQuantityDb = _productQuantityService.GetSingleDb(item.ProductId, item.SizeId, item.ColorId); productQuantityDb.Quantity = productQuantityDb.Quantity - item.Quantity; _productQuantityService.UpdateDb(productQuantityDb); _billService.SaveChanges(); } } if (string.IsNullOrEmpty(billVmPost.CustomerId.ToString())) { _billService.Update(billVmPost); _billService.SaveChanges(); return(new OkObjectResult(billVmPost.Id)); } else { BillStatus billStauts = billVmPost.BillStatus; if (billStauts == BillStatus.Cancelled || billStauts == BillStatus.Returned) { AppUser appUser = await _userManger.FindByIdAsync(billVmPost.CustomerId.ToString()); var totalBalance = appUser.Balance; appUser.Balance = appUser.Balance + (decimal)billVmPost.TotalMoneyOrder + (decimal)billVmPost.FeeShipping - (decimal)billVmPost.BalanceForBill - (decimal)billVmPost.TotalMoneyPayment; var result = await _userManger.UpdateAsync(appUser); if (result.Succeeded) { _billService.Update(billVmPost); _billService.SaveChanges(); return(new OkObjectResult(billVmPost.Id)); } else { return(new BadRequestObjectResult(ModelState)); } } else { _billService.Update(billVmPost); _billService.SaveChanges(); return(new OkObjectResult(billVmPost.Id)); } } } return(new BadRequestObjectResult(ModelState)); }
public IActionResult UpdateStatus(int id, BillStatus status) { _billRepository.UpdateStatus(id, status); _billRepository.Save(); return(new OkObjectResult(id)); }
public Bill(string customerName, string customerAddress, string customerMessage, string customerMobile, PaymentMethod paymentMethod, BillStatus billStatus, Status status, Guid?customerId) { CustomerName = customerName; CustomerAddress = customerAddress; CustomerMobile = customerMobile; CustomerMessage = customerMessage; PaymentMethod = paymentMethod; BillStatus = billStatus; Status = status; CustomerId = customerId; }
public Bill(int id, string customerName, string customerAddress, string customerEmail, string customerPhone, Status status, string customerId, BillStatus billStatus, PaymentMethod paymentMethod) { Id = id; CustomerName = customerName; CustomerEmail = customerName; CustomerPhone = customerPhone; Status = status; CustomerId = CustomerId; BillStatus = billStatus; PaymentMethod = paymentMethod; }
private void btnBillStatus_Click(object sender, EventArgs e) { if (lvBill.SelectedItems.Count == 0) { MessageBox.Show("Vui lòng chọn một trường"); return; } string name = txtBillName.Text; string address = txtBillAddress.Text; string phone = txtBillPhone.Text; if (String.IsNullOrWhiteSpace(name)) { MessageBox.Show("Vui lòng nhập tên"); return; } if (String.IsNullOrWhiteSpace(address)) { MessageBox.Show("Vui lòng nhập địa chỉ"); } if (!Regex.IsMatch(phone, @"^([\+]?33[-]?|[0])?[1-9][0-9]{8}$")) { MessageBox.Show("Số điện thoại không hợp lệ"); return; } int oldid = (lvBill.SelectedItems[0].Tag as Bill).ID; BillStatus billStatus = BillStatus.Unprocessed; if (radBillUnprocessed.Checked) { billStatus = BillStatus.Unprocessed; } else if (radBillProccessing.Checked) { billStatus = BillStatus.Processing; } else if (radBillShipping.Checked) { billStatus = BillStatus.Shipping; } else if (radBillDone.Checked) { billStatus = BillStatus.Done; } else if (radBillCancel.Checked) { billStatus = BillStatus.Cancel; } Bill bill = new Bill { Name = name, Address = address, Phone = phone, Status = billStatus, }; if (billBUS.Edit(oldid, bill)) { MessageBox.Show("Thành công"); ShowAllBill(); } else { MessageBox.Show("Thất bại"); } }
public async Task <ActionResult <List <TransactionViewModel> > > GetTransactions(TransactionHistoryCondition condition) { try { var transactions = _context.Transactions.Where(x => x.Status == Status.Active).OrderByDescending(x => x.DateCreated).ToList(); if (condition.UserId != null) { transactions = transactions.Where(x => x.UserId.ToString() == condition.UserId).ToList(); } if (condition.FromDate != null) { transactions = transactions.Where(x => x.DateCreated >= condition.FromDate && x.DateCreated <= condition.ToDate).ToList(); } var transactionsViewModel = Mapper.Map <List <Transaction>, List <TransactionViewModel> >(transactions); foreach (var item in transactionsViewModel) { var user = await _context.AppUsers.Where(x => x.Id == item.UserId).FirstOrDefaultAsync(); var banckCard = await _context.BankCards.Where(x => x.Id == item.BankCardId).FirstOrDefaultAsync(); var ownerBank = await _context.OwnerBanks.Where(x => x.Id == item.OwnerBankId).FirstOrDefaultAsync(); if (user != null) { var userView = Mapper.Map <AppUser, AppUserViewModel>(user); item.AppUserViewModel = userView; } if (banckCard != null) { var bankCardView = Mapper.Map <BankCard, BankCardViewModel>(banckCard); item.BankCardId = banckCard.Id; item.BankCardViewModel = bankCardView; } if (ownerBank != null) { item.OwnerBankId = ownerBank.Id; item.OwnerBankViewModel = ownerBank; } } if (condition.TransactionType != null) { TransactionType transactionT = (TransactionType)condition.TransactionType; if (transactionT == TransactionType.PayInAndWithdraw) { transactionsViewModel = transactionsViewModel.Where(x => x.TransactionType == TransactionType.PayIn || x.TransactionType == TransactionType.Withdraw).ToList(); } else { transactionsViewModel = transactionsViewModel.Where(x => x.TransactionType == transactionT).ToList(); } } if (condition.BillStatus != null) { BillStatus billS = (BillStatus)condition.BillStatus; transactionsViewModel = transactionsViewModel.Where(x => x.BillStatus == billS).ToList(); } return(transactionsViewModel); } catch (System.Exception) { throw; } }
protected override void OnLoadObjectData(DataRow row) { this.billType = (BillType) Convert.ToChar(row["BillType"]); this.supplyOrderId = (int) row["OrderId"]; this.issuedBy = Contact.Parse((int) row["IssuedById"]); this.issuedTime = (DateTime) row["IssuedTime"]; this.certificateNumber = (string) row["CertificateNumber"]; this.serialNumber = (string) row["BillSerialNumber"]; this.number = (string) row["BillNumber"]; this.approvalYear = (int) row["ApprovalYear"]; this.approvalNumber = (string) row["ApprovalNumber"]; this.digitalString = (string) row["DigitalString"]; this.digitalSign = (string) row["DigitalSign"]; if (((string) row["BillXMLVersion"]).Length != 0) { xml = new System.Xml.XmlDocument(); xml.LoadXml((string) row["BillXMLVersion"]); } if (((string) row["BillStamp"]).Length != 0) { this.stamp = BillStamp.Parse((string) row["BillStamp"]); this.hasStamp = true; } this.canceledBy = Contact.Parse((int) row["CanceledById"]); this.cancelationTime = (DateTime) row["CancelationTime"]; this.status = (BillStatus) Convert.ToChar(row["BillStatus"]); }
public async Task <IActionResult> UpdateStatus(int billId, BillStatus status) { await _billService.UpdateStatusAsync(billId, status); return(new OkResult()); }
private void Create() { Assertion.AssertObject(this.Order, "Empiria.Trade.Billing.Bill.Order"); this.certificateNumber = GetCertificateSerialNumber(); this.serialNumber = this.IssuerData.BillSerialNo; this.approvalYear = this.IssuerData.BillApprovalYear; this.approvalNumber = this.IssuerData.BillApprovalNo; // "859413" / "409777"; this.status = BillStatus.Active; this.Save(); }
public static bool UpdateBillStatus(int billid, BillStatus status) { using (SqlConnection sqlDBConnection = new SqlConnection(ConfigurationManager.ConnectionStrings[Connection.ConnectionName].ConnectionString)) { try { string sqlstmt = "UPDATE [dbo].[Bill] SET status = @status Where id = @id"; SqlCommand myCommand = new SqlCommand(sqlstmt, sqlDBConnection); myCommand.CommandType = CommandType.Text; myCommand.Parameters.AddWithValue("@status", (int)status); myCommand.Parameters.AddWithValue("@id", billid); sqlDBConnection.Open(); myCommand.ExecuteNonQuery(); sqlDBConnection.Close(); } catch (Exception ex) { return false; } } return true; }
public static IEnumerable<WeBill> QueryByStatus(BillStatus status, DateTime begintime, DateTime endtime) { string url = WeUtil.GetUrl(WeShopConst.BILL_STATUS_URL); WeBillStatus request = new WeBillStatus() { Status = status, BeginTime = begintime, EndTime = endtime }; var result = WeUtil.PostToUri(url, request.WriteJson(), new WeBillList()); return result.OrderList; }
public Bill(Guid customerId, string customerName, string customerAddress, string customerMoblie, string customerMessage, BillStatus billStatus, PaymentMethod paymentMethod, Status status) { CustomerId = customerId; CustomerName = customerName; CustomerAddress = customerAddress; CustomerMoblie = customerMoblie; CustomerMessage = customerMessage; BillStatus = billStatus; PaymentMethod = paymentMethod; Status = status; }
public IActionResult UpdateStatus(int billId, BillStatus status) { _billService.UpdateStatus(billId, status); return(new OkResult()); }
private static string GetStatusText(XPathNavigator root, XPathNavigator status, out object details) { try { bool isCurrentSession = true; // default // this doesn't work on index nodes if (root.GetAttribute("session", "") != "") { int session = int.Parse(root.GetAttribute("session", "")); isCurrentSession = (session == Util.CurrentSession); } BillStatus s = EnumsConv.BillStatusFromString(status.Name); switch (s) { case BillStatus.Introduced: /*if ((string)status.Evaluate("name(parent::*)") == "status") * details = new IntroducedDetails(int.Parse((string)root.Evaluate("string(/bill/sponsor/@id)"))); * else if ((string)status.Evaluate("name(parent::*)") == "statusxml") * details = null; * else * details = new IntroducedDetails(int.Parse((string)status.Evaluate("string(@sponsor)")));*/ details = null; if (isCurrentSession) { return("Introduced"); } else { return("Dead"); } case BillStatus.Calendar: details = null; if (isCurrentSession) { return("Reported by Committee"); } else { return("Dead"); } case BillStatus.Vote: case BillStatus.Vote2: if (status.GetAttribute("how", "") == "roll") { string info = ""; try { DateTime date = Util.DTToDateTime(status.GetAttribute("date", "")); string file = GetRollFileName(status.GetAttribute("where", ""), date, int.Parse(status.GetAttribute("roll", ""))) + ".txt"; info = Util.LoadFileString(Util.SessionFromDateTime(date), "gen.rolls-pca" + Path.DirectorySeparatorChar + file); } catch (Exception e) { } details = new VoteDetails( status.GetAttribute("where", "") == "h" ? Chamber.House : Chamber.Senate, Util.DTToDateTime(status.GetAttribute("datetime", "")), int.Parse(status.GetAttribute("roll", "")), status.GetAttribute("result", "") == "pass", info ); } else { details = null; } string result = status.GetAttribute("result", ""); if (result == "pass") { result = "Passed"; } else if (result == "fail") { result = "Failed"; } else { throw new InvalidOperationException("Invalid vote result: " + result); } Chamber chamber = EnumsUtil.BillTypeChamber(EnumsConv.BillTypeFromString(status.GetAttribute("where", ""))); if (s == BillStatus.Vote) { return(result + " " + EnumsConv.ChamberNameShort(chamber)); } else { return("Passed " + EnumsConv.ChamberNameShort(EnumsUtil.Other(chamber)) + ", " + result + " " + EnumsConv.ChamberNameShort(chamber)); } case BillStatus.Conference: details = ""; return("Resolving Differences"); case BillStatus.ToPresident: details = null; return("Sent to President"); case BillStatus.Signed: details = null; return("Signed by President"); case BillStatus.Veto: details = null; return("Vetoed by President"); case BillStatus.Override: details = null; string result1 = status.GetAttribute("result", ""); if (result1 == "pass") { result1 = "Succeeded"; } else if (result1 == "fail") { result1 = "Failed"; } return("Veto Override " + result1); case BillStatus.Enacted: details = null; return("Enacted"); } throw new InvalidOperationException(); } catch (Exception e) { details = null; return("Unknown"); } }