protected void Page_Load(object sender, EventArgs e) { EmployeeLogic el = new EmployeeLogic(); Employee e2 = el.SelectByID(Convert.ToInt32(Session["EmployeeID"])); if (e2.Designation.Equals("STOCK MANAGER") || e2.Designation.Equals("STOCK EMPLOYEE") || e2.Designation.Equals("MANAGING DIRECTOR") || e2.Designation.Equals("CHAIRMAN")) { SupplierLogic SL = new SupplierLogic(); DataTable dt = SL.SelectAll(); Repeater1.DataSource = dt; Repeater1.DataBind(); if (dt.Rows.Count == 0) { Table1.Visible = false; Label1.Visible = true; } else { Table1.Visible = true; Label1.Visible = false; } } else { Response.Redirect("Access.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { EmployeeLogic el = new EmployeeLogic(); Employee e2 = el.SelectByID(Convert.ToInt32(Session["EmployeeID"])); if (e2.Designation.Equals("STOCK MANAGER") || e2.Designation.Equals("STOCK EMPLOYEE") || e2.Designation.Equals("MANAGING DIRECTOR") || e2.Designation.Equals("CHAIRMAN")) { if (!IsPostBack) { SupplierLogic SL = new SupplierLogic(); DataTable dt = SL.SelectHistory(Convert.ToInt32(Request.QueryString["ID"])); Repeater1.DataSource = dt; Repeater1.DataBind(); if (dt.Rows.Count == 0) { Table1.Visible = false; Label2.Visible = true; } else { Table1.Visible = true; Label2.Visible = false; Label1.Text = dt.Rows[0]["Name"].ToString(); } } } else { Response.Redirect("Access.aspx"); } }
protected void Button2_Click(object sender, EventArgs e) { SupplierLogic SL = new SupplierLogic(); DateTime d1 = new DateTime(); DateTime d2 = new DateTime(); if (!DateTime.TryParseExact(TextBox2.Text, "dd/MM/yyyy", null, System.Globalization.DateTimeStyles.None, out d1)) { d1 = DateTime.Now.AddYears(-100); } if (!DateTime.TryParseExact(TextBox3.Text, "dd/MM/yyyy", null, System.Globalization.DateTimeStyles.None, out d2)) { d2 = DateTime.Now.AddYears(10); } DataTable dt = SL.SearchHistory(Convert.ToInt32(Request.QueryString["ID"]),TextBox1.Text,d1,d2); Repeater1.DataSource = dt; Repeater1.DataBind(); if (dt.Rows.Count == 0) { Table1.Visible = false; Label2.Visible = true; } else { Table1.Visible = true; Label2.Visible = false; } }
protected void Button1_Click(object sender, EventArgs e) { if ((Convert.ToInt32(Request.QueryString["id"])) > 0) { Supplier s1 = new Supplier(); s1.Name = TextBox1.Text; s1.Phone = TextBox8.Text; s1.Email = TextBox2.Text; s1.ContactPerson = TextBox3.Text; s1.SupplierID = Convert.ToInt32(Request.QueryString["id"]); SupplierLogic sl = new SupplierLogic(); sl.Update(s1); Response.Redirect("SupplierList.aspx"); } else { Supplier s1 = new Supplier(); s1.Name = TextBox1.Text; s1.Phone = TextBox8.Text; s1.Email = TextBox2.Text; s1.ContactPerson = TextBox3.Text; SupplierLogic sl = new SupplierLogic(); sl.Insert(s1); Response.Redirect("SupplierList.aspx"); } }
protected void Button2_Click(object sender, EventArgs e) { SupplierLogic SL = new SupplierLogic(); DateTime d1 = new DateTime(); DateTime d2 = new DateTime(); if (!DateTime.TryParseExact(TextBox2.Text, "dd/MM/yyyy", null, System.Globalization.DateTimeStyles.None, out d1)) { d1 = DateTime.Now.AddYears(-100); } if (!DateTime.TryParseExact(TextBox3.Text, "dd/MM/yyyy", null, System.Globalization.DateTimeStyles.None, out d2)) { d2 = DateTime.Now.AddYears(10); } DataTable dt = SL.SearchHistory(Convert.ToInt32(Request.QueryString["ID"]), TextBox1.Text, d1, d2); Repeater1.DataSource = dt; Repeater1.DataBind(); if (dt.Rows.Count == 0) { Table1.Visible = false; Label2.Visible = true; } else { Table1.Visible = true; Label2.Visible = false; } }
public DataController(ProductGroupLogic productGroupLogic, ProductLogic productLogic, SupplierLogic supplierLogic, ExportLogic exportLogic, SaleLogic saleLogic) { _productGroupLogic = productGroupLogic; _productLogic = productLogic; _supplierLogic = supplierLogic; _exportLogic = exportLogic; _saleLogic = saleLogic; }
public FormEquipment(TypeLogic typeLogic, EmployeeLogic employeeLogic, SupplierLogic supplierLogic, EquipmentLogic equipmentLogic) { InitializeComponent(); this.typeLogic = typeLogic; this.employeeLogic = employeeLogic; this.supplierLogic = supplierLogic; this.equipmentLogic = equipmentLogic; }
protected void Page_Load(object sender, EventArgs e) { EmployeeLogic el = new EmployeeLogic(); Employee e2 = el.SelectByID(Convert.ToInt32(Session["EmployeeID"])); if (e2.Designation.Equals("STOCK MANAGER") || e2.Designation.Equals("STOCK EMPLOYEE") || e2.Designation.Equals("MANAGING DIRECTOR") || e2.Designation.Equals("CHAIRMAN") || e2.Designation.Equals("PRODUCTION MANAGER") || e2.Designation.Equals("PRODUCTION EMPLOYEE")) { if (!IsPostBack) { RawMaterialLogic RL = new RawMaterialLogic(); DataTable dt = RL.SelectAllJoined(); Repeater1.DataSource = dt; Repeater1.DataBind(); if (dt.Rows.Count == 0) { Table1.Visible = false; Label1.Visible = true; } else { Table1.Visible = true; Label1.Visible = false; } RawMaterialLogic rl = new RawMaterialLogic(); DataTable dt1 = rl.SelectAll(); dt1.Rows.Add(0, null, null, null, null, null, null, "All Category", null); dt1.DefaultView.Sort = "SupplierID"; DropDownList1.DataSource = dt1; DropDownList1.DataTextField = "Category"; DropDownList1.DataValueField = "SupplierID"; //DropDownList1.DataBind(); DropDownList1.SelectedItem.Text = "All Category"; SupplierLogic sl = new SupplierLogic(); DataTable dt2 = sl.SelectAll(); dt2.Rows.Add(0, "All Supplier", null, null, null); dt2.DefaultView.Sort = "SupplierID"; DropDownList2.DataSource = dt2; DropDownList2.DataTextField = "Name"; DropDownList2.DataValueField = "SupplierID"; DropDownList2.DataBind(); DropDownList2.SelectedItem.Text = "All Supplier"; } } else { Response.Redirect("Access.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { EmployeeLogic el = new EmployeeLogic(); Employee e2 = el.SelectByID(Convert.ToInt32(Session["EmployeeID"])); if (e2.Designation.Equals("STOCK MANAGER") || e2.Designation.Equals("STOCK EMPLOYEE")) { if (!IsPostBack) { if (Convert.ToInt32(Request.QueryString["id"]) > 0) { RawMaterialLogic rl = new RawMaterialLogic(); RawMaterial r1 = rl.SelectByID(Convert.ToInt32(Request.QueryString["id"])); TextBox2.Text = r1.Name; TextBox3.Text = r1.Code.ToString(); TextArea1.Text = r1.Descrition; TextBox4.Text = r1.Unit; TextBox5.Text = r1.MinQuantity.ToString(); SupplierLogic sl = new SupplierLogic(); DropDownList1.DataSource = sl.SelectAll(); DropDownList1.DataTextField = "Name"; DropDownList1.DataValueField = "SupplierID"; DropDownList1.DataBind(); Supplier s = sl.SelectByID(r1.SupplierID); DropDownList1.SelectedItem.Text = s.Name; DropDownList2.SelectedItem.Text = r1.Category; DropDownList3.SelectedItem.Text = r1.Type; } else { SupplierLogic sl = new SupplierLogic(); DropDownList1.DataSource = sl.SelectAll(); DropDownList1.DataTextField = "Name"; DropDownList1.DataValueField = "SupplierID"; DropDownList1.DataBind(); } } } else { Response.Redirect("Access.aspx"); } }
protected void Button2_Click(object sender, EventArgs e) { SupplierLogic sl = new SupplierLogic(); DataTable dt = sl.Search(TextBox1.Text); Repeater1.DataSource = dt; Repeater1.DataBind(); if (dt.Rows.Count == 0) { Table1.Visible = false; Label1.Visible = true; } else { Table1.Visible = true; Label1.Visible = false; } }
/// <summary> /// SupplierList /// </summary> public void SupplierList() { SupplierLogic supplierLogic = new SupplierLogic(); DataTable dt = supplierLogic.GetAllSupplier(); //Hiển thị câu thông báo không có item nào if (dt.Rows.Count != 0) { pnl_supplier.Visible = true; dtl_supplier.DataSource = dt; dtl_supplier.DataBind(); } else { pnl_supplier.Visible = false; } }
protected void LinkButton1_Command(object sender, CommandEventArgs e) { EmployeeLogic el = new EmployeeLogic(); Employee e2 = el.SelectByID(Convert.ToInt32(Session["EmployeeID"])); if (e2.Designation.Equals("STOCK MANAGER") || e2.Designation.Equals("STOCK EMPLOYEE")) { SupplierLogic sl = new SupplierLogic(); Supplier e1 = sl.SelectByID(Convert.ToInt32(e.CommandArgument)); if (e1 != null) { int i = sl.Delete(e1.SupplierID); Response.Redirect("SupplierList.aspx"); } } else { Response.Redirect("Access.aspx"); } }
protected void Btn_Add_Click(object sender, EventArgs e) { SupplierInfoModel supplierInfoModel = new SupplierInfoModel(); supplierInfoModel.SupplierName = this.NewSupplierName.Text; supplierInfoModel.SupplierLawyer = this.NewSupplierLawyer.Text; supplierInfoModel.SupplierTelephone = this.NewSupplierTelephone.Text; supplierInfoModel.SupplierAddress = this.NewSupplierAddress.Text; SupplierLogic supplierLogic = new SupplierLogic(); if (supplierLogic.AddSupplierInfo(supplierInfoModel)) { Response.Write("<script>alert('供应商信息登记成功!');location.href='SupplierManage.aspx';</script>"); } else { Response.Write("<script>alert('" + supplierLogic.ErrMessage + "');location.href='SupplierManage.aspx';</script>"); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { EmployeeLogic el = new EmployeeLogic(); Employee e2 = el.SelectByID(Convert.ToInt32(Session["EmployeeID"])); if (e2.Designation.Equals("STOCK MANAGER") || e2.Designation.Equals("STOCK EMPLOYEE") || e2.Designation.Equals("MANAGING DIRECTOR") || e2.Designation.Equals("CHAIRMAN") || e2.Designation.Equals("PRODUCTION MANAGER") || e2.Designation.Equals("PRODUCTION EMPLOYEE")) { RawMaterialLogic rl = new RawMaterialLogic(); RawMaterial r1 = rl.SelectByID(Convert.ToInt32(Request.QueryString["id"])); SupplierLogic sl = new SupplierLogic(); if (r1 != null) { Label1.Text = r1.Name; Label2.Text = r1.Code.ToString(); Label3.Text = r1.Descrition; Label4.Text = r1.Unit; Label5.Text = r1.MinQuantity.ToString(); Supplier s1 = sl.SelectByID(r1.SupplierID); if (s1 != null) { Label6.Text = s1.Name; } else { Label6.Text = "-----"; } Label7.Text = r1.Category; Label8.Text = r1.Type; } } else { Response.Redirect("Access.aspx"); } } }
protected void Page_Load(object sender, EventArgs e) { EmployeeLogic el = new EmployeeLogic(); Employee e2 = el.SelectByID(Convert.ToInt32(Session["EmployeeID"])); if (e2.Designation.Equals("STOCK MANAGER") || e2.Designation.Equals("STOCK EMPLOYEE")) { if (!IsPostBack) { SupplierLogic sl = new SupplierLogic(); Supplier s1 = sl.SelectByID(Convert.ToInt32(Request.QueryString["id"])); TextBox1.Text = s1.Name; TextBox2.Text = s1.Email; TextBox3.Text = s1.ContactPerson; TextBox8.Text = s1.Phone; } } else { Response.Redirect("Access.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { EmployeeLogic el = new EmployeeLogic(); Employee e2 = el.SelectByID(Convert.ToInt32(Session["EmployeeID"])); if (e2.Designation.Equals("STOCK MANAGER") || e2.Designation.Equals("STOCK EMPLOYEE") || e2.Designation.Equals("MANAGING DIRECTOR") || e2.Designation.Equals("CHAIRMAN")) { SupplierLogic sl = new SupplierLogic(); Supplier c1 = sl.SelectByID(Convert.ToInt32(Request.QueryString["id"])); if (c1 != null) { Label1.Text = c1.Name; Label2.Text = c1.Email; Label3.Text = c1.ContactPerson; Label4.Text = c1.Phone; } } else { Response.Redirect("Access.aspx"); } }
public FormSupplier(SupplierLogic supplierLogic) { InitializeComponent(); this.supplierLogic = supplierLogic; }
public ApiModule() : base("/api") { #region /// Help Page /// Get["/help"] = x => View["help"]; #endregion #region /// Category /// #region /// /api/Categories/ /// Get["/categories"] = x => { var logic = new CategoryLogic(); var result = logic.GetAll(); return Response.AsJson(result); }; #endregion #region /// /api/Categories/1234 /// Get["/categories/{id:int}"] = x => { var logic = new CategoryLogic(); var result = logic.GetById((int)x.id); return Response.AsJson(result); }; #endregion #endregion #region /// Customer /// #region /// /api/Customers/ /// Get["/customers"] = x => { var logic = new CustomerLogic(); var result = logic.GetAll(); return Response.AsJson(result); }; #endregion #region /// /api/Customers/1234 /// Get["/customers/{id*}"] = x => { var logic = new CustomerLogic(); var result = logic.GetById((string)x.id); return Response.AsJson(result); }; #endregion #endregion #region /// Employee /// #region /// /api/employees /// Get["/employees"] = x => { var logic = new EmployeeLogic(); var result = logic.GetAll(); return Response.AsJson(result); }; #endregion #region /// /api/employees/1234 /// Get["/employees/{id:int}"] = x => { var logic = new EmployeeLogic(); var result = logic.GetById((int)x.id); return Response.AsJson(result); }; #endregion #endregion #region /// Order /// #region /// /api/Orders/ /// Get["/orders"] = x => { var logic = new OrderLogic(); var result = logic.GetAll(); return Response.AsJson(result); }; #endregion #region /// /api/Orders/1234 /// Get["/orders/{id:int}"] = x => { var logic = new OrderLogic(); var result = logic.GetById((int)x.id); return Response.AsJson(result); }; #endregion #endregion #region /// Product /// #region /// /api/Products/ /// Get["/products"] = x => { var logic = new ProductLogic(); var result = logic.GetAll(); return Response.AsJson(result); }; #endregion #region /// /api/Products/1234 /// Get["/products/{id:int}"] = x => { var logic = new ProductLogic(); var result = logic.GetById((int)x.id); return Response.AsJson(result); }; #endregion #endregion #region /// Region /// #region /// /api/Regions/ /// Get["/regions"] = x => { var logic = new RegionLogic(); var result = logic.GetAll(); return Response.AsJson(result); }; #endregion #region /// /api/Regions/1234 /// Get["/regions/{id:int}"] = x => { var logic = new RegionLogic(); var result = logic.GetById((int)x.id); return Response.AsJson(result); }; #endregion #endregion #region /// Shipper /// #region /// /api/Shippers/ /// Get["/shippers"] = x => { var logic = new ShipperLogic(); var result = logic.GetAll(); return Response.AsJson(result); }; #endregion #region /// /api/Shippers/1234 /// Get["/shippers/{id:int}"] = x => { var logic = new ShipperLogic(); var result = logic.GetById((int)x.id); return Response.AsJson(result); }; #endregion #endregion #region /// Supplier /// #region /// /api/Suppliers/ /// Get["/suppliers"] = x => { var logic = new SupplierLogic(); var result = logic.GetAll(); return Response.AsJson(result); }; #endregion #region /// /api/Suppliers/1234 /// Get["/suppliers/{id:int}"] = x => { var logic = new SupplierLogic(); var result = logic.GetById((int)x.id); return Response.AsJson(result); }; #endregion #endregion #region /// Territory /// #region /// /api/Territories/ /// Get["/territories"] = x => { var logic = new TerritoryLogic(); var result = logic.GetAll(); return Response.AsJson(result); }; #endregion #region /// /api/Territories/1234 /// Get["/territories/{id:string}"] = x => { var logic = new TerritoryLogic(); var result = logic.GetById((string)x.id); return Response.AsJson(result); }; #endregion #endregion }
public ApiModule() : base("/api") { #region /// Help Page /// Get["/help"] = x => View["help"]; #endregion #region /// Category /// #region /// /api/Categories/ /// Get["/categories"] = x => { var logic = new CategoryLogic(); var result = logic.GetAll(); return(Response.AsJson(result)); }; #endregion #region /// /api/Categories/1234 /// Get["/categories/{id:int}"] = x => { var logic = new CategoryLogic(); var result = logic.GetById((int)x.id); return(Response.AsJson(result)); }; #endregion #endregion #region /// Customer /// #region /// /api/Customers/ /// Get["/customers"] = x => { var logic = new CustomerLogic(); var result = logic.GetAll(); return(Response.AsJson(result)); }; #endregion #region /// /api/Customers/1234 /// Get["/customers/{id*}"] = x => { var logic = new CustomerLogic(); var result = logic.GetById((string)x.id); return(Response.AsJson(result)); }; #endregion #endregion #region /// Employee /// #region /// /api/employees /// Get["/employees"] = x => { var logic = new EmployeeLogic(); var result = logic.GetAll(); return(Response.AsJson(result)); }; #endregion #region /// /api/employees/1234 /// Get["/employees/{id:int}"] = x => { var logic = new EmployeeLogic(); var result = logic.GetById((int)x.id); return(Response.AsJson(result)); }; #endregion #endregion #region /// Order /// #region /// /api/Orders/ /// Get["/orders"] = x => { var logic = new OrderLogic(); var result = logic.GetAll(); return(Response.AsJson(result)); }; #endregion #region /// /api/Orders/1234 /// Get["/orders/{id:int}"] = x => { var logic = new OrderLogic(); var result = logic.GetById((int)x.id); return(Response.AsJson(result)); }; #endregion #endregion #region /// Product /// #region /// /api/Products/ /// Get["/products"] = x => { var logic = new ProductLogic(); var result = logic.GetAll(); return(Response.AsJson(result)); }; #endregion #region /// /api/Products/1234 /// Get["/products/{id:int}"] = x => { var logic = new ProductLogic(); var result = logic.GetById((int)x.id); return(Response.AsJson(result)); }; #endregion #endregion #region /// Region /// #region /// /api/Regions/ /// Get["/regions"] = x => { var logic = new RegionLogic(); var result = logic.GetAll(); return(Response.AsJson(result)); }; #endregion #region /// /api/Regions/1234 /// Get["/regions/{id:int}"] = x => { var logic = new RegionLogic(); var result = logic.GetById((int)x.id); return(Response.AsJson(result)); }; #endregion #endregion #region /// Shipper /// #region /// /api/Shippers/ /// Get["/shippers"] = x => { var logic = new ShipperLogic(); var result = logic.GetAll(); return(Response.AsJson(result)); }; #endregion #region /// /api/Shippers/1234 /// Get["/shippers/{id:int}"] = x => { var logic = new ShipperLogic(); var result = logic.GetById((int)x.id); return(Response.AsJson(result)); }; #endregion #endregion #region /// Supplier /// #region /// /api/Suppliers/ /// Get["/suppliers"] = x => { var logic = new SupplierLogic(); var result = logic.GetAll(); return(Response.AsJson(result)); }; #endregion #region /// /api/Suppliers/1234 /// Get["/suppliers/{id:int}"] = x => { var logic = new SupplierLogic(); var result = logic.GetById((int)x.id); return(Response.AsJson(result)); }; #endregion #endregion #region /// Territory /// #region /// /api/Territories/ /// Get["/territories"] = x => { var logic = new TerritoryLogic(); var result = logic.GetAll(); return(Response.AsJson(result)); }; #endregion #region /// /api/Territories/1234 /// Get["/territories/{id:string}"] = x => { var logic = new TerritoryLogic(); var result = logic.GetById((string)x.id); return(Response.AsJson(result)); }; #endregion #endregion }
protected void Page_Load(object sender, EventArgs e) { List <Categoria> categorias = CategoryLogic.GetCategorias(); List <Producto> productos = ProductLogic.GetListaProductos(); string state = (string)Session["state"]; if (state == "modified") { lblState.CssClass = "modified"; Session["state"] = "unmodified"; } else if (state == "inputError") { lblState.CssClass = "inputError"; Session["state"] = "unmodified"; } try { foreach (Categoria categoria in categorias) { TableRow row = new TableRow(); row.ID = categoria.CategoryID.ToString(); row.CssClass = "category"; TableCell name = new TableCell(); name.Text = categoria.CategoryName; row.Cells.Add(name); asptCategorias.Rows.Add(row); } foreach (Producto producto in productos) { TableRow row = new TableRow(); row.CssClass = CategoryLogic.GetCategoria(producto.CategoryID).CategoryName.Replace(" ", "_").Replace("/", "_") + " product"; TableCell id = new TableCell(); id.Text = producto.ProductID.ToString(); id.CssClass = "hidden"; row.Cells.Add(id); TableCell name = new TableCell(); name.Text = producto.ProductName; row.Cells.Add(name); TableCell price = new TableCell(); price.Text = decimal.Round(producto.UnitPrice, 2).ToString(); row.Cells.Add(price); TableCell stock = new TableCell(); if (Session["myCart"] == null) { stock.Text = producto.UnitsInStock.ToString(); } else { List <LineaVenta> carrito = (List <LineaVenta>)Session["myCart"]; foreach (LineaVenta lineaVenta in carrito) { if (producto.ProductID == lineaVenta.ProductId) { stock.Text = (producto.UnitsInStock - lineaVenta.Quantity).ToString(); } else { stock.Text = producto.UnitsInStock.ToString(); } } } row.Cells.Add(stock); TableCell supplier = new TableCell(); supplier.Text = SupplierLogic.GetSupplierName(producto.SupplierID); supplier.CssClass = "hidden"; row.Cells.Add(supplier); TableCell quantityPerUnit = new TableCell(); quantityPerUnit.Text = producto.QuantityPerUnit; quantityPerUnit.CssClass = "hidden"; row.Cells.Add(quantityPerUnit); asptProductos.Rows.Add(row); } } catch (NullReferenceException) { lblState.CssClass = "dbConnectionError"; } }
public SupplierController(SupplierLogic supplierLogic, ProductGroupLogic productGroupLogic) { _supplierLogic = supplierLogic; _productGroupLogic = productGroupLogic; }