/// <summary> /// 生成发票向导完成事件 /// </summary> protected void FinishInvoice() { var param = GetParam(); var result = new InvoiceBLL().ProcessInvoice(param, GetLoginUserId()); if (result) { // 根据页面选择,展示不同的显示--暂时只支持打印预览 if (param.isShowPrint) { if (param.invoice_batch != 0) { ClientScript.RegisterStartupScript(this.GetType(), "提示信息", "<script>alert('向导完成!');window.close(); self.opener.location.reload();window.open('InvoicePreview?isInvoice=1&inv_batch=" + param.invoice_batch + "','" + (int)EMT.DoneNOW.DTO.OpenWindow.INVOICE_PREVIEW + "','left= 200, top = 200, width = 960, height = 750', false); </script>"); } } else { ClientScript.RegisterStartupScript(this.GetType(), "提示信息", "<script>alert('向导完成!');window.close(); self.opener.location.reload(); </script>"); } } else { ClientScript.RegisterStartupScript(this.GetType(), "提示信息", "<script>alert('向导失败!');window.close(); self.opener.location.reload(); </script>"); } }
//查看单据(单据状态为已审核状态) public ActionResult InvoiceDetail(string id) { ViewBag.types = ListToSelect(SysDataDictService.GetReceiptsCategories().Select(o => new SelectListItem() { Value = o.DicSN.ToString(), Text = o.Title }), emptyTitle: "全部"); var obj = InvoiceBLL.FindById(id); obj.IsNullThrow(); var user = UserInfoService.Find(o => o.UID == obj.CreateUID); if (user != null) { obj.CreateTitle = user.FullName; } var type = SysDataDictService.Find(o => o.DicSN == obj.CategoryId); if (type != null) { ViewData["Category"] = type.Title; } return(View(obj)); }
private static void DeserializeInvoice() { List <Invoice> iList = objValidation.DeserializeInvoiceBLL(); objValidation = new InvoiceBLL(); try { Console.WriteLine("Records from File:"); foreach (Invoice inv in iList) { Console.WriteLine("Invoice No: {0}", inv.InvoiceNo); Console.WriteLine("Invoice Date: {0}", inv.InvoiceDate); Console.WriteLine("Customer Name: {0}", inv.CustomerName); Console.WriteLine("Product Name : {0}", inv.ProductName); Console.WriteLine("Amount : {0}", inv.Amount); } } catch (InvoiceException ex) { Console.WriteLine(ex.Message); } catch (IOException ex) { Console.WriteLine(ex.Message); } catch (Exception ex) { Console.WriteLine(ex.Message); } }
public ActionResult FindPageList(int page = 1, int rows = 30) { int count = 0; var list = InvoiceBLL.FindPageList(Request.Params, out count); return(ToDataGrid(list, count)); }
public static void AddInvoicePL() { try { objValidation = new InvoiceBLL(); Invoice objInvoice = new Invoice(); Console.WriteLine("Enter Invoice No :"); objInvoice.InvoiceNo = Int32.Parse(Console.ReadLine()); Console.WriteLine("Enter Invoice Date :"); objInvoice.InvoiceDate = DateTime.Parse(Console.ReadLine()); Console.WriteLine("Enter Customer Name :"); objInvoice.CustomerName = Console.ReadLine(); Console.WriteLine("Enter Product Name :"); objInvoice.ProductName = Console.ReadLine(); Console.WriteLine("Enter Amount :"); objInvoice.Amount = Int32.Parse(Console.ReadLine()); objValidation.ValidateInvoice(objInvoice); if (objValidation.AddInvoiceBLL(objInvoice)) { Console.WriteLine("Invoice Record added successfully"); } } catch (InvoiceException i) { Console.WriteLine("Error occurred " + i.Message); } }
public void InvoiceBLLHasItemMethod() { //Arrange var data = new List <Items> { new Items() { Id = "1", Quantity = 12, OriginalPrice = 1, SalesPrice = 2, ProductName = "Pen", Status = "Factory New" } }.AsQueryable(); var mockSet = new Mock <DbSet <Items> >(); mockSet.As <IQueryable <Items> >().Setup(m => m.Provider).Returns(data.Provider); mockSet.As <IQueryable <Items> >().Setup(m => m.Expression).Returns(data.Expression); mockSet.As <IQueryable <Items> >().Setup(m => m.ElementType).Returns(data.ElementType); mockSet.As <IQueryable <Items> >().Setup(m => m.GetEnumerator()).Returns(data.GetEnumerator()); var mockContext = new Mock <OfficeStoreContext>(); mockContext.Setup(c => c.Items).Returns(mockSet.Object); InvoiceBLL invoiceBLL = new InvoiceBLL(mockContext.Object); // Act bool HasNotItem = invoiceBLL.HasNotItem("1"); //Assert Assert.IsFalse(HasNotItem); }
protected void process_Click(object sender, EventArgs e) { var param = AssembleModel <InvoiceDealDto>(); param.isInvoiceEmail = is_InvoiceEmail.Checked; string ids = ""; if (accDedIds != null && accDedIds.Count > 0) { foreach (var item in accDedIds) { ids += item + ','; } } param.ids = ids.Substring(0, ids.Length - 1); var result = new InvoiceBLL().ProcessInvoice(param, GetLoginUserId()); if (result) { if (param.invoice_batch != 0) { ClientScript.RegisterStartupScript(this.GetType(), "提示信息", "<script>alert('保存成功!');window.close();self.opener.location.reload();window.open('InvoicePreview?isInvoice=1&inv_batch=" + param.invoice_batch + "','" + (int)EMT.DoneNOW.DTO.OpenWindow.INVOICE_PREVIEW + "','left= 200, top = 200, width = 960, height = 750', false); </script>"); } } else { ClientScript.RegisterStartupScript(this.GetType(), "提示信息", "<script>alert('保存失败!');window.close(); </script>"); } }
protected void Save_Close_Click(object sender, EventArgs e) { string number; string date; date = Request.Form["datevalue"].Trim().ToString(); //获取时间 number = Request.Form["InvoiceNumber"].Trim().ToString(); //获取发票编号 if (string.IsNullOrEmpty(date)) { date = string.Empty; } if (string.IsNullOrEmpty(number)) { number = string.Empty; } var result = new InvoiceBLL().InvoiceNumberAndDate(id, date, number, GetLoginUserId()); if (result == DTO.ERROR_CODE.SUCCESS) { Response.Write("<script>alert('发票修改成功!');window.close();self.opener.location.reload();</script>"); } else if (result == DTO.ERROR_CODE.EXIST) { Response.Write("<script>alert('发票编号已经存在,请修改!');</script>"); } else { Response.Write("<script>alert('发票修改失败!');</script>"); } }
private void btnStatus_Click(object sender, EventArgs e) { using (DialogChangeStatus dl = new DialogChangeStatus()) { string status = ""; DialogResult rs = dl.ShowDialog(); if (rs == DialogResult.Yes) { status = "Incomming"; } else if (rs == DialogResult.OK) { status = "Done"; } else if (rs == DialogResult.No) { status = "Cancel"; } else { return; } InvoiceBLL invoiceBLL = new InvoiceBLL(); invoiceBLL.UpdateStatus(id, status); LoadListViewInvoice(); } }
public PayForm(List <CartItem> cartItems) { InitializeComponent(); this.cartItems = cartItems; this.TotalTxtBox.Text = $"{cartItems.Sum(a => a.Total):f2}"; //Sets text this.FormBorderStyle = FormBorderStyle.FixedDialog; //Disables resizing this.InvoiceBLL = new InvoiceBLL(); }
public void CreateInvoiceBLLClass() { //Arrange & Act InvoiceBLL invoiceBLL = new InvoiceBLL(); //Assert Assert.IsNotNull(invoiceBLL); }
/// <summary> /// 发票处理 /// </summary> /// <param name="context"></param> /// <param name="param"></param> private void ProcessAll(HttpContext context, InvoiceDealDto param) { bool result = false; result = new InvoiceBLL().ProcessInvoice(param, LoginUserId); context.Response.Write(result); }
public frmStock() { productBLL = new ProductBLL(dbHelper); stockBLL = new StockBLL(dbHelper); invoiceBLL = new InvoiceBLL(dbHelper); InitializeComponent(); FillCombo(); FillGrid(); this.dvStock.AllowUserToAddRows = false; }
public void InvoiceBLLShowRecipeMethod() { //Arrange InvoiceBLL invoiceBLL = new InvoiceBLL(); // Act string Recipe = invoiceBLL.ShowRecipe(); //Assert Assert.IsNotNull(Recipe); }
public frmInvoiceReport() { this.prnDialog = new System.Windows.Forms.PrintDialog(); this.prnPreview = new System.Windows.Forms.PrintPreviewDialog(); this.prnDocument = new System.Drawing.Printing.PrintDocument(); // The Event of 'PrintPage' prnDocument.PrintPage += new System.Drawing.Printing.PrintPageEventHandler(prnDocument_PrintPage); invoiceBLL = new InvoiceBLL(dbHelper); productBLL = new ProductBLL(dbHelper); InitializeComponent(); }
public InvoiceForm() { InitializeComponent(); this.cartItems = new List <CartItem>(); this.InvoiceBLL = new InvoiceBLL(); this.InvoiceCount = this.InvoiceBLL.InvoiceCount(); this.FormBorderStyle = FormBorderStyle.FixedDialog; //Disables Resizing DesignConfigurator(); //Improves DataGride design this.ActiveControl = this.ScanBarcodeTxtBox; GenrateCustomerInfoListBox(); }
protected void save_close_Click(object sender, EventArgs e) { long?blockId = null; if (!string.IsNullOrEmpty(Request.Form["ToblockSelect"])) { blockId = long.Parse(Request.Form["ToblockSelect"]); } bool result = new InvoiceBLL().MoveDeduction(deduction.id, blockId, LoginUserId); ClientScript.RegisterStartupScript(this.GetType(), "提示信息", $"<script>alert('保存{(result?"成功":"失败")}!');self.opener.location.reload();window.close();</script>"); }
public ResponseInvoiceGet InvoiceGet([FromBody] RequestInvoiceGet request) { try { InvoiceBLL bll = new InvoiceBLL(); return(bll.InvoiceGet(request)); } catch (Exception ex) { throw new HttpResponseException( Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message)); } }
public ResponseInvoiceCX UploadFile() { try { InvoiceBLL bll = new InvoiceBLL(); return(bll.UploadFile()); } catch (Exception ex) { throw new HttpResponseException( Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message)); } }
public void GetBatch_id(HttpContext context, int id) { int a_id = new InvoiceBLL().GetBatch_id(id); if (a_id > 0) { context.Response.Write(a_id); } else { context.Response.Write("-1"); } }
protected void save_close_Click(object sender, EventArgs e) { var param = GetParam(); var result = new InvoiceBLL().PreferencesInvoice(param, GetLoginUserId()); if (result) { ClientScript.RegisterStartupScript(this.GetType(), "提示信息", "<script>alert('保存成功!');window.close(); </script>"); // 跳转到预览界面 } else { ClientScript.RegisterStartupScript(this.GetType(), "提示信息", "<script>alert('保存失败!');window.close(); </script>"); } }
protected void ddlCharges_SelectedIndexChanged(object sender, EventArgs e) { var ddlCharges = (DropDownList)grvInvoice.FooterRow.FindControl("ddlCharges"); var txtSTax = (TextBox)grvInvoice.FooterRow.FindControl("lblStax"); var ddlCurrency = (DropDownList)grvInvoice.FooterRow.FindControl("ddlCurrency"); var txtConvRate = (TextBox)grvInvoice.FooterRow.FindControl("txtConvRate"); DataTable dtCharge = new InvoiceBLL().GetCreChargeDetails(Convert.ToInt32(ddlCharges.SelectedValue)); //DataTable dtSTax = new InvoiceBLL().GetServiceTax(Convert.ToDateTime(txtReferenceDate.Text)); if (dtCharge.Rows.Count > 0) { ddlCurrency.SelectedValue = dtCharge.Rows[0]["Currency"].ToString(); ddlCurrency_SelectedIndexChanged(null, null); } }
private static void SerializeInvoice() { try { objValidation = new InvoiceBLL(); objValidation.SerializeInvoiceBLL(); //Call the function Console.WriteLine("Invoice Record stored in File"); } catch (InvoiceException ex) { Console.WriteLine(ex.Message); } catch (IOException ex) { Console.WriteLine(ex.Message); } catch (Exception ex) { Console.WriteLine(ex.Message); } }
public void InvoiceBLLCount() { var data = new List <Invoice> { new Invoice() }.AsQueryable(); var mockSet = new Mock <DbSet <Invoice> >(); mockSet.As <IQueryable <Invoice> >().Setup(m => m.Provider).Returns(data.Provider); mockSet.As <IQueryable <Invoice> >().Setup(m => m.Expression).Returns(data.Expression); mockSet.As <IQueryable <Invoice> >().Setup(m => m.ElementType).Returns(data.ElementType); mockSet.As <IQueryable <Invoice> >().Setup(m => m.GetEnumerator()).Returns(data.GetEnumerator()); var mockContext = new Mock <OfficeStoreContext>(); mockContext.Setup(c => c.Invoice).Returns(mockSet.Object); var service = new InvoiceBLL(mockContext.Object); Assert.IsTrue(service.InvoiceCount() == 1); }
public static void DisplayInvoicePL() { try { objValidation = new InvoiceBLL(); INV_BLL.InvoiceBLL bllobj = new InvoiceBLL(); List <Invoice> iList = new List <Invoice>(); iList = bllobj.DisplayInvoiceBLL(); Console.WriteLine("Invoice Details"); Console.WriteLine("================="); foreach (Invoice i in iList) { Console.WriteLine("Invoice No :{0}\n Invoice Date :{1} \n Customer Name :{2} \n Product Name : {3} \n Amount : {4}", i.InvoiceNo, i.InvoiceDate, i.CustomerName, i.ProductName, i.Amount); } } catch (InvoiceException i) { Console.WriteLine(i.Message); } }
private static void DeleteInvoice() { objValidation = new InvoiceBLL(); try { Console.WriteLine("Enter Invoice No to be deleted:"); int empId = Int32.Parse(Console.ReadLine()); bool isDeleted = objValidation.DeleteInvoiceBLL(empId); if (isDeleted) { Console.WriteLine("Record Deleted!! "); } } catch (InvoiceException ex) { Console.WriteLine(ex.Message); } catch (Exception ex) { Console.WriteLine(ex.Message); } }
private void CalculateServiceTax() { decimal TaxPer = 0; decimal TaxCess = 0; decimal TaxAddCess = 0; decimal serviceTax = 0; decimal cessAmount = 0; decimal addCess = 0; decimal CrnTot = 0; decimal grossAmount = Convert.ToDecimal(txtCNAmount.Text); DataTable dtSTax = new InvoiceBLL().GetServiceTax(Convert.ToDateTime(txtInvoiceDate.Text)); if (dtSTax != null && dtSTax.Rows.Count > 0) { //TaxPer = Convert.ToDecimal(dtSTax.Rows[0]["TaxPer"].ToString()); TaxPer = txtStaxper.Text.ToDecimal(); TaxCess = Convert.ToDecimal(dtSTax.Rows[0]["TaxCess"].ToString()); TaxAddCess = Convert.ToDecimal(dtSTax.Rows[0]["TaxAddCess"].ToString()); } if (Convert.ToDecimal(txtChargeServiceTax.Text) > 0) { serviceTax = Math.Round((grossAmount * TaxPer) / 100, 2); cessAmount = Math.Round((serviceTax * TaxCess) / 100, 2); addCess = Math.Round((serviceTax * TaxAddCess) / 100, 2); } CrnTot = grossAmount + serviceTax + cessAmount + addCess; txtCNServiceTax.Text = (serviceTax + cessAmount + addCess).ToString(); //txtTotal.Text = CrnTot.ToString(); ViewState["CESSAMOUNT"] = cessAmount; ViewState["ADDCESS"] = addCess; ViewState["STAX"] = serviceTax; //ViewState["CRNTOT"] = CrnTot; }
//新增单据/修改单据(单据状态为待审核状态) public ActionResult InvoiceSave(string id) { ViewBag.types = ListToSelect(SysDataDictService.GetReceiptsCategories().Select(o => new SelectListItem() { Value = o.DicSN.ToString(), Text = o.Title }), emptyTitle: "请选择"); var supplierForAdd = SupplierService.Find(o => o.Id == Pharos.Sys.SupplierUser.SupplierId); var obj = new Receipts() { CreateTitle = supplierForAdd.Title, CreateDT = DateTime.Now }; //CreateTitle = CurrentUser.FullName if (!id.IsNullOrEmpty()) { obj = InvoiceBLL.FindById(id); obj.IsNullThrow(); var supplier = SupplierService.Find(o => o.Id == obj.CreateUID); if (supplier != null) { obj.CreateTitle = supplier.Title; } } return(View(obj)); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { VerificationUtility ver = new VerificationUtility(); ver.JudgeOperate(this.Page, 117, new List<OperateEnum>() { OperateEnum.提交审核, OperateEnum.作废, OperateEnum.撤返, OperateEnum.执行完成, OperateEnum.执行完成撤销 }); this.navigation1.Routes.Add("财务发票列表", "FinanceInvoiceList.aspx"); this.navigation1.Routes.Add("财务发票明细", string.Empty); UserModel user = UserUtility.CurrentUser; ResultModel result = new ResultModel(); int invoiceId = 0; if (string.IsNullOrEmpty(Request.QueryString["iid"]) || !int.TryParse(Request.QueryString["iid"], out invoiceId)) invoiceId = 0; int fundsInvoiceId = 0; if (invoiceId == 0 && (string.IsNullOrEmpty(Request.QueryString["id"]) || !int.TryParse(Request.QueryString["id"], out fundsInvoiceId))) Response.Redirect("FinanceInvoiceList.aspx"); //获取财务发票 FinanceInvoiceBLL financeInvoiceBLL = new FinanceInvoiceBLL(); if (invoiceId > 0) result = financeInvoiceBLL.GetByInvoiceId(user, invoiceId); else result = financeInvoiceBLL.Get(user, fundsInvoiceId); if (result.ResultStatus != 0) Response.Redirect("FinanceInvoiceList.aspx"); FinanceInvoice fundsInvoice = result.ReturnValue as FinanceInvoice; if (fundsInvoice == null || fundsInvoice.FinanceInvoiceId <= 0) Response.Redirect("FinanceInvoiceList.aspx"); this.curFundsInvoice = fundsInvoice; //获取主发票信息 InvoiceBLL invoiceBLL = new InvoiceBLL(); result = invoiceBLL.Get(user, fundsInvoice.InvoiceId); if (result.ResultStatus != 0) Response.Redirect("FinanceInvoiceList.aspx"); NFMT.Operate.Model.Invoice invoice = result.ReturnValue as NFMT.Operate.Model.Invoice; if (invoice == null || invoice.InvoiceId <= 0) Response.Redirect("FinanceInvoiceList.aspx"); this.curInvoice = invoice; FinBusInvAllotDetailBLL finBusInvAllotDetailBLL = new FinBusInvAllotDetailBLL(); result = finBusInvAllotDetailBLL.GetBIds(user, fundsInvoice.FinanceInvoiceId); if (result.ResultStatus != 0) Response.Redirect("FinanceInvoiceList.aspx"); this.hidsids.Value = result.ReturnValue.ToString(); string dirStr = "开出"; if (invoice.InvoiceDirection == 34) { dirStr = "收入"; outSelf = 0; inSelf = 1; } invoiceDirection = invoice.InvoiceDirection; //title init this.titInvDate.InnerHtml = string.Format("{0}日期:", dirStr); JavaScriptSerializer serializer = new JavaScriptSerializer(); string json = serializer.Serialize(invoice); this.hidModel.Value = json; //attach this.attach1.BusinessIdValue = this.curInvoice.InvoiceId; } }
private void LoadListViewInvoice() { InvoiceBLL invoiceBLL = new InvoiceBLL(); DataTable dataTable = null; if (clickSearch) { string status = ""; int code = -1; if (!txtMadon.Text.Equals("")) { code = int.Parse(txtMadon.Text); } string namecus = txtNameCus.Text; if (comboBoxStatus.SelectedItem.Equals("Đang giao hàng")) { status = "InComming"; } else if (comboBoxStatus.SelectedItem.Equals("Đã Thanh toán")) { status = "Done"; } else if (comboBoxStatus.SelectedItem.Equals("Hủy")) { status = "Cancel"; } dataTable = invoiceBLL.Search(status, code, namecus); } else { dataTable = invoiceBLL.GetAllInvoice(); } listViewInvoice.Clear(); listViewInvoice.View = View.Details; listViewInvoice.FullRowSelect = true; listViewInvoice.Columns.Add("#", 20); listViewInvoice.Columns.Add("Tên khách hàng", 100); listViewInvoice.Columns.Add("Số lượng", 20); listViewInvoice.Columns.Add("Tổng tiền", 70); listViewInvoice.Columns.Add("Ngày tạo", 70); listViewInvoice.Columns.Add("Mã bưu điện", 60); listViewInvoice.Columns.Add("Status", 60); listViewInvoice.Columns.Add("Ghi Chú", 200); listViewInvoice.Columns.Add("Địa chỉ giao hàng", 200); loadkhaibaoviewdetail(); ListViewItem lvitem; foreach (DataRow row in dataTable.Rows) { lvitem = new ListViewItem(); lvitem.Text = row.Field <int>("Id").ToString(); string cusname = row.Field <string>("FirstName") + " " + row.Field <string>("LastName"); lvitem.SubItems.Add(cusname); lvitem.SubItems.Add(row.Field <string>("amount")); lvitem.SubItems.Add(int.Parse(row.Field <string>("TotalMoney")).ToString("0,0")); lvitem.SubItems.Add(row.Field <DateTime>("CreateDay").ToString()); lvitem.SubItems.Add(row.Field <string>("Postcode")); lvitem.SubItems.Add(row.Field <string>("status")); lvitem.SubItems.Add(row.Field <string>("Ordernote")); lvitem.SubItems.Add(row.Field <string>("CustomerAddress")); listViewInvoice.Items.Add(lvitem); } }
private void listview_Invoice_click(object sender, EventArgs e) { id = int.Parse(listViewInvoice.SelectedItems[0].Text); InvoiceBLL invoiceBLL = new InvoiceBLL(); DataTable dataTable = invoiceBLL.GetInvoiceDetail(id); string js_product = dataTable.Rows[0][2].ToString(); string js_combo = dataTable.Rows[0][3].ToString(); JArray rs_prd = (JArray)JsonConvert.DeserializeObject(js_product); JArray rs_combo = (JArray)JsonConvert.DeserializeObject(js_combo); ArrayList arr_product = new ArrayList(); ArrayList arr_combo = new ArrayList(); ListViewItem lvitem; if (rs_prd != null) { foreach (JObject obj in rs_prd) { Product product = new Product(); product = obj["Product"].ToObject <Product>(); arr_product.Add(product); } } if (rs_combo != null) { foreach (JObject obj in rs_combo) { Combo combo = new Combo(); combo = obj["Combo"].ToObject <Combo>(); arr_combo.Add(combo); } } LoadImage(arr_product, arr_combo); loadkhaibaoviewdetail(); int thanhtien = 0; if (rs_prd != null) { foreach (JObject obj in rs_prd) { Product product = new Product(); product = obj["Product"].ToObject <Product>(); lvitem = new ListViewItem(); int quantity = (int)obj["Quantity"]; int tongcong = quantity * product.price; thanhtien += tongcong; lvitem.ImageKey = product.id.ToString(); lvitem.SubItems.Add(product.productname); lvitem.SubItems.Add(quantity.ToString()); lvitem.SubItems.Add(product.price.ToString("0,0")); lvitem.SubItems.Add(tongcong.ToString("0,0")); listViewInvoiceDetail.Items.Add(lvitem); } } if (rs_combo != null) { foreach (JObject obj in rs_combo) { Combo combo = new Combo(); combo = obj["Combo"].ToObject <Combo>(); lvitem = new ListViewItem(); int quantity = (int)obj["Quantity"]; int tongcong = quantity * combo.total; thanhtien += tongcong; lvitem.ImageKey = combo.Id.ToString(); lvitem.SubItems.Add(combo.comboName); lvitem.SubItems.Add(quantity.ToString()); lvitem.SubItems.Add(combo.total.ToString("0,0")); lvitem.SubItems.Add(tongcong.ToString("0,0")); listViewInvoiceDetail.Items.Add(lvitem); } } txtThanhtien.Text = thanhtien.ToString("0,0"); }