code stringlengths 1 2.01M | repo_name stringlengths 3 62 | path stringlengths 1 267 | language stringclasses 231
values | license stringclasses 13
values | size int64 1 2.01M |
|---|---|---|---|---|---|
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Entities;
using BUS;
public partial class Admin_KhachHangAdd : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btn_Add_Click(object sender, EventArgs e)
{
tbKhachHang khachhang = new tbKhachHang();
khachhang.HoTen = txt_TenKH.Text;
khachhang .Email =txt_Email .Text ;
khachhang.MatKhau = txt_MatKhau.Text;
khachhang.DiaChi = txt_DiaChi.Text;
khachhang.DienThoai = txt_DienThoai.Text;
tbKhachHangBUS.Insert(khachhang);
Response.Redirect("~/Admin/KhachHangList.aspx");
}
}
| 02cdnth2 | trunk/Test/Admin/KhachHangAdd.aspx.cs | C# | epl | 903 |
<%@ Page Language="C#" MasterPageFile ="~/Admin/MasterPage.master" AutoEventWireup="true" CodeFile="TrangThaiSPEdit.aspx.cs" Inherits="Admin_TrangThaiSPEdit" %>
<%@ Register Assembly="ASPnetPagerV2_8" Namespace="ASPnetControls" TagPrefix="cc1" %>
<asp:Content ID ="Content1" ContentPlaceHolderID ="menuPlaceHolder" runat ="server" >
<h5 >Menu</h5>
<ul class ="Actions">
<li> <a href ="LoaiSPAdd.aspx" >Thêm mới Loại SP</a></li>
<li class ="Selected"><a href ="Default.aspx" >Danh sách Loại SP</a></li>
</ul>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="contentPlaceHolder" Runat="Server">
<div style="padding:12px 12px 12px 12px;">
<div>
<div class="title">
Update Trạng Thái SP
</div>
<div>
<table width="100%" cellspacing="1" cellpadding="3" border="0" bgcolor="#cccccc">
<tr>
<td style="width:30%">Mã Trạng thái</td>
<td style="width:70%"><asp:TextBox Enabled="false" ID="txt_MaTT" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td style="width:30%">Tên Trạng thái</td>
<td style="width:70%"><asp:TextBox ID="txt_TenTT" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td style="width:30%"></td>
<td style="width:70%"><asp:Button ID="btn_Update" runat="server" Text="Update Loại SP" OnClick="btn_Update_Click" /></td>
</tr>
</table>
</div>
</div>
</div>
</asp:Content>
| 02cdnth2 | trunk/Test/Admin/TrangThaiSPEdit.aspx | ASP.NET | epl | 1,703 |
<%@ Page Language="C#" MasterPageFile ="~/Admin/MasterPage.master" AutoEventWireup="true" CodeFile="SanPhamEdit.aspx.cs" Inherits="Admin_SanPhamEdit" %>
<%@ Register Assembly="ASPnetPagerV2_8" Namespace="ASPnetControls" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="menuPlaceHolder" Runat="Server">
<h5>Menu</h5>
<ul class="Actions">
<li class="Selected"><a href="SanPhamAdd.aspx">Thêm Mới Sản Phẩm</a></li>
<li><a href="SanPhamList.aspx">Danh Sách Sản Phẩm</a></li>
</ul>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="contentPlaceHolder" Runat="Server">
<div style="padding:12px 12px 12px 12px;">
<div>
<div class="title">
Update Sản phẩm</div>
<div>
<table width="100%" cellspacing="1" cellpadding="3" border="0" bgcolor="#cccccc">
<tr>
<td style="width:30%">Mã Sản phẩm</td>
<td style="width:70%"><asp:TextBox ID="txt_MaSP" Enabled ="false" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td style="width:30%">Tên Sản phẩm</td>
<td style="width:70%"><asp:TextBox ID="txt_TenSP" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID ="rfv_TenSP" runat ="server" ControlToValidate ="txt_TenSP"
ErrorMessage ="Tên sản phẩm không được để trống" Display ="Dynamic" ></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td style="width:30%">
Loại SP</td>
<td style="width:70%">
<asp:DropDownList CssClass="DropDownList" ID="ddl_LoaiSP" runat="server">
</asp:DropDownList></td>
</tr>
<tr>
<td style="width:30%">
Địa điểm</td>
<td style="width:70%">
<asp:DropDownList CssClass="DropDownList" ID="ddl_DiaDiem" runat="server">
</asp:DropDownList>
</td>
</tr>
<tr>
<td style="width:30%">
Trạng Thái Sản Phẩm</td>
<td style="width:70%">
<asp:DropDownList CssClass="DropDownList" ID="ddl_TrangThaiSP" runat="server">
</asp:DropDownList>
</td>
</tr>
<tr>
<td style="width:30%">
Nhân viên</td>
<td style="width:70%"><asp:DropDownList CssClass="DropDownList" ID="ddl_NhanVien" runat="server">
</asp:DropDownList></td>
</tr>
<tr>
<td style="width:30%">
Doanh Nghiệp</td>
<td style="width:70%"><asp:DropDownList CssClass="DropDownList" ID="ddl_DoanhNghiep" runat="server">
</asp:DropDownList></td>
</tr>
<tr>
<td style="width:30%">
Giá bán</td>
<td style="width:70%">
<asp:TextBox ID="txt_GiaBan" runat="server"></asp:TextBox>
<asp:RangeValidator ID="RangeValidator1" runat="server" ControlToValidate="txt_GiaBan"
ErrorMessage="Giá trị phải là số nguyên" MaximumValue="50000000" MinimumValue="0"
Type="Integer"></asp:RangeValidator>
</td>
</tr>
<tr>
<td style="width:30%">
Giá trị thực</td>
<td style="width:70%">
<asp:TextBox ID="txt_GiaTriThuc" runat="server"></asp:TextBox>
<asp:RangeValidator ID="rvd_giatrithuc" runat ="server" ControlToValidate ="txt_GiaTriThuc"
ErrorMessage="Giá trị phải là số nguyên" MaximumValue ="500000000" MinimumValue ="0" Type ="Integer" ></asp:RangeValidator>
</td>
</tr>
<tr>
<td style="width:30%">
Điều kiện SD</td>
<td style="width:70%">
<asp:TextBox ID="txt_dksd" CssClass="TextBoxSearch" TextMode="MultiLine" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td style="width:30%">
Mô tả</td>
<td style="width:70%">
<asp:TextBox ID="txt_Mota" CssClass="TextBoxSearch" TextMode="MultiLine" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td style="width:30%">
Số lượng bán</td>
<td style="width:70%">
<asp:TextBox ID="txt_slban" runat="server"></asp:TextBox>
<asp:RangeValidator ID="RangeValidator2" runat ="server" ControlToValidate ="txt_slban"
ErrorMessage="Giá trị phải là số nguyên" MaximumValue ="500000000" MinimumValue ="0" Type ="Integer" ></asp:RangeValidator>
</td>
</tr>
<tr>
<td style="width:30%; height: 22px;">
Số lượng đã bán</td>
<td style="width:70%; height: 22px;">
<asp:TextBox ID="txt_slDaBan" runat="server"></asp:TextBox>
<asp:RangeValidator ID="RangeValidator3" runat ="server" ControlToValidate ="txt_slDaBan"
ErrorMessage="Giá trị phải là số nguyên" MaximumValue ="500000000" MinimumValue ="0" Type ="Integer" ></asp:RangeValidator>
</td>
</tr>
<tr>
<td style="width:30%; height: 19px;">
Ngày bắt đầu bán</td>
<td style="width:70%; height: 19px;">
Ngày:<asp:DropDownList ID="ddl_ngaybdban" runat="server" Width="45px">
</asp:DropDownList>
/ Tháng:
<asp:DropDownList ID="ddl_thangbdban" runat="server" Width="52px">
</asp:DropDownList>
/ Năm:
<asp:DropDownList ID="ddl_nambdban" runat="server">
</asp:DropDownList></td>
</tr>
<tr>
<td style="width:30%; height: 18px;">
Ngày kết thúc bán</td>
<td style="width:70%; height: 18px;">
Ngày:<asp:DropDownList ID ="ddl_ngayktban" runat ="server" Width ="45px"></asp:DropDownList>
/ Tháng: <asp:DropDownList ID ="ddl_thangktban" runat ="server" Width ="52px"></asp:DropDownList>
/ Năm: <asp:DropDownList ID ="ddl_namktban" runat ="server" ></asp:DropDownList>
</td>
</tr>
<tr>
<td style="width:30%">
Ngày Cập Nhật</td>
<td style="width:70%">
Ngày:<asp:DropDownList ID ="ddl_ngaycn" runat ="server" Width ="45px"></asp:DropDownList>
/ Tháng: <asp:DropDownList ID ="ddl_thangcn" runat ="server" Width ="52px"></asp:DropDownList>
/ Năm: <asp:DropDownList ID ="ddl_namcn" runat ="server" ></asp:DropDownList>
</td>
</tr>
<tr>
<td style="width:30%">
Ngày Doanh Nghiệp Bán</td>
<td style="width:70%">
Ngày:<asp:DropDownList ID ="ddl_ngaydnban" runat ="server" Width ="45px"></asp:DropDownList>
/ Tháng: <asp:DropDownList ID ="ddl_thangdnban" runat ="server" Width ="52px"></asp:DropDownList>
/ Năm: <asp:DropDownList ID ="ddl_namdnban" runat ="server" ></asp:DropDownList>
</td>
</tr>
<tr>
<td style="width:30%">
Tỉ lệ hoa hồng</td>
<td style="width:70%">
<asp:TextBox ID="txt_tlhoahong" runat="server"></asp:TextBox>
<asp:RangeValidator ID="RangeValidator4" runat ="server" ControlToValidate ="txt_tlhoahong"
ErrorMessage="Giá trị phải là số" MaximumValue ="500000000" MinimumValue ="0" Type ="Double" ></asp:RangeValidator>
</td>
</tr>
<tr>
<td style="width:30%">
Hình Ảnh</td>
<td style="width:70%">
<div style="padding-top:10px;">
<asp:Repeater ID="Repeater1" runat="server" OnItemDataBound="Repeater1_ItemDataBound">
<HeaderTemplate>
<table cellspacing="1" cellpadding="3" width="100%" bgcolor="#cccccc" border="0">
<thead>
<tr class="listtableheader">
<th>Id Hình </th>
<th>Hình Ảnh</th>
<th><input id="cb_All" type="checkbox" onclick="CheckAll(1);" /><a href="javascript:CheckAll(2)">Chọn hết</a></th>
</tr>
</thead>
<tbody>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td>
<asp:Literal ID="lit_IdHinh" runat="server"></asp:Literal></td>
<td>
<asp:Image ID ="img_HinhAnh" runat ="server" /></td>
<td>
<asp:CheckBox ID="cb_Xoa" runat="server" />
<asp:HiddenField ID="hf_id" runat="server" />
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
</tbody>
</table>
</FooterTemplate>
</asp:Repeater>
</div>
<div style="width:100%;">
<div style="float:left;">
<cc1:PagerV2_8 ID="PagerV2_8_1" runat="server" OnCommand="pager_Command" ></cc1:PagerV2_8>
</div>
<div style ="float: right ;">
<asp:LinkButton ID="lbt_Delete" runat="server" OnClick="lbt_Delete_Click" OnClientClick ="Javascript: return Message_confirm('Bạn có thực sự muốn xóa?');">Xóa Hình</asp:LinkButton>
</div>
</div>
</td>
</tr>
<tr>
<td style="width:30%">
Thêm Hình ảnh</td>
<td style="width:70%">
<asp:FileUpload ID="FileUpload1" runat="server" class="multi" />
</td>
</tr>
<tr>
<td style="width:30%"></td>
<td style="width:70%"><asp:Button ID="btn_Edit" runat="server" Text="Update sản phẩm" OnClick="btn_Edit_Click" OnClientClick ="Javascript: return Message_confirm('Bạn có thực sự muốn update?');" /></td>
</tr>
</table>
</div>
</div>
</div>
</asp:Content> | 02cdnth2 | trunk/Test/Admin/SanPhamEdit.aspx | ASP.NET | epl | 12,100 |
<%@ Page Language="C#" MasterPageFile ="~/Admin/MasterPage.master" AutoEventWireup="true" CodeFile="LoaiSPList.aspx.cs" Inherits="Admin_LoaiSPList" %>
<%@ Register Assembly="ASPnetPagerV2_8" Namespace="ASPnetControls" TagPrefix="cc1" %>
<asp:Content ID ="Content1" ContentPlaceHolderID ="menuPlaceHolder" runat ="server" >
<h5 >Menu</h5>
<ul class ="Actions">
<li > <a href ="sanphamAdd.aspx" >Thêm mới sản phẩm</a></li>
<li > <a href ="sanphamList.aspx" >Danh sách Sản phẩm</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="DiaDiemAdd.aspx" >Thêm mới Địa điểm</a></li>
<li > <a href ="DiaDiemList.aspx" >Danh sách Đại điểm</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="DoanhNghiepAdd.aspx" >Thêm mới Doanh nghiệp</a></li>
<li > <a href ="DoanhNghiepList.aspx" >Danh sách Doanh nghiệp</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="KhachHangAdd.aspx" >Thêm mới Khách hàng</a></li>
<li > <a href ="KhachHangList.aspx" >Danh sách Khach hàng</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="NhanVienAdd.aspx" >Thêm mới Nhân viên</a></li>
<li > <a href ="NhanVienList.aspx" >Danh sách Nhân viên</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="HinhThucTTAdd.aspx" >Thêm mới Hình thức thanh toán</a></li>
<li > <a href ="HinhThucTTList.aspx" >Danh sách Hình thức thanh toán</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="LoaiSPAdd.aspx" >Thêm mới Loại sản phẩm</a></li>
<li class ="Selected"> <a href ="LoaiSPList.aspx" >Danh sách Loại sản phẩm</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="MaSoSPList.aspx" >Danh sách Mã số sản phẩm</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="TrangThaiSPAdd.aspx" >Thêm mới Trạng thái sản phẩm</a></li>
<li > <a href ="TrangThaiSPList.aspx" >Danh sách Trạng thái sản phẩm</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="TrangThaiDHList.aspx" >Danh sách Trạng thái đơn hàng</a></li>
<li ><a href ="TTGiaoDichList.aspx" >Danh sách Thông tin giao dịch</a></li>
</ul>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="contentPlaceHolder" Runat="Server">
<div style="padding:12px 12px 12px 12px;">
<div>
<div class="title">
Danh sách Loại SP
</div>
<div style="width:100%;">
<div style="display:table-cell; width:70%;float:left;">
Tên loại: <asp:TextBox ID="txt_TenLoai" runat="server"></asp:TextBox>
<asp:Button ID="btn_Search" runat="server" Text="Tìm kiếm" OnClick="btn_Search_Click" />
</div>
<div class="addnewrow" style="display:table-cell; width:25%;float:right;">
<a href ="LoaiSPAdd.aspx" >Thêm mới Loại SP</a> |
<asp:LinkButton ID="lbt_Delete" runat="server" OnClick="lbt_Delete_Click">Xóa</asp:LinkButton>
</div>
</div>
<ContentTemplate>
<div>
<asp:Repeater ID="Repeater1" runat="server" OnItemDataBound="Repeater1_ItemDataBound">
<HeaderTemplate>
<table cellspacing="1" cellpadding="3" width="100%" bgcolor="#cccccc" border="0">
<thead>
<tr class="listtableheader">
<th>Mã</th>
<th>Tên Loại</th>
<th>Sửa</th>
<th><input id="cb_All" type="checkbox" onclick="CheckAll(1);" /><a href="javascript:CheckAll(2)">Chọn hết</a></th>
</tr>
</thead>
<tbody>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td><asp:Literal ID="lit_Ma" runat="server" /></td>
<td><asp:Literal ID="hyp_TenLoai" runat="server" /></td>
<td><asp:HyperLink ID="hyp_Edit" Text="Edit" runat="server" /></td>
<td>
<asp:CheckBox ID="cb_Xoa" runat="server" />
<asp:HiddenField ID="hf_id" runat="server" />
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
</tbody>
</table>
</FooterTemplate>
</asp:Repeater>
</div>
<div style="width:100%;">
<div style="float:left;">
<cc1:PagerV2_8 ID="PagerV2_8_1" runat="server" OnCommand ="pager_Command"></cc1:PagerV2_8>
</div>
</div>
</ContentTemplate>
</div>
</div>
</asp:Content>
| 02cdnth2 | trunk/Test/Admin/LoaiSPList.aspx | ASP.NET | epl | 4,981 |
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Entities;
using Utility;
using BUS;
public partial class Admin_DoanhNghiepAdd : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btn_Add_Click(object sender, EventArgs e)
{
tbDoanhNghiep doanhnghiep = new tbDoanhNghiep();
doanhnghiep.TenDoanhNghiep = txt_TenDN.Text;
doanhnghiep.DiaChi = txt_diachi.Text;
doanhnghiep.DienThoai = txt_dienthoai.Text;
tbDoanhNghiepBUS.Insert_DN(doanhnghiep);
Response.Redirect("~/Admin/DoanhNghiepList.aspx");
}
}
| 02cdnth2 | trunk/Test/Admin/DoanhNghiepAdd.aspx.cs | C# | epl | 859 |
<%@ Page Language="C#" MasterPageFile ="~/Admin/MasterPage.master" AutoEventWireup="true" CodeFile="TrangThaiSPList.aspx.cs" Inherits="Admin_Default" %>
<%@ Register Assembly="ASPnetPagerV2_8" Namespace="ASPnetControls" TagPrefix="cc1" %>
<asp:Content ID ="Content1" ContentPlaceHolderID ="menuPlaceHolder" runat ="server" >
<h5 >Menu</h5>
<ul class ="Actions">
<li > <a href ="sanphamAdd.aspx" >Thêm mới sản phẩm</a></li>
<li > <a href ="sanphamList.aspx" >Danh sách Sản phẩm</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="DiaDiemAdd.aspx" >Thêm mới Địa điểm</a></li>
<li > <a href ="DiaDiemList.aspx" >Danh sách Đại điểm</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="DoanhNghiepAdd.aspx" >Thêm mới Doanh nghiệp</a></li>
<li > <a href ="DoanhNghiepList.aspx" >Danh sách Doanh nghiệp</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="KhachHangAdd.aspx" >Thêm mới Khách hàng</a></li>
<li > <a href ="KhachHangList.aspx" >Danh sách Khach hàng</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="NhanVienAdd.aspx" >Thêm mới Nhân viên</a></li>
<li > <a href ="NhanVienList.aspx" >Danh sách Nhân viên</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="HinhThucTTAdd.aspx" >Thêm mới Hình thức thanh toán</a></li>
<li > <a href ="HinhThucTTList.aspx" >Danh sách Hình thức thanh toán</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="LoaiSPAdd.aspx" >Thêm mới Loại sản phẩm</a></li>
<li > <a href ="LoaiSPList.aspx" >Danh sách Loại sản phẩm</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="MaSoSPList.aspx" >Danh sách Mã số sản phẩm</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="TrangThaiSPAdd.aspx" >Thêm mới Trạng thái sản phẩm</a></li>
<li class ="Selected"> <a href ="TrangThaiSPList.aspx" >Danh sách Trạng thái sản phẩm</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="TrangThaiDHList.aspx" >Danh sách Trạng thái đơn hàng</a></li>
<li ><a href ="TTGiaoDichList.aspx" >Danh sách Thông tin giao dịch</a></li>
</ul>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="contentPlaceHolder" Runat="Server">
<div style="padding:12px 12px 12px 12px;">
<div>
<div class="title">
Danh sách Loại SP
</div>
<div style="width:100%;">
<div style="display:table-cell; width:70%;float:left;">
Tên loại: <asp:TextBox ID="txt_TenTT" runat="server"></asp:TextBox>
<asp:Button ID="btn_Search" runat="server" Text="Tìm kiếm" OnClick="btn_Search_Click" />
</div>
<div class="addnewrow" style="display:table-cell; width:25%;float:right;">
<a href ="TrangThaiSPAdd.aspx" >Thêm mới TT SP</a> |
<asp:LinkButton ID="lbt_Delete" runat="server" OnClick="lbt_Delete_Click">Xóa</asp:LinkButton>
</div>
</div>
<ContentTemplate>
<div>
<asp:Repeater ID="Repeater1" runat="server" OnItemDataBound="Repeater1_ItemDataBound">
<HeaderTemplate>
<table cellspacing="1" cellpadding="3" width="100%" bgcolor="#cccccc" border="0">
<thead>
<tr class="listtableheader">
<th>Mã</th>
<th>Tên Loại</th>
<th>Sửa</th>
<th><input id="cb_All" type="checkbox" onclick="CheckAll(1);" /><a href="javascript:CheckAll(2)">Chọn hết</a></th>
</tr>
</thead>
<tbody>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td><asp:Literal ID="lit_MaTT" runat="server" /></td>
<td><asp:HyperLink ID="hyp_TenTT" runat="server"></asp:HyperLink></td>
<td><asp:HyperLink ID="hyp_Edit" Text="Edit" runat="server" /></td>
<td>
<asp:CheckBox ID="cb_Xoa" runat="server" />
<asp:HiddenField ID="hf_id" runat="server" />
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
</tbody>
</table>
</FooterTemplate>
</asp:Repeater>
</div>
<div style="width:100%;">
<div style="float:left;">
<cc1:PagerV2_8 ID="PagerV2_8_1" runat="server" GenerateFirstLastSection="true" OnCommand="pager_Command"
GeneratePagerInfoSection="false" GenerateSmartShortCuts="false"
GenerateHiddenHyperlinks="false" NormalModePageCount="5" ></cc1:PagerV2_8>
</div>
</div>
</ContentTemplate>
</div>
</div>
</asp:Content>
| 02cdnth2 | trunk/Test/Admin/TrangThaiSPList.aspx | ASP.NET | epl | 5,191 |
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using BUS;
using Entities;
using Utility;
public partial class Admin_LoaiSPEdit : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
load_data();
}
}
private void load_data()
{
try
{
int id = int.Parse(Request.QueryString["id"].ToString());
tbLoaiSP loaisp = new tbLoaiSP();
if (loaisp != null)
{
txt_MaLoai .Text = loaisp .IdLoaiSP .ToString();
txt_TenLoai .Text = loaisp .TenLoai .ToString();
}
}
catch
{
Response.Redirect("~/Admin/Default.aspx");
}
}
protected void btn_Update_Click(object sender, EventArgs e)
{
}
}
| 02cdnth2 | trunk/Test/Admin/LoaiSPEdit.aspx.cs | C# | epl | 1,113 |
<%@ Page Language="C#" MasterPageFile ="~/Admin/MasterPage.master" AutoEventWireup="true" CodeFile="SanPhamList.aspx.cs" Inherits="Admin_SanPhamList" %>
<%@ Register Assembly="ASPnetPagerV2_8" Namespace="ASPnetControls" TagPrefix="cc1" %>
<asp:Content ID ="Content1" ContentPlaceHolderID ="menuPlaceHolder" runat ="server" >
<h5 >Menu</h5>
<ul class ="Actions">
<li > <a href ="sanphamAdd.aspx" >Thêm mới sản phẩm</a></li>
<li class ="Selected"> <a href ="sanphamList.aspx" >Danh sách Sản phẩm</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="DiaDiemAdd.aspx" >Thêm mới Địa điểm</a></li>
<li > <a href ="DiaDiemList.aspx" >Danh sách Đại điểm</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="DoanhNghiepAdd.aspx" >Thêm mới Doanh nghiệp</a></li>
<li > <a href ="DoanhNghiepList.aspx" >Danh sách Doanh nghiệp</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="KhachHangAdd.aspx" >Thêm mới Khách hàng</a></li>
<li > <a href ="KhachHangList.aspx" >Danh sách Khach hàng</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="NhanVienAdd.aspx" >Thêm mới Nhân viên</a></li>
<li > <a href ="NhanVienList.aspx" >Danh sách Nhân viên</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="HinhThucTTAdd.aspx" >Thêm mới Hình thức thanh toán</a></li>
<li > <a href ="HinhThucTTList.aspx" >Danh sách Hình thức thanh toán</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="LoaiSPAdd.aspx" >Thêm mới Loại sản phẩm</a></li>
<li > <a href ="LoaiSPList.aspx" >Danh sách Loại sản phẩm</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="MaSoSPList.aspx" >Danh sách Mã số sản phẩm</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="TrangThaiSPAdd.aspx" >Thêm mới Trạng thái sản phẩm</a></li>
<li > <a href ="TrangThaiSPList.aspx" >Danh sách Trạng thái sản phẩm</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="TrangThaiDHList.aspx" >Danh sách Trạng thái đơn hàng</a></li>
<li ><a href ="TTGiaoDichList.aspx" >Danh sách Thông tin giao dịch</a></li>
</ul></asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="contentPlaceHolder" Runat="Server">
<div style="padding:12px 12px 12px 12px;">
<div>
<div class="title">
Danh sách Sản phẩm
</div>
<div style="width:100%;">
<div style="display:table-cell; width:70%;float:left;">
Tên SP: <asp:TextBox ID="txt_TenSP" runat="server"></asp:TextBox>
Loại SP:<asp:DropDownList ID ="ddl_LoaiSP" runat ="server" ></asp:DropDownList>
Giá Bán: <asp:TextBox ID ="txt_GiaBan" runat ="server" ></asp:TextBox>
<asp:Button ID="btn_Search" runat="server" Text="Tìm kiếm" OnClick="btn_Search_Click" />
</div>
<div class="addnewrow" style="display:table-cell; width:25%;float:right;">
<a href ="sanphamadd.aspx" >Thêm mới SP</a> |
<asp:LinkButton ID="lbt_Delete" runat="server" OnClick="lbt_Delete_Click" OnClientClick ="Javascript: return Message_confirm('Bạn có thực sự muốn xóa không?');">Xóa</asp:LinkButton>
</div>
</div>
<ContentTemplate>
<div>
<asp:Repeater ID="Repeater1" runat="server" OnItemDataBound="Repeater1_ItemDataBound">
<HeaderTemplate>
<table cellspacing="1" cellpadding="3" width="100%" bgcolor="#cccccc" border="0">
<thead>
<tr class="listtableheader">
<th>Mã SP</th>
<th>Tên SP</th>
<th>Loại</th>
<th>Hình Ảnh</th>
<th>Đơn Giá</th>
<th>SL Bán</th>
<th>Sửa</th>
<th><input id="cb_All" type="checkbox" onclick="CheckAll(1);" /><a href="javascript:CheckAll(2)">Chọn hết</a></th>
</tr>
</thead>
<tbody>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td><%#Eval("IdSanPham")%></td>
<td><asp:HyperLink ID="hyp_TenSP" runat="server"></asp:HyperLink></td>
<td><asp:Literal ID="lit_LoaiSP" runat="server" /></td>
<td><asp:Image ID ="img_HinhAnh" runat ="server" /></td>
<td><%#Eval("GiaBan") %></td>
<td><%#Eval("SLBan") %></td>
<td><asp:HyperLink ID="hyp_Edit" Text="Edit" runat="server" /></td>
<td>
<asp:CheckBox ID="cb_Xoa" runat="server" />
<asp:HiddenField ID="hf_id" runat="server" />
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
</tbody>
</table>
</FooterTemplate>
</asp:Repeater>
</div>
<div style="width:100%;">
<div style="float:left;">
<cc1:PagerV2_8 ID="PagerV2_8_1" runat="server" OnCommand ="pager_Command"></cc1:PagerV2_8>
</div>
</div>
</ContentTemplate>
</div>
</div>
</asp:Content>
| 02cdnth2 | trunk/Test/Admin/SanPhamList.aspx | ASP.NET | epl | 5,673 |
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Entities;
using BUS;
public partial class Admin_NhanVienDetail : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
load_data();
}
}
private void load_data()
{
try
{
int iD = int.Parse(Request.QueryString["id"].ToString());
tbNhanVien nhanvien = tbNhanVienBUS.GetId(iD);
if (nhanvien != null)
{
lit_MaNV.Text = nhanvien.IdNhanVien.ToString();
lit_TaiKhoan.Text = nhanvien.TaiKhoan.ToString();
lit_MatKhau.Text = nhanvien.MatKhau.ToString();
lit_TenNV.Text = nhanvien.TenNhanVien.ToString();
lit_DiaChi.Text = nhanvien.DiaChi.ToString();
lit_DienThoai.Text = nhanvien.DienThoai.ToString();
}
}
catch
{
Response.Redirect("~/Admin/NhanVienList.aspx");
}
}
}
| 02cdnth2 | trunk/Test/Admin/NhanVienDetail.aspx.cs | C# | epl | 1,286 |
<%@ Page Language="C#" MasterPageFile ="~/Admin/MasterPage.master" AutoEventWireup="true" CodeFile="DiaDiemList.aspx.cs" Inherits="DiaDiemList" %>
<%@ Register Assembly="ASPnetPagerV2_8" Namespace="ASPnetControls" TagPrefix="cc1" %>
<asp:Content ID ="Content1" ContentPlaceHolderID ="menuPlaceHolder" runat ="server" >
<h5 >Menu</h5>
<ul class ="Actions">
<li > <a href ="sanphamAdd.aspx" >Thêm mới sản phẩm</a></li>
<li > <a href ="sanphamList.aspx" >Danh sách Sản phẩm</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="DiaDiemAdd.aspx" >Thêm mới Địa điểm</a></li>
<li class ="Selected" > <a href ="DiaDiemList.aspx" >Danh sách Đại điểm</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="DoanhNghiepAdd.aspx" >Thêm mới Doanh nghiệp</a></li>
<li > <a href ="DoanhNghiepList.aspx" >Danh sách Doanh nghiệp</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="KhachHangAdd.aspx" >Thêm mới Khách hàng</a></li>
<li > <a href ="KhachHangList.aspx" >Danh sách Khach hàng</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="NhanVienAdd.aspx" >Thêm mới Nhân viên</a></li>
<li > <a href ="NhanVienList.aspx" >Danh sách Nhân viên</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="HinhThucTTAdd.aspx" >Thêm mới Hình thức thanh toán</a></li>
<li > <a href ="HinhThucTTList.aspx" >Danh sách Hình thức thanh toán</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="LoaiSPAdd.aspx" >Thêm mới Loại sản phẩm</a></li>
<li > <a href ="LoaiSPList.aspx" >Danh sách Loại sản phẩm</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="MaSoSPList.aspx" >Danh sách Mã số sản phẩm</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="TrangThaiSPAdd.aspx" >Thêm mới Trạng thái sản phẩm</a></li>
<li > <a href ="TrangThaiSPList.aspx" >Danh sách Trạng thái sản phẩm</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="TrangThaiDHList.aspx" >Danh sách Trạng thái đơn hàng</a></li>
<li ><a href ="TTGiaoDichList.aspx" >Danh sách Thông tin giao dịch</a></li>
</ul></asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="contentPlaceHolder" Runat="Server">
<div style="padding:12px 12px 12px 12px;">
<div>
<div class="title">
Danh sách Địa điểm
</div>
<div style="width:100%;">
<div style="display:table-cell; width:70%;float:left;">
Tên Địa điểm: <asp:TextBox ID="txt_TenDD" runat="server"></asp:TextBox>
<asp:Button ID="btn_Search" runat="server" Text="Tìm kiếm" OnClick="btn_Search_Click" />
</div>
<div class="addnewrow" style="display:table-cell; width:25%;float:right;">
<a href ="DiaDiemAdd.aspx" >Thêm mới DD</a> |
<asp:LinkButton ID="lbt_Delete" runat="server" OnClick="lbt_Delete_Click">Xóa</asp:LinkButton>
</div>
</div>
<ContentTemplate>
<div>
<asp:Repeater ID="Repeater1" runat="server" OnItemDataBound="Repeater1_ItemDataBound">
<HeaderTemplate>
<table cellspacing="1" cellpadding="3" width="100%" bgcolor="#cccccc" border="0">
<thead>
<tr class="listtableheader">
<th>Mã Địa Điểm</th>
<th>Tên Địa Điểm</th>
<th>Sửa</th>
<th><input id="cb_All" type="checkbox" onclick="CheckAll(1);" /><a href="javascript:CheckAll(2)">Chọn hết</a></th>
</tr>
</thead>
<tbody>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td><asp:Literal ID="lit_MaDD" runat="server" /></td>
<td><asp:Literal ID="lit_TenDD" runat="server"/></td>
<td><asp:HyperLink ID="hyp_Edit" Text="Edit" runat="server" /></td>
<td>
<asp:CheckBox ID="cb_Xoa" runat="server" />
<asp:HiddenField ID="hf_id" runat="server" />
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
</tbody>
</table>
</FooterTemplate>
</asp:Repeater>
</div>
<div style="width:100%;">
<div style="float:left;">
<cc1:PagerV2_8 ID="PagerV2_8_1" runat="server" GenerateFirstLastSection="true" OnCommand="pager_Command"
GeneratePagerInfoSection="false" GenerateSmartShortCuts="false"
GenerateHiddenHyperlinks="false" NormalModePageCount="5" ></cc1:PagerV2_8>
</div>
</div>
</ContentTemplate>
</div>
</div>
</asp:Content>
| 02cdnth2 | trunk/Test/Admin/DiaDiemList.aspx | ASP.NET | epl | 5,196 |
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Entities;
using Utility;
using BUS;
public partial class Admin_HinhThucTTList : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
load_data();
}
}
protected void lbt_Delete_Click(object sender, EventArgs e)
{
//try
//{
foreach (RepeaterItem item in this.Repeater1.Items)
{
CheckBox chk = (CheckBox)item.FindControl("cb_xoa");
if (chk.Checked == true)
{
HiddenField hf_id = (HiddenField)item.FindControl("hf_id");
tbHinhThucTTBUS.Detele (int.Parse(hf_id.Value));
}
}
// load_data();
//}
//catch
//{
Response.Redirect("~/Admin/HinhThucTTList.aspx");
//}
}
private void load_data()
{
PagerV2_8_1.PageSize = 5;
Criteria cri = new Criteria();
int Total = 0;
if (txt_TenHT.Text != "")
{
cri.add(Condition.AND, tbHinhThucTTColumns .TenHinhThuc .ToString(), Condition.LIKE, txt_TenHT.Text);
}
//PagerV2_8_1 .PageSize =int.Parse (ConfigurationManager.AppSettings ["pagesize"].ToString ());
tbHinhThucTTCollection htcolection = tbHinhThucTTBUS .Get(cri.Criter, PagerV2_8_1.CurrentIndex,
PagerV2_8_1.PageSize, tbHinhThucTTColumns .IdHinhThuc .ToString(),
OrderDirection.ASC.ToString(), out Total);
Repeater1.DataSource = htcolection;
Repeater1.DataBind();
PagerV2_8_1.ItemCount = Total;
if (Total <= PagerV2_8_1.PageSize)
PagerV2_8_1.Visible = false;
}
protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
Literal lit_TenHT = (Literal)e.Item.FindControl("lit_TenHT");
Literal lit_MaHT = (Literal)e.Item.FindControl("lit_MaHT");
HyperLink hyp_Edit = (HyperLink)e.Item.FindControl("hyp_Edit");
HiddenField hf_id = (HiddenField)e.Item.FindControl("hf_id");
tbHinhThucTT hinhthuctt = (tbHinhThucTT)e.Item.DataItem;
lit_MaHT.Text = hinhthuctt.IdHinhThuc.ToString();
hyp_Edit.NavigateUrl = "HinhThucTTEdit.aspx?id=" + hinhthuctt.IdHinhThuc.ToString();
hf_id.Value = hinhthuctt.IdHinhThuc.ToString();
lit_TenHT.Text = hinhthuctt.TenHinhThuc .ToString();
}
}
protected void btn_Search_Click(object sender, EventArgs e)
{
load_data();
}
protected void pager_Command(object sender, CommandEventArgs e)
{
PagerV2_8_1.CurrentIndex = int.Parse(e.CommandArgument.ToString());
load_data();
}
}
| 02cdnth2 | trunk/Test/Admin/HinhThucTTList.aspx.cs | C# | epl | 3,315 |
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Entities;
using BUS;
public partial class Admin_DiaDiemAdd : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btn_Add_Click(object sender, EventArgs e)
{
tbDiaDiem diadiem = new tbDiaDiem();
diadiem.TenDiaDiem = txt_TenDD.Text;
tbDiaDiemBUS.Insert(diadiem);
Response.Redirect("~/Admin/DiaDiemList.aspx");
}
}
| 02cdnth2 | trunk/Test/Admin/DiaDiemAdd.aspx.cs | C# | epl | 704 |
<%@ Page Language="C#" MasterPageFile ="~/Admin/MasterPage.master" AutoEventWireup="true" CodeFile="TrangThaiSPAdd.aspx.cs" Inherits="Admin_TrangThaiSPAdd" %>
<%@ Register Assembly="ASPnetPagerV2_8" Namespace="ASPnetControls" TagPrefix="cc1" %>
<asp:Content ID ="Content1" ContentPlaceHolderID ="menuPlaceHolder" runat ="server" >
<h5 >Menu</h5>
<ul class ="Actions">
<li > <a href ="sanphamAdd.aspx" >Thêm mới sản phẩm</a></li>
<li > <a href ="sanphamList.aspx" >Danh sách Sản phẩm</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="DiaDiemAdd.aspx" >Thêm mới Địa điểm</a></li>
<li > <a href ="DiaDiemList.aspx" >Danh sách Đại điểm</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="DoanhNghiepAdd.aspx" >Thêm mới Doanh nghiệp</a></li>
<li > <a href ="DoanhNghiepList.aspx" >Danh sách Doanh nghiệp</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="KhachHangAdd.aspx" >Thêm mới Khách hàng</a></li>
<li > <a href ="KhachHangList.aspx" >Danh sách Khach hàng</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="NhanVienAdd.aspx" >Thêm mới Nhân viên</a></li>
<li > <a href ="NhanVienList.aspx" >Danh sách Nhân viên</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="HinhThucTTAdd.aspx" >Thêm mới Hình thức thanh toán</a></li>
<li > <a href ="HinhThucTTList.aspx" >Danh sách Hình thức thanh toán</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="LoaiSPAdd.aspx" >Thêm mới Loại sản phẩm</a></li>
<li > <a href ="LoaiSPList.aspx" >Danh sách Loại sản phẩm</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="MaSoSPList.aspx" >Danh sách Mã số sản phẩm</a></li>
</ul>
<ul class ="Actions">
<li class ="Selected"> <a href ="TrangThaiSPAdd.aspx" >Thêm mới Trạng thái sản phẩm</a></li>
<li > <a href ="TrangThaiSPList.aspx" >Danh sách Trạng thái sản phẩm</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="TrangThaiDHList.aspx" >Danh sách Trạng thái đơn hàng</a></li>
<li ><a href ="TTGiaoDichList.aspx" >Danh sách Thông tin giao dịch</a></li>
</ul></asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="contentPlaceHolder" Runat="Server">
<div style="padding:12px 12px 12px 12px;">
<div>
<div class="title">
Thêm mới Trạng Thái SP
</div>
<div>
<table width="100%" cellspacing="1" cellpadding="3" border="0" bgcolor="#cccccc">
<tr>
<td style="width:30%">Tên trạng thái</td>
<td style="width:70%"><asp:TextBox ID="txt_TenTT" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td style="width:30%"></td>
<td style="width:70%"><asp:Button ID="btn_Add" runat="server" Text="Thêm mới" OnClick="btn_Add_Click" /></td>
</tr>
</table>
</div>
</div>
</div>
</asp:Content> | 02cdnth2 | trunk/Test/Admin/TrangThaiSPAdd.aspx | ASP.NET | epl | 3,301 |
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Utility;
using Entities;
using BUS;
public partial class Admin_DoanhNghiepList : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
load_data();
}
}
private void load_data()
{
PagerV2_8_1.PageSize = 5;
int Total = 0;
Criteria cri = new Criteria();
if (txt_TenDN.Text != "")
{
cri.add(Condition.AND, tbDoanhNghiepColumns .TenDoanhNghiep .ToString (), Condition.EQUAL, txt_TenDN.Text);
}
tbDoanhNghiepCollection DNCollection = tbDoanhNghiepBUS .Get(cri.Criter, PagerV2_8_1.CurrentIndex,
PagerV2_8_1.PageSize, tbDoanhNghiepColumns .IdDoanhNghiep .ToString(),
OrderDirection.ASC.ToString(), out Total);
Repeater1.DataSource = DNCollection;
Repeater1.DataBind();
PagerV2_8_1.ItemCount = Total;
if (Total <= PagerV2_8_1.PageSize)
{
PagerV2_8_1.Visible = false;
}
}
protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
HyperLink hyp_TenDN = (HyperLink)e.Item.FindControl("hyp_TenDN");
Literal lit_MaDN = (Literal)e.Item.FindControl("lit_MaDN");
HyperLink hyp_Edit = (HyperLink)e.Item.FindControl("hyp_Edit");
HiddenField hf_id = (HiddenField)e.Item.FindControl("hf_id");
tbDoanhNghiep doanhnghiep = (tbDoanhNghiep)e.Item.DataItem;
lit_MaDN.Text = doanhnghiep.IdDoanhNghiep .ToString();
hyp_TenDN.NavigateUrl = "DoanhNghiepDetail.aspx?id=" + doanhnghiep.IdDoanhNghiep.ToString();
hyp_Edit.NavigateUrl = "DoanhNghiepEdit.aspx?id=" + doanhnghiep.IdDoanhNghiep.ToString();
hf_id.Value = doanhnghiep.IdDoanhNghiep.ToString();
hyp_TenDN.Text = doanhnghiep.TenDoanhNghiep;
}
}
protected void btn_Search_Click(object sender, EventArgs e)
{
load_data();
}
protected void lbt_Delete_Click(object sender, EventArgs e)
{
foreach (RepeaterItem item in this.Repeater1.Items)
{
CheckBox chk = (CheckBox)item.FindControl("cb_xoa");
if (chk.Checked == true)
{
HiddenField hf_id = (HiddenField)item.FindControl("hf_id");
tbDoanhNghiepBUS .Delete_DN (int.Parse(hf_id.Value));
}
}
load_data();
}
protected void pager_Command(object sender, CommandEventArgs e)
{
PagerV2_8_1.CurrentIndex = int.Parse(e.CommandArgument.ToString());
load_data();
}
}
| 02cdnth2 | trunk/Test/Admin/DoanhNghiepList.aspx.cs | C# | epl | 3,154 |
<%@ Page Language="C#" MasterPageFile ="~/Admin/MasterPage.master" AutoEventWireup="true" CodeFile="KhachHangList.aspx.cs" Inherits="KhachHangList" %>
<%@ Register Assembly="ASPnetPagerV2_8" Namespace="ASPnetControls" TagPrefix="cc1" %>
<asp:Content ID ="Content1" ContentPlaceHolderID ="menuPlaceHolder" runat ="server" >
<h5 >Menu</h5>
<ul class ="Actions">
<li > <a href ="sanphamAdd.aspx" >Thêm mới sản phẩm</a></li>
<li > <a href ="sanphamList.aspx" >Danh sách Sản phẩm</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="DiaDiemAdd.aspx" >Thêm mới Địa điểm</a></li>
<li > <a href ="DiaDiemList.aspx" >Danh sách Đại điểm</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="DoanhNghiepAdd.aspx" >Thêm mới Doanh nghiệp</a></li>
<li > <a href ="DoanhNghiepList.aspx" >Danh sách Doanh nghiệp</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="KhachHangAdd.aspx" >Thêm mới Khách hàng</a></li>
<li class ="Selected"> <a href ="KhachHangList.aspx" >Danh sách Khach hàng</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="NhanVienAdd.aspx" >Thêm mới Nhân viên</a></li>
<li > <a href ="NhanVienList.aspx" >Danh sách Nhân viên</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="HinhThucTTAdd.aspx" >Thêm mới Hình thức thanh toán</a></li>
<li > <a href ="HinhThucTTList.aspx" >Danh sách Hình thức thanh toán</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="LoaiSPAdd.aspx" >Thêm mới Loại sản phẩm</a></li>
<li > <a href ="LoaiSPList.aspx" >Danh sách Loại sản phẩm</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="MaSoSPList.aspx" >Danh sách Mã số sản phẩm</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="TrangThaiSPAdd.aspx" >Thêm mới Trạng thái sản phẩm</a></li>
<li > <a href ="TrangThaiSPList.aspx" >Danh sách Trạng thái sản phẩm</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="TrangThaiDHList.aspx" >Danh sách Trạng thái đơn hàng</a></li>
<li ><a href ="TTGiaoDichList.aspx" >Danh sách Thông tin giao dịch</a></li>
</ul></asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="contentPlaceHolder" Runat="Server">
<div style="padding:12px 12px 12px 12px;">
<div>
<div class="title">
Danh sách Khách Hàng
</div>
<div style="width:100%;">
<div style="display:table-cell; width:70%;float:left;">
Tên Khách Hàng: <asp:TextBox ID="txt_TenKH" runat="server"></asp:TextBox>
<asp:Button ID="btn_Search" runat="server" Text="Tìm kiếm" OnClick="btn_Search_Click" />
</div>
<div class="addnewrow" style="display:table-cell; width:25%;float:right;">
<a href ="khachHangAdd.aspx" >Thêm mới KH</a> |
<asp:LinkButton ID="lbt_Delete" runat="server" OnClick="lbt_Delete_Click">Xóa</asp:LinkButton>
</div>
</div>
<ContentTemplate>
<div>
<asp:Repeater ID="Repeater1" runat="server" OnItemDataBound="Repeater1_ItemDataBound">
<HeaderTemplate>
<table cellspacing="1" cellpadding="3" width="100%" bgcolor="#cccccc" border="0">
<thead>
<tr class="listtableheader">
<th>Mã KH</th>
<th>Tên KH</th>
<th>Email</th>
<th>Sửa</th>
<th><input id="cb_All" type="checkbox" onclick="CheckAll(1);" /><a href="javascript:CheckAll(2)">Chọn hết</a></th>
</tr>
</thead>
<tbody>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td><asp:Literal ID="lit_MaKH" runat="server" /></td>
<td><asp:HyperLink ID="hyp_TenKH" runat="server"></asp:HyperLink></td>
<td><asp:Literal ID="lit_Email" runat="server" /></td>
<td><asp:HyperLink ID="hyp_Edit" Text="Edit" runat="server" /></td>
<td>
<asp:CheckBox ID="cb_Xoa" runat="server" />
<asp:HiddenField ID="hf_id" runat="server" />
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
</tbody>
</table>
</FooterTemplate>
</asp:Repeater>
</div>
<div style="width:100%;">
<div style="float:left;">
<cc1:PagerV2_8 ID="PagerV2_8_1" runat="server" OnCommand="pager_Command" ></cc1:PagerV2_8>
</div>
</div>
</ContentTemplate>
</div>
</div>
</asp:Content>
| 02cdnth2 | trunk/Test/Admin/KhachHangList.aspx | ASP.NET | epl | 5,116 |
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Entities;
using Utility;
using BUS;
public partial class Admin_DoanhNghiepEdit : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
load_data();
}
}
private void load_data()
{
try
{
int id = int.Parse(Request.QueryString["id"].ToString());
tbDoanhNghiep doanhnghiep = tbDoanhNghiepBUS.GetById(id);
if (doanhnghiep != null)
{
txt_MaDN.Text = doanhnghiep.IdDoanhNghiep.ToString();
txt_TenDN.Text = doanhnghiep.TenDoanhNghiep.ToString();
txt_diachi.Text = doanhnghiep.DiaChi.ToString();
txt_dienthoai.Text = doanhnghiep.DienThoai.ToString();
}
}
catch
{
Response.Redirect("~/Admin/DoanhNghiepList.aspx");
}
}
protected void btn_Update_Click(object sender, EventArgs e)
{
try
{
tbDoanhNghiep doanhnghiep = tbDoanhNghiepBUS.GetById(int.Parse(txt_MaDN.Text));
doanhnghiep.TenDoanhNghiep = txt_TenDN.Text;
doanhnghiep.DiaChi = txt_diachi.Text;
doanhnghiep.DienThoai = txt_dienthoai.Text;
tbDoanhNghiepBUS.Update_DN (doanhnghiep);
Response.Redirect("~/Admin/DoanhNghiepList.aspx");
}
catch
{
Response.Redirect("~/Admin/DoanhNghiepList.aspx");
}
}
}
| 02cdnth2 | trunk/Test/Admin/DoanhNghiepEdit.aspx.cs | C# | epl | 1,799 |
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Entities;
using BUS;
using Utility;
public partial class Admin_SanPhamDetail : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
load_data();
}
private void load_data()
{
int iD=int.Parse (Request .QueryString ["id"].ToString ());
tbSanPham sanPham = tbSanPhamBUS.GetId(iD);
lit_MaSP.Text = sanPham.IdSanPham.ToString();
lit_TenSP.Text = sanPham.TenSP.ToString();
tbLoaiSP loaiSP=tbLoaiSPBUS .GetId (int.Parse (sanPham .IdLoaiSP .ToString ()));
lit_Loai .Text =loaiSP .TenLoai .ToString ();
tbDiaDiem diaDiem=tbDiaDiemBUS .GetById (int.Parse (sanPham .IdDiaDiem .ToString ()));
lit_DiaDiem .Text =diaDiem .TenDiaDiem .ToString ();
tbTrangThaiSP trangThaiSP = tbTrangThaiSPBUS.GetById(int.Parse (sanPham.IdTrangThaiSP.ToString()));
lit_TrangThaiSP.Text = trangThaiSP.TenTrangThai.ToString();
tbNhanVien nhanVien = tbNhanVienBUS.GetId(int.Parse (sanPham.IdNhanVien.ToString()));
lit_NhanVien.Text = nhanVien.TenNhanVien.ToString();
tbDoanhNghiep doanhNghiep = tbDoanhNghiepBUS.GetById(int.Parse (sanPham.IdDoanhNghiep.ToString()));
lit_DoanhNghiep.Text = doanhNghiep.TenDoanhNghiep.ToString();
lit_GiaBan.Text = sanPham.GiaBan.ToString();
lit_GiaTriThuc.Text = sanPham.GiaTriThuc.ToString();
txt_DKSuDung.Text = sanPham.DKSungDung.ToString();
txt_MoTa.Text = sanPham.MoTa.ToString();
lit_SLBan.Text = sanPham.SLBan.ToString();
lit_SLDaBan.Text = sanPham.SLDaBan.ToString();
lit_NgayBDBan.Text = sanPham.NgayBDBan.ToString("dd-MM-yyyy");
lit_NgayKTBan.Text = sanPham.NgayKTBan.ToString("dd-MM-yyyy");
lit_NgayCapNhat.Text = sanPham.NgayUpdate.ToString("dd-MM-yyyy");
lit_NgayDNBan.Text = sanPham.NgayDNBan.ToString("dd-MM-yyyy");
lit_TLHoaHong.Text = sanPham.TLHoaHong.ToString() + " %";
int Total = 0;
Criteria Cri = new Criteria();
Cri.add(Condition.AND, tbHinhAnhColumns.IdSanPham, Condition.EQUAL, sanPham.IdSanPham.ToString());
tbHinhAnhCollection hinhAnhCollection = tbHinhAnhBUS.Get(Cri.Criter, PagerV2_8_1 .CurrentIndex , PagerV2_8_1 .PageSize ,
tbHinhAnhColumns.IdHinhAnh.ToString(),
OrderDirection.ASC.ToString(), out Total);
Repeater1.DataSource = hinhAnhCollection;
Repeater1.DataBind();
PagerV2_8_1.ItemCount = Total;
if (PagerV2_8_1.ItemCount <= PagerV2_8_1.PageSize)
PagerV2_8_1.Visible = false;
else
PagerV2_8_1.Visible = true;
}
protected void pager_Command(object sender, CommandEventArgs e)
{
PagerV2_8_1.CurrentIndex = int.Parse(e.CommandArgument.ToString());
load_data ();
}
protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
if(e.Item .ItemType ==ListItemType .AlternatingItem ||
e.Item .ItemType == ListItemType .Item )
{
tbHinhAnh hinhAnh = (tbHinhAnh)e.Item.DataItem;
Literal lit_Hinh = (Literal)e.Item.FindControl("lit_Hinh");
lit_Hinh.Text = hinhAnh .TenHinh .ToString () ;
Image img_HinhAnh = (Image)e.Item.FindControl("img_HinhAnh");
img_HinhAnh.ImageUrl = "~/Photos/Thumb/" + hinhAnh.TenHinh.ToString();
}
}
}
| 02cdnth2 | trunk/Test/Admin/SanPhamDetail.aspx.cs | C# | epl | 3,895 |
<%@ Page Language="C#" MasterPageFile ="~/Admin/MasterPage.master" AutoEventWireup="true" CodeFile="SanPhamAdd.aspx.cs" Inherits="Admin_SanPhamAdd" %>
<asp:Content ID="Content1" ContentPlaceHolderID="menuPlaceHolder" Runat="Server">
<h5>Menu</h5>
<ul class ="Actions">
<li class ="Selected"> <a href ="sanphamAdd.aspx" >Thêm mới sản phẩm</a></li>
<li > <a href ="sanphamList.aspx" >Danh sách Sản phẩm</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="DiaDiemAdd.aspx" >Thêm mới Địa điểm</a></li>
<li > <a href ="DiaDiemList.aspx" >Danh sách Đại điểm</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="DoanhNghiepAdd.aspx" >Thêm mới Doanh nghiệp</a></li>
<li > <a href ="DoanhNghiepList.aspx" >Danh sách Doanh nghiệp</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="KhachHangAdd.aspx" >Thêm mới Khách hàng</a></li>
<li > <a href ="KhachHangList.aspx" >Danh sách Khach hàng</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="NhanVienAdd.aspx" >Thêm mới Nhân viên</a></li>
<li > <a href ="NhanVienList.aspx" >Danh sách Nhân viên</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="HinhThucTTAdd.aspx" >Thêm mới Hình thức thanh toán</a></li>
<li > <a href ="HinhThucTTList.aspx" >Danh sách Hình thức thanh toán</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="LoaiSPAdd.aspx" >Thêm mới Loại sản phẩm</a></li>
<li > <a href ="LoaiSPList.aspx" >Danh sách Loại sản phẩm</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="MaSoSPList.aspx" >Danh sách Mã số sản phẩm</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="TrangThaiSPAdd.aspx" >Thêm mới Trạng thái sản phẩm</a></li>
<li > <a href ="TrangThaiSPList.aspx" >Danh sách Trạng thái sản phẩm</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="TrangThaiDHList.aspx" >Danh sách Trạng thái đơn hàng</a></li>
<li ><a href ="TTGiaoDichList.aspx" >Danh sách Thông tin giao dịch</a></li>
</ul></asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="contentPlaceHolder" Runat="Server">
<div style="padding:12px 12px 12px 12px;">
<div>
<div class="title">
Thêm mới Sản phẩm</div>
<div>
<table width="100%" cellspacing="1" cellpadding="3" border="0" bgcolor="#cccccc">
<tr>
<td style="width:30%">Tên Sản phẩm</td>
<td style="width:70%"><asp:TextBox ID="txt_TenSP" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID ="rfv_TenSP" runat ="server" ControlToValidate ="txt_TenSP"
ErrorMessage ="Tên sản phẩm không được để trống" Display ="Dynamic" ></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td style="width:30%">
Loại SP</td>
<td style="width:70%">
<asp:DropDownList CssClass="DropDownList" ID="ddl_LoaiSP" runat="server">
</asp:DropDownList></td>
</tr>
<tr>
<td style="width:30%">
Địa điểm</td>
<td style="width:70%">
<asp:DropDownList CssClass="DropDownList" ID="ddl_DiaDiem" runat="server">
</asp:DropDownList>
</td>
</tr>
<tr>
<td style="width:30%">
Trạng Thái Sản Phẩm</td>
<td style="width:70%">
<asp:DropDownList CssClass="DropDownList" ID="ddl_TrangThaiSP" runat="server">
</asp:DropDownList>
</td>
</tr>
<tr>
<td style="width:30%">
Nhân viên</td>
<td style="width:70%"><asp:DropDownList CssClass="DropDownList" ID="ddl_NhanVien" runat="server">
</asp:DropDownList></td>
</tr>
<tr>
<td style="width:30%">
Doanh Nghiệp</td>
<td style="width:70%"><asp:DropDownList CssClass="DropDownList" ID="ddl_DoanhNghiep" runat="server">
</asp:DropDownList></td>
</tr>
<tr>
<td style="width:30%">
Giá bán</td>
<td style="width:70%">
<asp:TextBox ID="txt_GiaBan" runat="server"></asp:TextBox>
<asp:RangeValidator ID="RangeValidator1" runat="server" ControlToValidate="txt_GiaBan"
ErrorMessage="Giá trị phải là số nguyên" MaximumValue="50000000" MinimumValue="0"
Type="Integer"></asp:RangeValidator></td>
</tr>
<tr>
<td style="width:30%">
Giá trị thực</td>
<td style="width:70%">
<asp:TextBox ID="txt_GiaTriThuc" runat="server"></asp:TextBox>
<asp:RangeValidator ID="rvd_giatrithuc" runat ="server" ControlToValidate ="txt_GiaTriThuc"
ErrorMessage="Giá trị phải là số nguyên" MaximumValue ="500000000" MinimumValue ="0" Type ="Integer" ></asp:RangeValidator>
</td>
</tr>
<tr>
<td style="width:30%">
Điều kiện SD</td>
<td style="width:70%">
<asp:TextBox ID="txt_dksd" CssClass="TextBoxSearch" TextMode="MultiLine" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td style="width:30%">
Mô tả</td>
<td style="width:70%">
<asp:TextBox ID="txt_Mota" CssClass="TextBoxSearch" TextMode="MultiLine" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td style="width:30%">
Hình ảnh</td>
<td style="width:70%">
<asp:FileUpload ID="FileUpload1" runat="server" class="multi" />
</td>
</tr>
<tr>
<td style="width:30%">
Số lượng bán</td>
<td style="width:70%">
<asp:TextBox ID="txt_slban" runat="server"></asp:TextBox>
<asp:RangeValidator ID="RangeValidator2" runat ="server" ControlToValidate ="txt_slban"
ErrorMessage="Giá trị phải là số nguyên" MaximumValue ="500000000" MinimumValue ="0" Type ="Integer" ></asp:RangeValidator>
</td>
</tr>
<tr>
<td style="width:30%; height: 22px;">
Số lượng đã bán</td>
<td style="width:70%; height: 22px;">
<asp:TextBox ID="txt_slDaBan" runat="server"></asp:TextBox>
<asp:RangeValidator ID="RangeValidator3" runat ="server" ControlToValidate ="txt_slDaBan"
ErrorMessage="Giá trị phải là số nguyên" MaximumValue ="500000000" MinimumValue ="0" Type ="Integer" ></asp:RangeValidator>
</td>
</tr>
<tr>
<td style="width:30%; height: 19px;">
Ngày bắt đầu bán</td>
<td style="width:70%; height: 19px;">
Ngày:<asp:DropDownList ID="ddl_ngaybdban" runat="server" Width="45px">
</asp:DropDownList>
/ Tháng:
<asp:DropDownList ID="ddl_thangbdban" runat="server" Width="52px">
</asp:DropDownList>
/ Năm:
<asp:DropDownList ID="ddl_nambdban" runat="server">
</asp:DropDownList></td>
</tr>
<tr>
<td style="width:30%; height: 18px;">
Ngày kết thúc bán</td>
<td style="width:70%; height: 18px;">
Ngày:<asp:DropDownList ID ="ddl_ngayktban" runat ="server" Width ="45px"></asp:DropDownList>
/ Tháng: <asp:DropDownList ID ="ddl_thangktban" runat ="server" Width ="52px"></asp:DropDownList>
/ Năm: <asp:DropDownList ID ="ddl_namktban" runat ="server" ></asp:DropDownList>
</td>
</tr>
<tr>
<td style="width:30%">
Ngày Cập Nhật</td>
<td style="width:70%">
Ngày:<asp:DropDownList ID ="ddl_ngaycn" runat ="server" Width ="45px"></asp:DropDownList>
/ Tháng: <asp:DropDownList ID ="ddl_thangcn" runat ="server" Width ="52px"></asp:DropDownList>
/ Năm: <asp:DropDownList ID ="ddl_namcn" runat ="server" ></asp:DropDownList>
</td>
</tr>
<tr>
<td style="width:30%">
Ngày Doanh Nghiệp Bán</td>
<td style="width:70%">
Ngày:<asp:DropDownList ID ="ddl_ngaydnban" runat ="server" Width ="45px"></asp:DropDownList>
/ Tháng: <asp:DropDownList ID ="ddl_thangdnban" runat ="server" Width ="52px"></asp:DropDownList>
/ Năm: <asp:DropDownList ID ="ddl_namdnban" runat ="server" ></asp:DropDownList>
</td>
</tr>
<tr>
<td style="width:30%">
Tỉ lệ hoa hồng</td>
<td style="width:70%">
<asp:TextBox ID="txt_tlhoahong" runat="server"></asp:TextBox>
<asp:RangeValidator ID="RangeValidator4" runat ="server" ControlToValidate ="txt_tlhoahong"
ErrorMessage="Giá trị phải là số" MaximumValue ="500000000" MinimumValue ="0" Type ="Double" ></asp:RangeValidator>
</td>
</tr>
<tr>
<td style="width:30%"></td>
<td style="width:70%"><asp:Button ID="btn_Add" runat="server" Text="Thêm mới sản phẩm" OnClick="btn_Add_Click" /></td>
</tr>
</table>
</div>
</div>
</div>
</asp:Content> | 02cdnth2 | trunk/Test/Admin/SanPhamAdd.aspx | ASP.NET | epl | 11,397 |
<%@ Page Language="C#" MasterPageFile ="~/Admin/MasterPage.master" AutoEventWireup="true" CodeFile="DonHangList.aspx.cs" Inherits="Admin_DonHangList" %>
<%@ Register Assembly="ASPnetPagerV2_8" Namespace="ASPnetControls" TagPrefix="cc1" %>
<asp:Content ID ="Content1" ContentPlaceHolderID ="menuPlaceHolder" runat ="server" >
<h5 >Menu</h5>
<ul class="Actions">
<li class="Selected"><a href="donhanglist.aspx" >Danh sách đơn hàng</a></li>
</ul>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="contentPlaceHolder" Runat="Server">
<div style="padding:12px 12px 12px 12px;">
<div>
<div class="title">
Danh sách đơn hàng
</div>
<div style="width:100%;">
<div style="display:table-cell; width:100%;float:left;">
Id đơn hàng: <asp:TextBox ID="txt_IdDH" runat="server"></asp:TextBox>
<asp:Button ID="btn_Search" runat="server" Text="Tìm kiếm" OnClick="btn_Search_Click" />
</div>
</div>
<div class="addnewrow">
</div>
<div>
<asp:Repeater ID="Repeater1" runat="server" OnItemDataBound="Repeater1_ItemDataBound">
<HeaderTemplate>
<table cellspacing="1" cellpadding="3" width="100%" bgcolor="#cccccc" border="0">
<thead>
<tr class="listtableheader">
<th>Mã đơn hàng</th>
<th>Khách hàng</th>
<th>Ngày đặt hàng</th>
<th>Ngày giao hàng</th>
<th>Trị giá</th>
<th>Đã giao</th>
</tr>
</thead>
<tbody>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td>
<asp:HyperLink ID="hyp_DonHang" runat="server" />
<asp:HiddenField ID="hf_ID" runat="server" />
</td>
<td>
<asp:Literal ID="lit_KhachHang" runat="server"></asp:Literal>
</td>
<td><%#Eval("NgayDatHang") %></td>
<td><%#Eval("NgayGiaoHang") %></td>
<td><%#Eval("TriGia") %></td>
<td>
<asp:CheckBox ID="cb_DaGiao" runat="server" />
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
</tbody>
</table>
</FooterTemplate>
</asp:Repeater>
</div>
<div style="width:100%;">
<div style="float:left;">
<cc1:PagerV2_8 ID="PagerV2_8_1" runat="server" OnCommand="pager_Command" ></cc1:PagerV2_8>
</div>
<div style="float:right;">
<asp:Button ID="btn_Update" runat="server" Text="Update" OnClick="btn_Update_Click" />
</div>
</div>
</div>
</div>
</asp:Content>
| 02cdnth2 | trunk/Test/Admin/DonHangList.aspx | ASP.NET | epl | 2,939 |
<%@ Page Language="C#" MasterPageFile="~/Admin/MasterPage.master" AutoEventWireup="true" CodeFile="DoanhNghiepDetail.aspx.cs" Inherits="Admin_DoanhNghiepDetail" %>
<%@ Register Assembly="ASPnetPagerV2_8" Namespace="ASPnetControls" TagPrefix="cc1" %>
<asp:Content ID ="Content1" ContentPlaceHolderID ="menuPlaceHolder" runat ="server" >
<h5 >Menu</h5>
<ul class ="Actions">
<li > <a href ="doanhnghiepadd.aspx" >Thêm mới Doanh nghiệp</a></li>
<li ><a href ="DoanhNghiepList.aspx" >Danh sách Doanh nghiệp</a></li>
</ul>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="contentPlaceHolder" Runat="Server">
<div style="padding:12px 12px 12px 12px;">
<div>
<div class="title">
Chi tiết Doanh nghiệp
</div>
<div>
<table width="100%" cellspacing="1" cellpadding="3" border="0" bgcolor="#cccccc">
<tr>
<td style="width:30%">Mã Doanh Nghiệp</td>
<td style="width:70%"><asp:Literal ID="lit_MaDN" runat="server"></asp:Literal></td>
</tr>
<tr>
<td style="width:30%">Tên Doanh Nghiệp</td>
<td style="width:70%"><asp:Literal ID="lit_TenDN" runat="server"></asp:Literal></td>
</tr>
<tr>
<td style="width:30%">Địa chỉ</td>
<td style="width:70%"><asp:Literal ID="lit_DiaChi" runat="server"></asp:Literal></td>
</tr>
<tr>
<td style="width:30%">Điện thoại</td>
<td style="width:70%"><asp:Literal ID="lit_DienThoai" runat="server"></asp:Literal></td>
</tr>
</table>
</div>
</div>
</div>
</asp:Content>
| 02cdnth2 | trunk/Test/Admin/DoanhNghiepDetail.aspx | ASP.NET | epl | 1,936 |
<%@ Page Language="C#" MasterPageFile="~/Admin/MasterPage.master" AutoEventWireup="true" CodeFile="NhanVienAdd.aspx.cs" Inherits="Admin_NhanVienAdd" %>
<%@ Register Assembly="ASPnetPagerV2_8" Namespace="ASPnetControls" TagPrefix="cc1" %>
<asp:Content ID ="Content1" ContentPlaceHolderID ="menuPlaceHolder" runat ="server" >
<h5 >Menu</h5>
<ul class ="Actions">
<li > <a href ="sanphamAdd.aspx" >Thêm mới sản phẩm</a></li>
<li > <a href ="sanphamList.aspx" >Danh sách Sản phẩm</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="DiaDiemAdd.aspx" >Thêm mới Địa điểm</a></li>
<li > <a href ="DiaDiemList.aspx" >Danh sách Đại điểm</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="DoanhNghiepAdd.aspx" >Thêm mới Doanh nghiệp</a></li>
<li > <a href ="DoanhNghiepList.aspx" >Danh sách Doanh nghiệp</a></li>
</ul>
<ul class ="Actions">
<li class ="Selected"> <a href ="KhachHangAdd.aspx" >Thêm mới Khách hàng</a></li>
<li > <a href ="KhachHangList.aspx" >Danh sách Khach hàng</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="NhanVienAdd.aspx" >Thêm mới Nhân viên</a></li>
<li > <a href ="NhanVienList.aspx" >Danh sách Nhân viên</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="HinhThucTTAdd.aspx" >Thêm mới Hình thức thanh toán</a></li>
<li > <a href ="HinhThucTTList.aspx" >Danh sách Hình thức thanh toán</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="LoaiSPAdd.aspx" >Thêm mới Loại sản phẩm</a></li>
<li > <a href ="LoaiSPList.aspx" >Danh sách Loại sản phẩm</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="MaSoSPList.aspx" >Danh sách Mã số sản phẩm</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="TrangThaiSPAdd.aspx" >Thêm mới Trạng thái sản phẩm</a></li>
<li > <a href ="TrangThaiSPList.aspx" >Danh sách Trạng thái sản phẩm</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="TrangThaiDHList.aspx" >Danh sách Trạng thái đơn hàng</a></li>
<li ><a href ="TTGiaoDichList.aspx" >Danh sách Thông tin giao dịch</a></li>
</ul></asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="contentPlaceHolder" Runat="Server">
<div style="padding:12px 12px 12px 12px;">
<div>
<div class="title">
Thêm mới Nhân viên
</div>
<div>
<table width="100%" cellspacing="1" cellpadding="3" border="0" bgcolor="#cccccc">
<tr>
<td style="width:30%">Tài khoản</td>
<td style="width:70%"><asp:TextBox ID="txt_TaiKhoan" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td style="width:30%">Mật khẩu</td>
<td style="width:70%"><asp:TextBox ID="txt_MatKhau" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td style="width:30%">Tên Nhân viên</td>
<td style="width:70%"><asp:TextBox ID="txt_TenNV" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td style="width:30%">Địa chỉ</td>
<td style="width:70%"><asp:TextBox ID="txt_DiaChi" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td style="width:30%">Điện thoại</td>
<td style="width:70%"><asp:TextBox ID="txt_DienThoai" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td style="width:30%"></td>
<td style="width:70%"><asp:Button ID="btn_Add" runat="server" Text="Thêm mới" OnClick="btn_Add_Click" /></td>
</tr>
</table>
</div>
</div>
</div>
</asp:Content> | 02cdnth2 | trunk/Test/Admin/NhanVienAdd.aspx | ASP.NET | epl | 4,134 |
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Entities;
using DAL;
using Utility;
using BUS;
using System.IO;
public partial class Admin_SanPhamAdd : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
load_data();
load_DateTime();
}
}
private void load_data()
{ // load loai san pham
ddl_LoaiSP.DataSource = tbLoaiSPBUS.GetAll();
ddl_LoaiSP.DataTextField = tbLoaiSPColumns.TenLoai.ToString();
ddl_LoaiSP.DataValueField = tbLoaiSPColumns.IdLoaiSP.ToString();
ddl_LoaiSP.DataBind();
//load dia diem
ddl_DiaDiem.DataSource = tbDiaDiemBUS.GetAll();
ddl_DiaDiem.DataTextField = tbDiaDiemColumns .TenDiaDiem .ToString();
ddl_DiaDiem.DataValueField = tbDiaDiemColumns.IdDiaDiem.ToString();
ddl_DiaDiem.DataBind();
//load trang thai san pham
ddl_TrangThaiSP.DataSource = tbTrangThaiSPBUS.GetAll();
ddl_TrangThaiSP.DataTextField = tbTrangThaiSPColumns.TenTrangThai.ToString ();
ddl_TrangThaiSP.DataValueField = tbTrangThaiSPColumns.IdTrangThaiSP.ToString ();
ddl_TrangThaiSP.DataBind();
//load nhan vien
ddl_NhanVien.DataSource = tbNhanVienBUS.GetAll();
ddl_NhanVien.DataTextField = tbNhanVienColumns.TenNhanVien.ToString();
ddl_NhanVien.DataValueField = tbNhanVienColumns.IdNhanVien.ToString();
ddl_NhanVien.DataBind();
//load doanh nghiep
ddl_DoanhNghiep.DataSource = tbDoanhNghiepBUS.GetAll();
ddl_DoanhNghiep.DataTextField = tbDoanhNghiepColumns.TenDoanhNghiep.ToString();
ddl_DoanhNghiep.DataValueField = tbDoanhNghiepColumns.IdDoanhNghiep.ToString();
ddl_DoanhNghiep.DataBind();
}
private void load_DateTime()
{
for (int i = 1; i <= 31; i++)
{
ddl_ngaybdban .Items.Add(i.ToString ("00"));
ddl_ngayktban .Items.Add(i.ToString("00"));
ddl_ngaycn.Items.Add(i.ToString("00"));
ddl_ngaydnban.Items.Add(i.ToString("00"));
}
for (int i = 1; i <= 12; i++)
{
ddl_thangbdban.Items.Add(i.ToString("00"));
ddl_thangktban .Items.Add(i.ToString("00"));
ddl_thangcn .Items.Add(i.ToString("00"));
ddl_thangdnban .Items.Add(i.ToString("00"));
}
for(int i=DateTime .Now .Year -10;i<=DateTime .Now .Year +10;i++)
{
ddl_nambdban.Items.Add(i.ToString());
ddl_namktban.Items.Add(i.ToString());
ddl_namcn .Items .Add (i.ToString ());
ddl_namdnban .Items .Add (i.ToString ());
}
}
protected void btn_Add_Click(object sender, EventArgs e)
{
tbSanPham sanPham = new tbSanPham();
sanPham.TenSP = txt_TenSP.Text;
sanPham.IdLoaiSP = int.Parse(ddl_LoaiSP.SelectedValue);
sanPham .IdDiaDiem =int.Parse (ddl_DiaDiem .SelectedValue );
sanPham.IdTrangThaiSP = int.Parse(ddl_TrangThaiSP.SelectedValue);
sanPham.IdNhanVien = int.Parse(ddl_NhanVien.SelectedValue);
sanPham.IdDoanhNghiep = int.Parse(ddl_NhanVien .SelectedValue);
sanPham.GiaBan = int.Parse (txt_GiaBan.Text);
sanPham.GiaTriThuc = int.Parse (txt_GiaTriThuc.Text);
sanPham.DKSungDung = txt_dksd.Text;
sanPham.MoTa = txt_Mota.Text;
sanPham.SLBan = int.Parse (txt_slban.Text);
sanPham.SLDaBan = int.Parse (txt_slDaBan.Text);
sanPham.NgayBDBan = DateTime.Parse(ddl_thangbdban.SelectedValue + "/" + ddl_ngaybdban.SelectedValue + "/" + ddl_nambdban.SelectedValue);
sanPham.NgayKTBan = DateTime.Parse(ddl_thangktban.SelectedValue + "/" + ddl_ngayktban.SelectedValue + "/" + ddl_namktban.SelectedValue);
sanPham.NgayUpdate = DateTime.Parse(ddl_thangcn.SelectedValue + "/" + ddl_ngaycn.SelectedValue + "/" + ddl_namcn.SelectedValue);
sanPham.NgayDNBan = DateTime .Parse (ddl_thangdnban .SelectedValue + "/" + ddl_ngaydnban.SelectedValue + "/" + ddl_namdnban.SelectedValue);
sanPham.TLHoaHong = float .Parse (txt_tlhoahong .Text);
int iD= tbSanPhamBUS.Insert_SP(sanPham);
HttpFileCollection hfc = Request.Files;
for (int i = 0; i < hfc.Count; i++)
{
HttpPostedFile hpf = hfc[i];
if (hpf.ContentLength > 0)
{
string filename = DateTime.Now.Ticks.ToString() + "_" + Path.GetFileName(hpf.FileName);
hpf.SaveAs(Server.MapPath("~/Photos/") + "\\" + filename .ToString ());
System.Drawing.Image img = System.Drawing.Image.FromFile(Server.MapPath("~/Photos/") + filename);
ImageUtility.MakeThumbnailPhoto(img, 100, 100, Server.MapPath("~/Photos/Thumb/"), filename);
tbHinhAnh hinhAnh = new tbHinhAnh();
hinhAnh.TenHinh = filename.ToString();
hinhAnh.DuongDan = "Photos/" + filename.ToString();
hinhAnh.IdSanPham = iD;
tbHinhAnhBUS.Insert(hinhAnh);
}
}
Response.Redirect("~/Admin/SanPhamList.aspx");
}
}
| 02cdnth2 | trunk/Test/Admin/SanPhamAdd.aspx.cs | C# | epl | 5,492 |
using System;
using System.Data;
using System.Data.Sql;
using System.Data.SqlClient;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Entities;
using BUS;
using Utility;
public partial class Admin_Login : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if( Session ["UserName"] !=null && Session ["Pass"]!=null )
Response.Redirect("~/Admin/SanPhamList.aspx");
}
protected void btn_DangNhap_Click(object sender, EventArgs e)
{
string User = txt_TaiKhoan.Text;
string Pass = txt_MatKhau.Text;
if(tbNhanVienBUS .DangNhap (User ,Pass ))
{
Session["UserName"] = User;
Session["Pass"] = Pass;
Response.Redirect("~/Admin/SanPhamList.aspx");
//lb_Error.Text = "Dang nhap thanh cong";
}
else
lb_Error.Text = "Tên đăng nhập hoặc mật khẩu không đúng";
}
}
| 02cdnth2 | trunk/Test/Admin/Default.aspx.cs | C# | epl | 1,192 |
<%@ Page Language="C#" MasterPageFile ="~/Admin/MasterPage.master" AutoEventWireup="true" CodeFile="KhachHangEdit.aspx.cs" Inherits="Admin_KhachHangEdit" %>
<%@ Register Assembly="ASPnetPagerV2_8" Namespace="ASPnetControls" TagPrefix="cc1" %>
<asp:Content ID ="Content1" ContentPlaceHolderID ="menuPlaceHolder" runat ="server" >
<h5 >Menu</h5>
<ul class ="Actions">
<li > <a href ="sanphamAdd.aspx" >Thêm mới sản phẩm</a></li>
<li > <a href ="sanphamList.aspx" >Danh sách Sản phẩm</a></li>
<li > <a href ="DiaDiemAdd.aspx" >Thêm mới Địa điểm</a></li>
<li > <a href ="DiaDiemList.aspx" >Danh sách Đại điểm</a></li>
<li > <a href ="DoanhNghiepAdd.aspx" >Thêm mới Doanh nghiệp</a></li>
<li > <a href ="DoanhNghiepList.aspx" >Danh sách Doanh nghiệp</a></li>
<li > <a href ="KhachHangAdd.aspx" >Thêm mới Khách hàng</a></li>
<li > <a href ="KhachHangList.aspx" >Danh sách Khach hàng</a></li>
<li > <a href ="NhanVienAdd.aspx" >Thêm mới Nhân viên</a></li>
<li > <a href ="NhanVienList.aspx" >Danh sách Nhân viên</a></li>
<li > <a href ="HinhThucTTAdd.aspx" >Thêm mới Hình thức thanh toán</a></li>
<li > <a href ="HinhThucTTList.aspx" >Danh sách Hình thức thanh toán</a></li>
<li > <a href ="LoaiSPAdd.aspx" >Thêm mới Loại sản phẩm</a></li>
<li > <a href ="LoaiSPList.aspx" >Danh sách Loại sản phẩm</a></li>
<li > <a href ="MaSoSPList.aspx" >Danh sách Mã số sản phẩm</a></li>
<li > <a href ="TrangThaiSPAdd.aspx" >Thêm mới Trạng thái sản phẩm</a></li>
<li > <a href ="TrangThaiSPList.aspx" >Danh sách Trạng thái sản phẩm</a></li>
<li > <a href ="TrangThaiDHList.aspx" >Danh sách Trạng thái đơn hàng</a></li>
<li class ="Selected"><a href ="TTGiaoDichList.aspx" >Danh sách Thông tin giao dịch</a></li>
</ul>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="contentPlaceHolder" Runat="Server">
<div style="padding:12px 12px 12px 12px;">
<div>
<div class="title">
Update Khách hàng
</div>
<div>
<table width="100%" cellspacing="1" cellpadding="3" border="0" bgcolor="#cccccc">
<tr>
<td style="width:30%">Mã Khách hàng</td>
<td style="width:70%"><asp:TextBox Enabled="false" ID="txt_MaKH" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td style="width:30%">Tên Khách hàng</td>
<td style="width:70%"><asp:TextBox ID="txt_TenKH" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td style="width:30%">Email</td>
<td style="width:70%"><asp:TextBox ID="txt_Email" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td style="width:30%">Mật khẩu</td>
<td style="width:70%"><asp:TextBox ID="txt_MatKhau" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td style="width:30%">Địa chỉ</td>
<td style="width:70%"><asp:TextBox ID="txt_diachi" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td style="width:30%">Điện thoại</td>
<td style="width:70%"><asp:TextBox ID="txt_dienthoai" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td style="width:30%"></td>
<td style="width:70%"><asp:Button ID="btn_Update" runat="server" Text="Update Khách hàng" OnClick="btn_Update_Click" /></td>
</tr>
</table>
</div>
</div>
</div>
</asp:Content> | 02cdnth2 | trunk/Test/Admin/KhachHangEdit.aspx | ASP.NET | epl | 4,027 |
<%@ Page Language="C#" MasterPageFile ="~/Admin/MasterPage.master" AutoEventWireup="true" CodeFile="TrangThaiDHList.aspx.cs" Inherits="Admin_TrangThaiDHList" %>
<%@ Register Assembly="ASPnetPagerV2_8" Namespace="ASPnetControls" TagPrefix="cc1" %>
<asp:Content ID ="Content1" ContentPlaceHolderID ="menuPlaceHolder" runat ="server" >
<h5 >Menu</h5>
<ul class ="Actions">
<li > <a href ="sanphamAdd.aspx" >Thêm mới sản phẩm</a></li>
<li > <a href ="sanphamList.aspx" >Danh sách Sản phẩm</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="DiaDiemAdd.aspx" >Thêm mới Địa điểm</a></li>
<li > <a href ="DiaDiemList.aspx" >Danh sách Đại điểm</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="DoanhNghiepAdd.aspx" >Thêm mới Doanh nghiệp</a></li>
<li > <a href ="DoanhNghiepList.aspx" >Danh sách Doanh nghiệp</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="KhachHangAdd.aspx" >Thêm mới Khách hàng</a></li>
<li > <a href ="KhachHangList.aspx" >Danh sách Khach hàng</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="NhanVienAdd.aspx" >Thêm mới Nhân viên</a></li>
<li > <a href ="NhanVienList.aspx" >Danh sách Nhân viên</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="HinhThucTTAdd.aspx" >Thêm mới Hình thức thanh toán</a></li>
<li > <a href ="HinhThucTTList.aspx" >Danh sách Hình thức thanh toán</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="LoaiSPAdd.aspx" >Thêm mới Loại sản phẩm</a></li>
<li > <a href ="LoaiSPList.aspx" >Danh sách Loại sản phẩm</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="MaSoSPList.aspx" >Danh sách Mã số sản phẩm</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="TrangThaiSPAdd.aspx" >Thêm mới Trạng thái sản phẩm</a></li>
<li class ="Selected"> <a href ="TrangThaiSPList.aspx" >Danh sách Trạng thái sản phẩm</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="TrangThaiDHList.aspx" >Danh sách Trạng thái đơn hàng</a></li>
<li ><a href ="TTGiaoDichList.aspx" >Danh sách Thông tin giao dịch</a></li>
</ul></asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="contentPlaceHolder" Runat="Server">
<div style="padding:12px 12px 12px 12px;">
<div>
<div class="title">
Danh sách Trạng thái đơn hàng
</div>
<ContentTemplate>
<div>
<asp:Repeater ID="Repeater1" runat="server" OnItemDataBound="Repeater1_ItemDataBound">
<HeaderTemplate>
<table cellspacing="1" cellpadding="3" width="100%" bgcolor="#cccccc" border="0">
<thead>
<tr class="listtableheader">
<th>Mã TT DH</th>
<th>Trạng Thái DH</th>
</tr>
</thead>
<tbody>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td><asp:Literal ID="lit_MaTT" runat="server" /></td>
<td><asp:Literal ID="lit_TenTT" runat="server"/></td>
</tr>
</ItemTemplate>
<FooterTemplate>
</tbody>
</table>
</FooterTemplate>
</asp:Repeater>
</div>
<div style="width:100%;">
<div style="float:left;">
<cc1:PagerV2_8 ID="PagerV2_8_1" runat="server" GenerateFirstLastSection="true" OnCommand="pager_Command"
GeneratePagerInfoSection="false" GenerateSmartShortCuts="false"
GenerateHiddenHyperlinks="false" NormalModePageCount="5" ></cc1:PagerV2_8>
</div>
</div>
</ContentTemplate>
</div>
</div>
</asp:Content>
| 02cdnth2 | trunk/Test/Admin/TrangThaiDHList.aspx | ASP.NET | epl | 4,110 |
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Entities;
using Utility;
using BUS;
public partial class Admin_TTGiaoDichList : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
load_data();
}
}
private void load_data()
{
PagerV2_8_1.PageSize = 5;
Criteria cri = new Criteria();
int Total = 0;
if (txt_idgd.Text != "")
{
cri.add(Condition.AND, tbTTGiaoDichColumns.IdTTGiaoDich.ToString(), Condition.EQUAL, int.Parse(txt_idgd.Text));
}
//PagerV2_8_1 .PageSize =int.Parse (ConfigurationManager.AppSettings ["pagesize"].ToString ());
tbTTGiaoDichCollection ttgdcolection = tbTTGiaoDichBUS .Get(cri.Criter, PagerV2_8_1.CurrentIndex,
PagerV2_8_1.PageSize, tbTTGiaoDichColumns .IdHinhThuc .ToString(),
OrderDirection.ASC.ToString(), out Total);
Repeater1.DataSource = ttgdcolection;
Repeater1.DataBind();
PagerV2_8_1.ItemCount = Total;
if (Total <= PagerV2_8_1.PageSize)
PagerV2_8_1.Visible = false;
}
protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
Literal lit_MaTT = (Literal)e.Item.FindControl("lit_MaTT");
HyperLink hyp_MaDH = (HyperLink)e.Item.FindControl("hyp_MaDH");
Literal lit_HinhThucTT = (Literal)e.Item.FindControl("lit_HinhThucTT");
Literal lit_SoTien = (Literal)e.Item.FindControl("lit_SoTien");
tbTTGiaoDich ttgiaodich = (tbTTGiaoDich)e.Item.DataItem;
lit_MaTT.Text = ttgiaodich.IdTTGiaoDich.ToString() ;
hyp_MaDH.Text = ttgiaodich.IdDH.ToString();
int iD = int.Parse (ttgiaodich.IdHinhThuc.ToString());
tbHinhThucTT htthanhtoan = tbHinhThucTTBUS.GetById(iD);
hyp_MaDH.NavigateUrl = "DonHangList.aspx?id=" + ttgiaodich.IdDH.ToString();
lit_HinhThucTT.Text = htthanhtoan.TenHinhThuc.ToString();
lit_SoTien.Text = ttgiaodich.SoTien.ToString();
}
}
protected void btn_Search_Click(object sender, EventArgs e)
{
load_data();
}
protected void pager_Command(object sender, CommandEventArgs e)
{
PagerV2_8_1.CurrentIndex = int.Parse(e.CommandArgument.ToString());
load_data();
}
}
| 02cdnth2 | trunk/Test/Admin/TTGiaoDichList.aspx.cs | C# | epl | 2,882 |
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Entities;
using BUS;
public partial class Admin_KhachHangDetail : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
load_data();
}
}
private void load_data()
{
try
{
int iD = int.Parse(Request.QueryString["id"].ToString());
tbKhachHang khachhang = tbKhachHangBUS.GetByID(iD);
if (khachhang != null)
{
lit_MaKH.Text = khachhang.IdKhachHang.ToString();
lit_TenKH.Text = khachhang.HoTen.ToString();
lit_Email.Text = khachhang.Email.ToString();
lit_MatKhau.Text = khachhang.MatKhau.ToString();
lit_DiaChi.Text = khachhang.DiaChi.ToString();
lit_DienThoai.Text = khachhang.DienThoai.ToString();
}
}
catch
{
Response.Redirect("~/Admin/KhachHangList.aspx");
}
}
}
| 02cdnth2 | trunk/Test/Admin/KhachHangDetail.aspx.cs | C# | epl | 1,289 |
<%@ Page Language="C#" MasterPageFile ="~/Admin/MasterPage.master" AutoEventWireup="true" CodeFile="NhanVienEdit.aspx.cs" Inherits="Admin_NhanVienEdit" %>
<%@ Register Assembly="ASPnetPagerV2_8" Namespace="ASPnetControls" TagPrefix="cc1" %>
<asp:Content ID ="Content1" ContentPlaceHolderID ="menuPlaceHolder" runat ="server" >
<h5 >Menu</h5>
<ul class ="Actions">
<li> <a href ="nhanvienadd.aspx" >Thêm mới Nhân viên</a></li>
<li ><a href ="nhanVienList.aspx" >Danh sách Nhân viên</a></li>
</ul>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="contentPlaceHolder" Runat="Server">
<div style="padding:12px 12px 12px 12px;">
<div>
<div class="title">
Update Nhân viên
</div>
<div>
<table width="100%" cellspacing="1" cellpadding="3" border="0" bgcolor="#cccccc">
<tr>
<td style="width:30%">Mã Nhân viên</td>
<td style="width:70%"><asp:TextBox Enabled="false" ID="txt_MaNV" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td style="width:30%">Tài Khoản</td>
<td style="width:70%"><asp:TextBox ID="txt_TaiKhoan" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td style="width:30%">Mật khẩu</td>
<td style="width:70%"><asp:TextBox ID="txt_MatKhau" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td style="width:30%">Tên Nhân viên</td>
<td style="width:70%"><asp:TextBox ID="txt_TenNV" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td style="width:30%">Địa chỉ</td>
<td style="width:70%"><asp:TextBox ID="txt_DiaChi" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td style="width:30%">Điện thoại</td>
<td style="width:70%"><asp:TextBox ID="txt_DienThoai" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td style="width:30%"></td>
<td style="width:70%"><asp:Button ID="btn_Update" runat="server" Text="Update Nhân viên" OnClick="btn_Update_Click" /></td>
</tr>
</table>
</div>
</div>
</div>
</asp:Content>
| 02cdnth2 | trunk/Test/Admin/NhanVienEdit.aspx | ASP.NET | epl | 2,556 |
<%@ Page Language="C#" MasterPageFile ="~/Admin/MasterPage.master" AutoEventWireup="true" CodeFile="CTDonHangList.aspx.cs" Inherits="Admin_CTDonHangList" %>
<%@ Register Assembly="ASPnetPagerV2_8" Namespace="ASPnetControls" TagPrefix="cc1" %>
<asp:Content ID ="Content1" ContentPlaceHolderID ="menuPlaceHolder" runat ="server" >
<h5 >Menu</h5>
<ul class="Actions">
<li class="Selected"><a href="donhanglist.aspx" >Danh sách đơn hàng</a></li>
</ul>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="contentPlaceHolder" Runat="Server">
<div style="padding:12px 12px 12px 12px;">
<div >
<div class="title">
Chi tiết đơn hàng
</div>
<div>
<table width="100%" cellspacing="1" cellpadding="3" border="0" bgcolor="#cccccc">
<tr>
<td style="width:30%">Mã đơn hàng</td>
<td style="width:70%">
<asp:Literal ID="lit_MaDonHang" runat="server"></asp:Literal>
</td>
</tr>
<tr>
<td style="width:30%">Khách hàng</td>
<td style="width:70%">
<asp:Literal ID="lit_KhachHang" runat="server"></asp:Literal>
</td>
</tr>
<tr>
<td style="width:30%">Ngày đặt hàng</td>
<td style="width:70%">
<asp:Literal ID="lit_NgayDatHang" runat="server"></asp:Literal>
</td>
</tr>
<tr>
<td style="width:30%">Ngày giao hàng</td>
<td style="width:70%">
<asp:Literal ID="lit_NgayGiaoHang" runat="server"></asp:Literal>
</td>
</tr>
<tr>
<td style="width:30%">Địa chỉ giao hàng</td>
<td style="width:70%">
<asp:Literal ID="lit_DiaChiNhanHang" runat="server"></asp:Literal>
</td>
</tr>
<tr>
<td style="width:30%">Trị giá</td>
<td style="width:70%">
<asp:Literal ID="lit_TriGia" runat="server"></asp:Literal>
</td>
</tr>
<tr>
<td style="width:30%">Đã giao hàng</td>
<td style="width:70%">
<asp:CheckBox ID="cb_DaGiao" Enabled="false" runat="server" />
</td>
</tr>
</table>
</div>
<div style="padding-top:10px;">
<asp:Repeater ID="Repeater1" runat="server" OnItemDataBound="Repeater1_ItemDataBound">
<HeaderTemplate>
<table cellspacing="1" cellpadding="3" width="100%" bgcolor="#cccccc" border="0">
<thead>
<tr class="listtableheader">
<th>Sách</th>
<th>Số lượng</th>
<th>Đơn giá</th>
<th>Thành tiền</th>
</tr>
</thead>
<tbody>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td>
<asp:Literal ID="lit_TenSP" runat="server"></asp:Literal></td>
<td><%#Eval("SoLuong") %></td>
<td><%#Eval("DonGia") %></td>
<td>
<asp:Literal ID="lit_ThanhTien" runat="server"></asp:Literal></td>
</tr>
</ItemTemplate>
<FooterTemplate>
</tbody>
</table>
</FooterTemplate>
</asp:Repeater>
</div>
<div style="width:100%;">
<div style="float:left;">
<cc1:PagerV2_8 ID="PagerV2_8_1" runat="server" OnCommand="pager_Command" ></cc1:PagerV2_8>
</div>
</div>
</div>
</div>
</asp:Content>
| 02cdnth2 | trunk/Test/Admin/CTDonHangList.aspx | ASP.NET | epl | 4,312 |
<%@ Page Language="C#" MasterPageFile ="~/Admin/MasterPage.master" AutoEventWireup="true" CodeFile="TTGiaoDichList.aspx.cs" Inherits="Admin_TTGiaoDichList" %>
<%@ Register Assembly="ASPnetPagerV2_8" Namespace="ASPnetControls" TagPrefix="cc1" %>
<asp:Content ID ="Content1" ContentPlaceHolderID ="menuPlaceHolder" runat ="server" >
<h5 >Menu</h5>
<ul class ="Actions">
<li > <a href ="sanphamAdd.aspx" >Thêm mới sản phẩm</a></li>
<li > <a href ="sanphamList.aspx" >Danh sách Sản phẩm</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="DiaDiemAdd.aspx" >Thêm mới Địa điểm</a></li>
<li > <a href ="DiaDiemList.aspx" >Danh sách Đại điểm</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="DoanhNghiepAdd.aspx" >Thêm mới Doanh nghiệp</a></li>
<li > <a href ="DoanhNghiepList.aspx" >Danh sách Doanh nghiệp</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="KhachHangAdd.aspx" >Thêm mới Khách hàng</a></li>
<li > <a href ="KhachHangList.aspx" >Danh sách Khach hàng</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="NhanVienAdd.aspx" >Thêm mới Nhân viên</a></li>
<li > <a href ="NhanVienList.aspx" >Danh sách Nhân viên</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="HinhThucTTAdd.aspx" >Thêm mới Hình thức thanh toán</a></li>
<li > <a href ="HinhThucTTList.aspx" >Danh sách Hình thức thanh toán</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="LoaiSPAdd.aspx" >Thêm mới Loại sản phẩm</a></li>
<li > <a href ="LoaiSPList.aspx" >Danh sách Loại sản phẩm</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="MaSoSPList.aspx" >Danh sách Mã số sản phẩm</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="TrangThaiSPAdd.aspx" >Thêm mới Trạng thái sản phẩm</a></li>
<li > <a href ="TrangThaiSPList.aspx" >Danh sách Trạng thái sản phẩm</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="TrangThaiDHList.aspx" >Danh sách Trạng thái đơn hàng</a></li>
<li class ="Selected"><a href ="TTGiaoDichList.aspx" >Danh sách Thông tin giao dịch</a></li>
</ul></asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="contentPlaceHolder" Runat="Server">
<div style="padding:12px 12px 12px 12px;">
<div>
<div class="title">
Danh sách thông tin giao dịch
</div>
<div style="width:100%;">
<div style="display:table-cell; width:70%;float:left;">
Mã TT Giao Dịch: <asp:TextBox ID="txt_idgd" runat="server"></asp:TextBox>
<asp:Button ID="btn_Search" runat="server" Text="Tìm kiếm" OnClick="btn_Search_Click" />
</div>
</div>
<ContentTemplate>
<div>
<asp:Repeater ID="Repeater1" runat="server" OnItemDataBound="Repeater1_ItemDataBound">
<HeaderTemplate>
<table cellspacing="1" cellpadding="3" width="100%" bgcolor="#cccccc" border="0">
<thead>
<tr class="listtableheader">
<th>Mã TTGD</th>
<th>Mã DH</th>
<th>Hình Thức</th>
<th>Số tiền</th>
</tr>
</thead>
<tbody>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td><asp:Literal ID="lit_MaTT" runat="server" /></td>
<td><asp:HyperLink ID="hyp_MaDH" runat="server"></asp:HyperLink></td>
<td><asp:Literal ID="lit_HinhThucTT" runat="server" /></td>
<td><asp:Literal ID="lit_SoTien" runat="server"/></td>
</tr>
</ItemTemplate>
<FooterTemplate>
</tbody>
</table>
</FooterTemplate>
</asp:Repeater>
</div>
<div style="width:100%;">
<div style="float:left;">
<cc1:PagerV2_8 ID="PagerV2_8_1" runat="server" GenerateFirstLastSection="true" OnCommand="pager_Command"
GeneratePagerInfoSection="false" GenerateSmartShortCuts="false"
GenerateHiddenHyperlinks="false" NormalModePageCount="5" ></cc1:PagerV2_8>
</div>
</div>
</ContentTemplate>
</div>
</div>
</asp:Content>
| 02cdnth2 | trunk/Test/Admin/TTGiaoDichList.aspx | ASP.NET | epl | 4,702 |
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Entities;
using BUS;
public partial class Admin_HinhThucTTAdd : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btn_Add_Click(object sender, EventArgs e)
{
tbHinhThucTT hinhthuctt = new tbHinhThucTT();
hinhthuctt.TenHinhThuc = txt_TenHT.Text;
tbHinhThucTTBUS.Insert(hinhthuctt);
Response.Redirect("~/Admin/HinhThucTTList.aspx");
}
}
| 02cdnth2 | trunk/Test/Admin/HinhThucTTAdd.aspx.cs | C# | epl | 729 |
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Entities;
using BUS;
public partial class Admin_KhachHangEdit : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
load_data();
}
}
private void load_data()
{
try
{
int id = int.Parse(Request.QueryString["id"].ToString());
tbKhachHang khachhang = tbKhachHangBUS .GetByID (id);
if (khachhang != null)
{
txt_MaKH.Text = khachhang.IdKhachHang.ToString();
txt_TenKH.Text = khachhang.HoTen.ToString();
txt_Email.Text = khachhang.Email .ToString();
txt_MatKhau.Text = khachhang.MatKhau.ToString();
txt_diachi.Text = khachhang.DiaChi.ToString();
txt_dienthoai.Text = khachhang.DienThoai .ToString();
}
}
catch
{
Response.Redirect("~/Admin/KhachHangList.aspx");
}
}
protected void btn_Update_Click(object sender, EventArgs e)
{
try
{
tbKhachHang khachhang = tbKhachHangBUS .GetByID (int.Parse(txt_MaKH .Text));
khachhang.IdKhachHang = int.Parse (txt_MaKH.Text);
khachhang.HoTen = txt_TenKH.Text;
khachhang.Email = txt_Email.Text;
khachhang.MatKhau = txt_MatKhau.Text;
khachhang.DiaChi = txt_diachi.Text;
khachhang.DienThoai = txt_dienthoai.Text;
tbKhachHangBUS .Update (khachhang );
Response.Redirect("~/Admin/KhachHangList.aspx");
}
catch
{
Response.Redirect("~/Admin/KhachHangList.aspx");
}
}
}
| 02cdnth2 | trunk/Test/Admin/KhachHangEdit.aspx.cs | C# | epl | 2,022 |
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class Admin_LoaiSPDetail : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
| 02cdnth2 | trunk/Test/Admin/LoaiSPDetail.aspx.cs | C# | epl | 416 |
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Entities;
using BUS;
using Utility;
public partial class Admin_DonHangList : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
LoadData();
}
}
private void LoadData()
{
PagerV2_8_1 .PageSize = 5;
int total = 0;
Criteria cri = new Criteria();
if (txt_IdDH.Text != "")
{
cri.add(Condition.AND, tbDonHangColumns.IdDH.ToString(), Condition.EQUAL, int.Parse (txt_IdDH.Text));
}
Repeater1.DataSource = tbDonHangBUS.Get(cri.Criter, PagerV2_8_1.CurrentIndex,
PagerV2_8_1.PageSize, tbDonHangColumns.NgayDatHang .ToString(), OrderDirection.DESC.ToString(), out total);
Repeater1.DataBind();
PagerV2_8_1.ItemCount = total;
if (PagerV2_8_1.ItemCount <= PagerV2_8_1.PageSize)
PagerV2_8_1.Visible = false;
else
PagerV2_8_1.Visible = true;
}
protected void pager_Command(object sender, CommandEventArgs e)
{
PagerV2_8_1.CurrentIndex = int.Parse(e.CommandArgument.ToString());
LoadData();
}
protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.AlternatingItem ||
e.Item.ItemType == ListItemType.Item)
{
tbDonHang donHang = (tbDonHang)e.Item.DataItem;
tbKhachHang khachHang = tbKhachHangBUS.GetByID(donHang.IdDH );
if (khachHang != null)
{
Literal lit_KhachHang = (Literal)e.Item.FindControl("lit_KhachHang");
lit_KhachHang.Text = khachHang.HoTen;
}
HyperLink hyp_DonHang = (HyperLink)e.Item.FindControl("hyp_DonHang");
hyp_DonHang.Text = donHang.IdDH.ToString();
hyp_DonHang.NavigateUrl = "~/Admin/CTDonHangList.aspx?id=" + donHang.IdDH.ToString();
CheckBox cb_DaGiao = (CheckBox)e.Item.FindControl("cb_DaGiao");
tbTrangThaiDH trangthaidh = tbTrangThaiDHBUS.GetById(int.Parse(donHang.IdTrangThaiDH.ToString()));
cb_DaGiao.Checked = trangthaidh .TrangThai_DH ;
if (cb_DaGiao.Checked == true)
{
cb_DaGiao.Enabled = false;
}
HiddenField hf_ID = (HiddenField)e.Item.FindControl("hf_ID");
hf_ID.Value = donHang.IdDH .ToString();
}
}
protected void btn_Update_Click(object sender, EventArgs e)
{
for (int i = 0; i < Repeater1.Items.Count; i++)
{
CheckBox cb_DaGiao = (CheckBox)Repeater1.Items[i].FindControl("cb_DaGiao");
if (cb_DaGiao.Enabled == true && cb_DaGiao.Checked == true)
{
HiddenField hf_ID = (HiddenField)Repeater1.Items[i].FindControl("hf_ID");
tbDonHang donHang = tbDonHangBUS.GetByID(int.Parse(hf_ID.Value));
donHang.IdTrangThaiDH = 1 ;
tbDonHangBUS.Update(donHang);
}
}
Response.Redirect(Request.RawUrl);
}
protected void btn_Search_Click(object sender, EventArgs e)
{
LoadData();
}
}
| 02cdnth2 | trunk/Test/Admin/DonHangList.aspx.cs | C# | epl | 3,539 |
<%@ Page Language="C#" MasterPageFile="~/Admin/MasterPage.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Admin_Login"%>
<asp:Content ID="Content1" ContentPlaceHolderID="menuPlaceHolder" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="contentPlaceHolder" Runat="Server">
<div style="padding:12px 12px 12px 12px;">
<div>
<div class="title">
Đăng nhập
</div>
<div>
<table width="100%" cellspacing="1" cellpadding="3" border="0" bgcolor="#cccccc">
<tr>
<td style="width:30%">Tài khoản</td>
<td style="width:70%">
<asp:TextBox ID="txt_TaiKhoan" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td style="width:30%">Mật khẩu</td>
<td style="width:70%">
<asp:TextBox ID="txt_MatKhau" TextMode="Password" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td style="width:30%"></td>
<td style="width:70%">
<asp:Button ID="btn_DangNhap" runat="server" Text="Đăng nhập" OnClick="btn_DangNhap_Click" />
</td>
</tr>
<tr>
<td style="width:30%"></td>
<td style="width:70%">
<asp:Label ID="lb_Error" runat="server" ForeColor="red"></asp:Label>
</td>
</tr>
</table>
</div>
</div>
</div>
</asp:Content>
| 02cdnth2 | trunk/Test/Admin/Default.aspx | ASP.NET | epl | 1,770 |
<%@ Page Language="C#" MasterPageFile ="~/Admin/MasterPage.master" AutoEventWireup="true" CodeFile="HinhThucTTEdit.aspx.cs" Inherits="Admin_HinhThucTTEdit" %>
<%@ Register Assembly="ASPnetPagerV2_8" Namespace="ASPnetControls" TagPrefix="cc1" %>
<asp:Content ID ="Content1" ContentPlaceHolderID ="menuPlaceHolder" runat ="server" >
<h5 >Menu</h5>
<ul class ="Actions">
<li > <a href ="HinhThucTTAdd.aspx" >Thêm mới HT TT</a></li>
<li ><a href ="hinhthucttlist.aspx" >Danh sách HT TT</a></li>
</ul>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="contentPlaceHolder" Runat="Server">
<div style="padding:12px 12px 12px 12px;">
<div>
<div class="title">
Update hình thức thanh toán
</div>
<div>
<table width="100%" cellspacing="1" cellpadding="3" border="0" bgcolor="#cccccc">
<tr>
<td style="width:30%">Mã hình thức TT</td>
<td style="width:70%"><asp:TextBox Enabled="false" ID="txt_MaHT" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td style="width:30%">Tên hình thức TT</td>
<td style="width:70%"><asp:TextBox ID="txt_TenHT" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td style="width:30%"></td>
<td style="width:70%"><asp:Button ID="btn_Update" runat="server" Text="Update HT TT" OnClick="btn_Update_Click" /></td>
</tr>
</table>
</div>
</div>
</div>
</asp:Content>
| 02cdnth2 | trunk/Test/Admin/HinhThucTTEdit.aspx | ASP.NET | epl | 1,701 |
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class Admin_MasterPage : System.Web.UI.MasterPage
{
protected void Page_Load(object sender, EventArgs e)
{
if (Request.Url.ToString().Contains("Default.aspx") == false
&& Session["UserName"] == null)
Response.Redirect("~/Admin/Default.aspx");
}
} | 02cdnth2 | trunk/Test/Admin/MasterPage.master.cs | C# | epl | 587 |
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Entities;
using BUS;
using Utility;
public partial class Admin_Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
load_data();
}
}
private void load_data()
{
PagerV2_8_1.PageSize = 5;
int Total = 0;
Criteria cri = new Criteria();
if (txt_TenTT.Text != "")
{
cri.add(Condition.AND, tbTrangThaiSPColumns.TenTrangThai.ToString(), Condition.EQUAL, txt_TenTT.Text);
}
tbTrangThaiSPCollection ttspColection = tbTrangThaiSPBUS.Get(cri.Criter, PagerV2_8_1.CurrentIndex,
PagerV2_8_1.PageSize, tbTrangThaiSPColumns.IdTrangThaiSP.ToString(),
OrderDirection.ASC.ToString(), out Total);
Repeater1.DataSource = ttspColection;
Repeater1.DataBind();
PagerV2_8_1.ItemCount = Total;
if (Total <= PagerV2_8_1.PageSize)
{
PagerV2_8_1.Visible = false;
}
}
protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
HyperLink hyp_TenTT = (HyperLink)e.Item.FindControl("hyp_TenTT");
Literal lit_MaTT = (Literal)e.Item.FindControl("lit_MaTT");
HyperLink hyp_Edit = (HyperLink)e.Item.FindControl("hyp_Edit");
HiddenField hf_id = (HiddenField)e.Item.FindControl("hf_id");
tbTrangThaiSP ttsp = (tbTrangThaiSP)e.Item.DataItem;
lit_MaTT.Text = ttsp.IdTrangThaiSP .ToString();
hyp_TenTT.NavigateUrl = "LoaiSPDetail.aspx?id=" + ttsp.IdTrangThaiSP.ToString();
hyp_Edit.NavigateUrl = "TrangThaiSPEdit.aspx?id=" + ttsp.IdTrangThaiSP.ToString();
hf_id.Value = ttsp.IdTrangThaiSP.ToString();
hyp_TenTT.Text = ttsp.TenTrangThai;
}
}
protected void btn_Search_Click(object sender, EventArgs e)
{
load_data();
}
protected void lbt_Delete_Click(object sender, EventArgs e)
{
foreach (RepeaterItem item in this.Repeater1.Items)
{
CheckBox chk = (CheckBox)item.FindControl("cb_xoa");
if (chk.Checked == true)
{
HiddenField hf_id = (HiddenField)item.FindControl("hf_id");
tbTrangThaiSPBUS.Delete_TTSP(int.Parse(hf_id.Value));
}
}
load_data();
}
protected void pager_Command(object sender, CommandEventArgs e)
{
PagerV2_8_1 .CurrentIndex = int.Parse (e.CommandArgument.ToString ());
load_data();
}
}
| 02cdnth2 | trunk/Test/Admin/TrangThaiSPList.aspx.cs | C# | epl | 3,096 |
<%@ Page Language="C#" MasterPageFile ="~/Admin/MasterPage.master" AutoEventWireup="true" CodeFile="DoanhNghiepEdit.aspx.cs" Inherits="Admin_DoanhNghiepEdit" %>
<%@ Register Assembly="ASPnetPagerV2_8" Namespace="ASPnetControls" TagPrefix="cc1" %>
<asp:Content ID ="Content1" ContentPlaceHolderID ="menuPlaceHolder" runat ="server" >
<h5 >Menu</h5>
<ul class ="Actions">
<li> <a href ="DoanhNghiepAdd.aspx" >Thêm mới Doanh nghiệp</a></li>
<li class ="Selected"><a href ="DoanhNghiepList.aspx" >Danh sách Doanh nghiệp</a></li>
</ul>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="contentPlaceHolder" Runat="Server">
<div style="padding:12px 12px 12px 12px;">
<div>
<div class="title">
Update Trạng Thái SP
</div>
<div>
<table width="100%" cellspacing="1" cellpadding="3" border="0" bgcolor="#cccccc">
<tr>
<td style="width:30%">Mã Doanh nghiệp</td>
<td style="width:70%"><asp:TextBox Enabled="false" ID="txt_MaDN" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td style="width:30%">Tên Doanh nghiệp</td>
<td style="width:70%"><asp:TextBox ID="txt_TenDN" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td style="width:30%">Địa chỉ</td>
<td style="width:70%"><asp:TextBox ID="txt_diachi" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td style="width:30%">Điện thoại</td>
<td style="width:70%"><asp:TextBox ID="txt_dienthoai" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td style="width:30%"></td>
<td style="width:70%"><asp:Button ID="btn_Update" runat="server" Text="Update Doanh Nghiệp" OnClick="btn_Update_Click" /></td>
</tr>
</table>
</div>
</div>
</div>
</asp:Content>
| 02cdnth2 | trunk/Test/Admin/DoanhNghiepEdit.aspx | ASP.NET | epl | 2,171 |
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Entities;
using BUS;
using Utility;
public partial class Admin_NhanVienList : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
load_data();
}
}
private void load_data()
{
PagerV2_8_1.PageSize = 5;
int Total = 0;
Criteria cri = new Criteria();
if (txt_TenNV.Text != "")
{
cri.add(Condition.AND, tbNhanVienColumns.TenNhanVien.ToString(), Condition.EQUAL, txt_TenNV.Text);
}
tbNhanVienCollection NVColection = tbNhanVienBUS.Get(cri.Criter, PagerV2_8_1.CurrentIndex,
PagerV2_8_1.PageSize, tbNhanVienColumns.IdNhanVien.ToString(),
OrderDirection.ASC.ToString(), out Total);
Repeater1.DataSource = NVColection;
Repeater1.DataBind();
PagerV2_8_1.ItemCount = Total;
if (Total <= PagerV2_8_1.PageSize)
{
PagerV2_8_1.Visible = false;
}
}
protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
HyperLink hyp_TenNV = (HyperLink)e.Item.FindControl("hyp_TenNV");
Literal lit_MaNV = (Literal)e.Item.FindControl("lit_MaNV");
HyperLink hyp_Edit = (HyperLink)e.Item.FindControl("hyp_Edit");
HiddenField hf_id = (HiddenField)e.Item.FindControl("hf_id");
tbNhanVien nhanvien = (tbNhanVien)e.Item.DataItem;
lit_MaNV.Text = nhanvien.IdNhanVien .ToString();
hyp_TenNV.NavigateUrl = "NhanVienDetail.aspx?id=" + nhanvien.IdNhanVien.ToString();
hyp_Edit.NavigateUrl = "NhanVienEdit.aspx?id=" + nhanvien.IdNhanVien.ToString();
hf_id.Value = nhanvien.IdNhanVien.ToString();
hyp_TenNV.Text = nhanvien.TenNhanVien;
}
}
protected void btn_Search_Click(object sender, EventArgs e)
{
load_data();
}
protected void lbt_Delete_Click(object sender, EventArgs e)
{
foreach (RepeaterItem item in this.Repeater1.Items)
{
CheckBox chk = (CheckBox)item.FindControl("cb_xoa");
if (chk.Checked == true)
{
HiddenField hf_id = (HiddenField)item.FindControl("hf_id");
tbNhanVienBUS.Delete_NhanVien (int.Parse(hf_id.Value));
}
}
load_data();
}
protected void pager_Command(object sender, CommandEventArgs e)
{
PagerV2_8_1.CurrentIndex = int.Parse(e.CommandArgument.ToString());
load_data();
}
}
| 02cdnth2 | trunk/Test/Admin/NhanVienList.aspx.cs | C# | epl | 3,070 |
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Entities;
using BUS;
using Utility;
public partial class Admin_TrangThaiSPEdit : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
load_data();
}
}
private void load_data()
{
try
{
int id = int.Parse(Request.QueryString["id"].ToString());
tbTrangThaiSP ttsp = tbTrangThaiSPBUS .GetById (id);
if (ttsp != null)
{
txt_MaTT.Text = ttsp.IdTrangThaiSP.ToString();
txt_TenTT.Text = ttsp.TenTrangThai.ToString();
}
}
catch
{
Response.Redirect("~/Admin/TrangThaiSPList.aspx");
}
}
protected void btn_Update_Click(object sender, EventArgs e)
{
try
{
tbTrangThaiSP ttsp = tbTrangThaiSPBUS .GetById (int.Parse (txt_MaTT .Text ));
ttsp .TenTrangThai = txt_TenTT.Text;
tbTrangThaiSPBUS.Update_TTSP(ttsp);
Response.Redirect("~/Admin/TrangThaiSPList.aspx");
}
catch
{
Response.Redirect("~/Admin/TrangThaiSPList.aspx");
}
}
}
| 02cdnth2 | trunk/Test/Admin/TrangThaiSPEdit.aspx.cs | C# | epl | 1,511 |
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="LoaiSPDetail.aspx.cs" Inherits="Admin_LoaiSPDetail" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
</form>
</body>
</html>
| 02cdnth2 | trunk/Test/Admin/LoaiSPDetail.aspx | ASP.NET | epl | 457 |
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Entities;
using BUS;
using Utility;
public partial class Admin_TrangThaiDHList : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if(!IsPostBack )
{
load_data();
}
}
protected void lbt_Delete_Click(object sender, EventArgs e)
{
foreach (RepeaterItem item in this.Repeater1.Items)
{
CheckBox chk = (CheckBox)item.FindControl("cb_xoa");
if (chk.Checked == true)
{
HiddenField hf_id = (HiddenField)item.FindControl("hf_id");
tbDiaDiemBUS.Detele(int.Parse(hf_id.Value));
}
}
load_data();
}
private void load_data()
{
PagerV2_8_1.PageSize = 5;
Criteria cri = new Criteria();
int Total = 0;
//PagerV2_8_1 .PageSize =int.Parse (ConfigurationManager.AppSettings ["pagesize"].ToString ());
tbTrangThaiDHCollection ttdhcolection = tbTrangThaiDHBUS.Get(cri.Criter, PagerV2_8_1.CurrentIndex,
PagerV2_8_1.PageSize, tbTrangThaiDHColumns .IdTrangThaiDH .ToString (),
OrderDirection.ASC.ToString(), out Total);
Repeater1.DataSource = ttdhcolection;
Repeater1.DataBind();
PagerV2_8_1.ItemCount = Total;
if (Total <= PagerV2_8_1.PageSize)
PagerV2_8_1.Visible = false;
}
protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
Literal lit_TenTT = (Literal)e.Item.FindControl("lit_TenTT");
Literal lit_MaTT = (Literal)e.Item.FindControl("lit_MaTT");
tbTrangThaiDH ttdonhang = (tbTrangThaiDH)e.Item.DataItem;
lit_MaTT.Text = ttdonhang.IdTrangThaiDH .ToString();
lit_TenTT.Text = ttdonhang .TrangThai_DH .ToString ();
}
}
protected void btn_Search_Click(object sender, EventArgs e)
{
load_data();
}
protected void pager_Command(object sender, CommandEventArgs e)
{
PagerV2_8_1.CurrentIndex = int.Parse(e.CommandArgument.ToString());
load_data();
}
}
| 02cdnth2 | trunk/Test/Admin/TrangThaiDHList.aspx.cs | C# | epl | 2,688 |
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Entities;
using Utility;
using BUS;
public partial class DiaDiemList : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
load_data();
}
}
protected void lbt_Delete_Click(object sender, EventArgs e)
{
foreach (RepeaterItem item in this.Repeater1.Items)
{
CheckBox chk = (CheckBox)item.FindControl("cb_xoa");
if (chk.Checked == true)
{
HiddenField hf_id = (HiddenField)item.FindControl("hf_id");
tbDiaDiemBUS.Detele(int.Parse(hf_id.Value));
}
}
load_data();
}
private void load_data()
{
PagerV2_8_1.PageSize = 5;
Criteria cri = new Criteria();
int Total = 0;
if (txt_TenDD.Text != "")
{
cri.add(Condition.AND, tbDiaDiemColumns .TenDiaDiem .ToString(), Condition.LIKE, txt_TenDD.Text);
}
//PagerV2_8_1 .PageSize =int.Parse (ConfigurationManager.AppSettings ["pagesize"].ToString ());
tbDiaDiemCollection ddcolection = tbDiaDiemBUS.Get (cri.Criter, PagerV2_8_1.CurrentIndex,
PagerV2_8_1.PageSize, tbDiaDiemColumns .IdDiaDiem .ToString(),
OrderDirection.ASC.ToString(), out Total);
Repeater1.DataSource = ddcolection;
Repeater1.DataBind();
PagerV2_8_1.ItemCount = Total;
if (Total <= PagerV2_8_1.PageSize)
PagerV2_8_1.Visible = false;
}
protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
Literal lit_TenDD = (Literal)e.Item.FindControl("lit_TenDD");
Literal lit_MaDD = (Literal)e.Item.FindControl("lit_MaDD");
HyperLink hyp_Edit = (HyperLink)e.Item.FindControl("hyp_Edit");
HiddenField hf_id = (HiddenField)e.Item.FindControl("hf_id");
tbDiaDiem diadiem = (tbDiaDiem)e.Item.DataItem;
lit_MaDD.Text = diadiem .IdDiaDiem .ToString();
hyp_Edit.NavigateUrl = "DiaDiemEdit.aspx?id=" + diadiem.IdDiaDiem.ToString();
hf_id.Value = diadiem.IdDiaDiem.ToString();
lit_TenDD .Text = diadiem .TenDiaDiem .ToString ();
}
}
protected void btn_Search_Click(object sender, EventArgs e)
{
load_data();
}
protected void pager_Command(object sender, CommandEventArgs e)
{
PagerV2_8_1.CurrentIndex = int.Parse(e.CommandArgument.ToString());
load_data();
}
}
| 02cdnth2 | trunk/Test/Admin/DiaDiemList.aspx.cs | C# | epl | 3,075 |
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Entities;
using BUS;
public partial class Admin_HinhThucTTEdit : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if(!IsPostBack )
{
load_data ();
}
}
private void load_data()
{
try
{
int iD = int.Parse(Request.QueryString["id"].ToString());
tbHinhThucTT hinhthuctt = tbHinhThucTTBUS .GetById (iD);
if (hinhthuctt != null)
{
txt_MaHT .Text =hinhthuctt .IdHinhThuc .ToString ();
txt_TenHT .Text =hinhthuctt .TenHinhThuc .ToString ();
}
}
catch
{
Response.Redirect("~/Admin/HinhThucTTList.aspx");
}
}
protected void btn_Update_Click(object sender, EventArgs e)
{
try
{
tbHinhThucTT hinhthuctt = tbHinhThucTTBUS.GetById(int.Parse(txt_MaHT.Text));
hinhthuctt.TenHinhThuc = txt_TenHT.Text;
tbHinhThucTTBUS .Update (hinhthuctt);
Response.Redirect("~/Admin/HinhThucTTList.aspx");
}
catch
{
Response.Redirect("~/Admin/HinhThucTTList.aspx");
}
}
}
| 02cdnth2 | trunk/Test/Admin/HinhThucTTEdit.aspx.cs | C# | epl | 1,522 |
form {
margin: 1em;
padding: 0em;
width: 780px;
}
textarea {
font-size: 1em;
}
div.Row {
margin-top: 8px;
text-align: left;
}
div.ButtonRow {
margin-top: 10px;
margin-left: 1em;
}
input.Button {
font-family: Tahoma,"Trebuchet MS",Arial,Sans-serif;
margin-right: 0.5em;
}
input.Button.Level1 {
width: 6em;
}
.Error,
span.Required {
color: red;
}
.TextBoxSearch {
width: 400px;
}
.DropDownList {
width: 120px;
}
div.Row div,
div.RangeDate div {
display: inline;
margin-right: 2em;
}
* html div.RangeDate div img {
margin-top: 3px;
}
.TopMenu li {
list-style: none;
display: inline;
margin-right: 1em;
}
.TopMenu li.FirstItem {
margin-left: 72%;
}
.addnewrow
{
text-align:right;
font-size: 11px;
font-family: Verdana, Arial, Helvetica, sans-serif;
background-color: #ffffff;
padding-bottom:5px;
padding-top:5px;
padding-right:12px;
}
div.Row {
margin-top: 8px;
text-align: left;
}
.Error,
span.Required {
color: red;
}
form {
margin: 1em;
padding: 0em;
width: 100%;
margin:0em;
}
.listtableheader {
FONT-WEIGHT: bold;
FONT-FAMILY: Arial, Helvetica, sans-serif;
BACKGROUND-COLOR: #eeeeee;
text-align:left;
}
.PagerCurrentPageCell{
-moz-border-radius:3px 3px 3px 3px;
height:2.0833em;
overflow:visible;
padding:0 0.5em;
vertical-align:middle;
white-space:nowrap;
background:none repeat scroll 0 0 #DDDDDD;
border-color:#CCCCCC;
color:#000000;
cursor:default;
font-weight:bold;
}
.button,
.PagerOtherPageCells{
-moz-border-radius:3px 3px 3px 3px;
background:-moz-linear-gradient(center top , #FFFFFF, #EFEFEF) repeat scroll 0 0 #F6F6F6;
border:1px solid #CCCCCC;
color:#000000;
cursor:pointer;
height:2.0833em;
overflow:visible;
padding:0 0.5em;
vertical-align:middle;
white-space:nowrap;
}
.PagerHyperlinkStyle
{
text-decoration:none;
color:#0033CC;
}
td {
FONT-SIZE: 11px;
FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif;
BACKGROUND-COLOR: #ffffff;
}
.hidden
{
display:none;
}
.readonly{
height: 18px;
border: 0px;
color: #555;
text-indent:3px;
}
.button:hover,
.PagerOtherPageCells:active,
.PagerOtherPageCells:hover
{
border-color:#999;
background:#ddd;
background-image:-moz-linear-gradient(top,#cccccc,#ffffff);
background-image:-webkit-gradient(linear,left top,left bottom,from(#cccccc),to(#ffffff));
filter:progid:DXImageTransform.Microsoft.Gradient(startColorStr=#cccccc,endColorStr=#ffffff)
}
.title
{
height:30px;
font-size:20px;
} | 02cdnth2 | trunk/Test/Admin/css/form.css | CSS | epl | 2,676 |
body {
margin: 0px;
padding: 0px;
font-family: Arial, Helvertical, Verdana, sans-serif;
font-size: 70%;
background: url(../images/nav-bg-repeat.jpg) repeat-y;
}
table {
font-size: 1em;
}
div.Clearance {
clear: both;
}
ul.MainMenu {
list-style: none inside none;
margin: 0px;
padding: 0px;
}
ul.MainMenu li {
display: inline;
padding: 0px 0em 0px 1em;
}
ul.MainMenu li.First {
list-style-type: none;
}
#header {
background-color: #4E7DD1;
height: 36px;
color: white;
}
#header h1 {
font-size: 20px;
font-weight: normal;
margin: 6px;
float: left;
}
#header a {
color: white;
font-weight: bold;
text-decoration: none;
}
#header a:hover {
text-decoration: underline;
}
#header ul.MainMenu {
float: right;
padding-top: 5px;
padding-right: 1em;
}
#navigator {
background-image: url(../images/topgrad.gif);
border-top: solid 1px #7795CB;
padding: 3px 2px 2px 2px;
}
#navigator a {
color: white;
font-weight: bold;
text-decoration: none;
}
#navigator a:hover {
text-decoration: underline;
}
#navigator div {
height: 1.5em;
}
#navigator ul.MainMenu li {
padding: 0px;
margin: 0px;
}
#navigator ul.MainMenu li a {
padding: 0px .7em 2px .7em;
}
#navigator ul.MainMenu li.Current a {
background-image: url(../images/nav-item-bg.jpg);
background-repeat: repeat;
color: #131FA5;
border: solid 1px;
border-top-color: #00238B;
border-right-color: #578CEB;
border-bottom-color: #578CEB
}
#title {
border-top: solid 3px #4E7DD1;
border-bottom: solid 1px #D8E0EB;
background-color: white;
}
#title div.Inner {
height: 6px;
}
#title #titleLogo {
width: 180px;
float: left;
background-image: url(../images/headcornerp.gif);
background-repeat: no-repeat;
}
#title #titleLogo h2 {
margin: 0px;
width: 180px;
height: 49px;
background-image: url(../images/spssites.gif);
background-repeat: no-repeat;
background-position: center 0px;
}
#title #titleText {
float: left;
padding-top: 10px;
font-family: Verdana;
}
#title #titleText h3.Repeat {
margin: 0px;
font-weight: normal;
font-size: 1.4em;
color: black;
}
#title #titleText h3 {
margin: 0px;
color: #131FA5;
font-size: 1.2em;
}
#title #titleForm {
float: right;
padding: 0px 0px 0px 6px;
background-color: #4E7DD1;
background-image: url(../images/headcornerx.jpg);
background-repeat: no-repeat;
background-position: 0% 0%;
}
#title #searchForm {
margin: 0px;
padding: .2em .4em .4em .5em;
background-image: url(../images/headcornerz.jpg);
background-repeat: no-repeat;
background-position: 0% 100%;
}
#title #searchForm * {
vertical-align: middle;
}
#sideBar {
position: absolute;
width: 180px;
left: 0px;
font-family: Verdana;
}
#sideBar div {
padding: 1ex;
}
#sideBar h5 {
font-weight: bold;
margin: 0px;
font-size: 1.1em;
}
#sideBar ul a {
color: #003399;
text-decoration: none;
font-size: 11px;
}
#sideBar ul a:hover {
text-decoration: underline;
}
#sideBar ul {
margin: 0.5ex 1ex 1ex 0ex;
border-top: dotted 1px #ADADAD;
}
#sideBar ul.Actions {
list-style-type: none;
padding-left: 0em;
}
#sideBar ul li {
background-image: url(../images/rtbullet.gif);
background-repeat: no-repeat;
background-position: 5px 0.2ex;
padding: 0.5ex 0.5ex 0.5ex 3ex;
}
#sideBar ul li.Selected {
background-image: url(../images/triangle.gif);
background-position: 3px center;
background-color: #F0FFF0;/*white;*/
border: 1px solid #228B22; /*rgb(0, 0, 153);*/
}
#content {
font-size: 1.1em;
margin-left: 180px;
}
#messageContainer {
margin-left: 180px;
display: none;
padding: 3px;
text-align: center;
}
#message {
text-align: center;
padding-left: 2em;
padding-right: 2em;
font-weight: bold;
background-color: rgb(250, 209, 99);
}
td.TL {
background: url(../images/corner_tl.gif) top left;
}
td.TR {
background: url(../images/corner_tr.gif) top right;
}
td.BL {
background: url(../images/corner_bl.gif) bottom left;
}
td.BR {
background: url(../images/corner_br.gif) bottom right;
}
td.TL, td.TR, td.BL, td.BR {
background-repeat: no-repeat;
}
div#footer {
margin-top: 2em;
padding: 0.5em;
clear: both;
color: rgb(200, 200, 200);
background-color: white;
border-top: solid 1px rgb(200, 200, 200);
} | 02cdnth2 | trunk/Test/Admin/css/default.css | CSS | epl | 4,538 |
<%@ Page Language="C#" MasterPageFile ="~/Admin/MasterPage.master" AutoEventWireup="true" CodeFile="DiaDiemEdit.aspx.cs" Inherits="Admin_DiaDiemEdit" %>
<%@ Register Assembly="ASPnetPagerV2_8" Namespace="ASPnetControls" TagPrefix="cc1" %>
<asp:Content ID ="Content1" ContentPlaceHolderID ="menuPlaceHolder" runat ="server" >
<h5 >Menu</h5>
<ul class ="Actions">
<li > <a href ="DiaDiemAdd.aspx" >Thêm mới Địa điểm</a></li>
<li ><a href ="DiaDiemList.aspx" >Danh sách Địa điểm</a></li>
</ul>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="contentPlaceHolder" Runat="Server">
<div style="padding:12px 12px 12px 12px;">
<div>
<div class="title">
Update Địa điểm
</div>
<div>
<table width="100%" cellspacing="1" cellpadding="3" border="0" bgcolor="#cccccc">
<tr>
<td style="width:30%">Mã Địa điểm</td>
<td style="width:70%"><asp:TextBox Enabled="false" ID="txt_MaDD" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td style="width:30%">Tên Địa điểm</td>
<td style="width:70%"><asp:TextBox ID="txt_TenDD" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td style="width:30%"></td>
<td style="width:70%"><asp:Button ID="btn_Update" runat="server" Text="Update Địa điểm" OnClick="btn_Update_Click" /></td>
</tr>
</table>
</div>
</div>
</div>
</asp:Content>
| 02cdnth2 | trunk/Test/Admin/DiaDiemEdit.aspx | ASP.NET | epl | 1,702 |
<%@ Page Language="C#" MasterPageFile ="~/Admin/MasterPage.master" AutoEventWireup="true" CodeFile="KhachHangAdd.aspx.cs" Inherits="Admin_KhachHangAdd" %>
<%@ Register Assembly="ASPnetPagerV2_8" Namespace="ASPnetControls" TagPrefix="cc1" %>
<asp:Content ID ="Content1" ContentPlaceHolderID ="menuPlaceHolder" runat ="server" >
<h5 >Menu</h5>
<ul class ="Actions">
<li > <a href ="sanphamAdd.aspx" >Thêm mới sản phẩm</a></li>
<li > <a href ="sanphamList.aspx" >Danh sách Sản phẩm</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="DiaDiemAdd.aspx" >Thêm mới Địa điểm</a></li>
<li > <a href ="DiaDiemList.aspx" >Danh sách Đại điểm</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="DoanhNghiepAdd.aspx" >Thêm mới Doanh nghiệp</a></li>
<li > <a href ="DoanhNghiepList.aspx" >Danh sách Doanh nghiệp</a></li>
</ul>
<ul class ="Actions">
<li class ="Selected"> <a href ="KhachHangAdd.aspx" >Thêm mới Khách hàng</a></li>
<li > <a href ="KhachHangList.aspx" >Danh sách Khach hàng</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="NhanVienAdd.aspx" >Thêm mới Nhân viên</a></li>
<li > <a href ="NhanVienList.aspx" >Danh sách Nhân viên</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="HinhThucTTAdd.aspx" >Thêm mới Hình thức thanh toán</a></li>
<li > <a href ="HinhThucTTList.aspx" >Danh sách Hình thức thanh toán</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="LoaiSPAdd.aspx" >Thêm mới Loại sản phẩm</a></li>
<li > <a href ="LoaiSPList.aspx" >Danh sách Loại sản phẩm</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="MaSoSPList.aspx" >Danh sách Mã số sản phẩm</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="TrangThaiSPAdd.aspx" >Thêm mới Trạng thái sản phẩm</a></li>
<li > <a href ="TrangThaiSPList.aspx" >Danh sách Trạng thái sản phẩm</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="TrangThaiDHList.aspx" >Danh sách Trạng thái đơn hàng</a></li>
<li ><a href ="TTGiaoDichList.aspx" >Danh sách Thông tin giao dịch</a></li>
</ul></asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="contentPlaceHolder" Runat="Server">
<div style="padding:12px 12px 12px 12px;">
<div>
<div class="title">
Thêm mới Khách hàng
</div>
<div>
<table width="100%" cellspacing="1" cellpadding="3" border="0" bgcolor="#cccccc">
<tr>
<td style="width:30%">Tên Khách hàng</td>
<td style="width:70%"><asp:TextBox ID="txt_TenKH" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td style="width:30%">Email</td>
<td style="width:70%"><asp:TextBox ID="txt_Email" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td style="width:30%">Mật khẩu</td>
<td style="width:70%"><asp:TextBox ID="txt_MatKhau" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td style="width:30%">Địa chỉ</td>
<td style="width:70%"><asp:TextBox ID="txt_DiaChi" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td style="width:30%">Điện thoại</td>
<td style="width:70%"><asp:TextBox ID="txt_DienThoai" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td style="width:30%"></td>
<td style="width:70%"><asp:Button ID="btn_Add" runat="server" Text="Thêm mới" OnClick="btn_Add_Click" /></td>
</tr>
</table>
</div>
</div>
</div>
</asp:Content> | 02cdnth2 | trunk/Test/Admin/KhachHangAdd.aspx | ASP.NET | epl | 4,130 |
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Utility;
using Entities;
using BUS;
public partial class Admin_MaSoSPList : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
LoadData();
}
}
private void LoadData()
{
int total = 0;
Criteria cri = new Criteria();
if (txt_Id.Text != "")
{
cri.add(Condition.AND, tbMaSoSPColumns.IdMaSoSP.ToString(), Condition.EQUAL, int.Parse(txt_Id.Text));
}
if (txt_MaSo.Text != "")
{
cri.add(Condition.AND, tbMaSoSPColumns.MaSo.ToString(), Condition.EQUAL, int.Parse(txt_MaSo.Text));
}
Repeater1.DataSource = tbMaSoSPBUS.Get(cri.Criter, PagerV2_8_1.CurrentIndex,
PagerV2_8_1.PageSize, tbMaSoSPColumns.IdMaSoSP.ToString(),
OrderDirection.DESC.ToString(), out total);
Repeater1.DataBind();
PagerV2_8_1.ItemCount = total;
if (PagerV2_8_1.ItemCount <= PagerV2_8_1.PageSize)
PagerV2_8_1.Visible = false;
else
PagerV2_8_1.Visible = true;
}
protected void pager_Command(object sender, CommandEventArgs e)
{
PagerV2_8_1.CurrentIndex = int.Parse(e.CommandArgument.ToString());
LoadData();
}
protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.AlternatingItem ||
e.Item.ItemType == ListItemType.Item)
{
tbMaSoSP masoSP = (tbMaSoSP)e.Item.DataItem;
Literal lit_MaSoSP = (Literal)e.Item.FindControl("lit_MaSoSP");
lit_MaSoSP.Text = masoSP.IdMaSoSP.ToString();
CheckBox cb_DaGiao = (CheckBox)e.Item.FindControl("cb_DaGiao");
cb_DaGiao.Checked = masoSP .TrangThai ;
if (cb_DaGiao.Checked == true)
{
cb_DaGiao.Enabled = false;
}
HiddenField hf_ID = (HiddenField)e.Item.FindControl("hf_ID");
hf_ID.Value = masoSP .IdMaSoSP .ToString();
}
}
protected void btn_Update_Click(object sender, EventArgs e)
{
for (int i = 0; i < Repeater1.Items.Count; i++)
{
CheckBox cb_DaGiao = (CheckBox)Repeater1.Items[i].FindControl("cb_DaGiao");
if (cb_DaGiao.Enabled == true && cb_DaGiao.Checked == true)
{
HiddenField hf_ID = (HiddenField)Repeater1.Items[i].FindControl("hf_ID");
tbMaSoSP masoSP = tbMaSoSPBUS .GetByID (int.Parse(hf_ID.Value));
masoSP .TrangThai = true;
tbMaSoSPBUS .Update (masoSP);
}
}
Response.Redirect(Request.RawUrl);
}
protected void btn_Search_Click(object sender, EventArgs e)
{
LoadData();
}
}
| 02cdnth2 | trunk/Test/Admin/MaSoSPList.aspx.cs | C# | epl | 3,236 |
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Entities;
using BUS;
using Utility;
public partial class Admin_CTDonHangList : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
LoadData();
}
}
private void LoadData()
{
try
{
int id = int.Parse(Request.QueryString["id"].ToString());
tbDonHang donHang = tbDonHangBUS.GetByID(id);
lit_MaDonHang.Text = donHang.IdDH .ToString();
tbKhachHang khachHang = tbKhachHangBUS.GetByID(donHang.IdDH);
lit_KhachHang.Text = khachHang.HoTen;
lit_NgayDatHang.Text = donHang.NgayDatHang.ToString();
lit_NgayGiaoHang.Text = donHang.NgayGiaoHang.ToString();
lit_TriGia.Text = donHang.TriGia.ToString();
tbTrangThaiDH trangthaiDH = tbTrangThaiDHBUS.GetById(int.Parse(donHang.IdTrangThaiDH.ToString()));
cb_DaGiao.Checked = trangthaiDH .TrangThai_DH ;
lit_DiaChiNhanHang.Text = donHang.DiaChiNhanHang;
int total = 0;
Criteria cri = new Criteria();
cri.add(Condition.AND, tbCTDonHangColumns.IdDH, Condition.EQUAL, donHang.IdDH);
tbCTDonHangCollection cTDonHangCollection =
tbCTDonHangBUS.Get(cri.Criter, PagerV2_8_1.CurrentIndex, PagerV2_8_1.PageSize,
tbCTDonHangColumns.IdCTDonHang .ToString(), OrderDirection.ASC.ToString(), out total);
Repeater1.DataSource = cTDonHangCollection;
Repeater1.DataBind();
PagerV2_8_1.ItemCount = total;
if (PagerV2_8_1.ItemCount <= PagerV2_8_1.PageSize)
PagerV2_8_1.Visible = false;
else
PagerV2_8_1.Visible = true;
}
catch
{
Response.Redirect("~/Admin/DonHangList.aspx");
}
}
protected void pager_Command(object sender, CommandEventArgs e)
{
PagerV2_8_1.CurrentIndex = int.Parse(e.CommandArgument.ToString());
LoadData();
}
protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.AlternatingItem ||
e.Item.ItemType == ListItemType.Item)
{
tbCTDonHang cTDonHang = (tbCTDonHang)e.Item.DataItem;
tbSanPham sanPham = tbSanPhamBUS .GetId (cTDonHang.IdSanPham );
if (sanPham != null)
{
Literal lit_TenSP = (Literal)e.Item.FindControl("lit_TenSP");
lit_TenSP.Text = sanPham .TenSP ;
}
Literal lit_ThanhTien = (Literal)e.Item.FindControl("lit_ThanhTien");
int tongTien = cTDonHang.SoLuong * cTDonHang.DonGia;
lit_ThanhTien.Text = tongTien.ToString();
}
}
}
| 02cdnth2 | trunk/Test/Admin/CTDonHangList.aspx.cs | C# | epl | 3,178 |
<%@ Page Language="C#" MasterPageFile ="~/Admin/MasterPage.master" AutoEventWireup="true" CodeFile="LoaiSPEdit.aspx.cs" Inherits="Admin_LoaiSPEdit" %>
<%@ Register Assembly="ASPnetPagerV2_8" Namespace="ASPnetControls" TagPrefix="cc1" %>
<asp:Content ID ="Content1" ContentPlaceHolderID ="menuPlaceHolder" runat ="server" >
<h5 >Menu</h5>
<ul class ="Actions">
<li> <a href ="LoaiSPAdd.aspx" >Thêm mới Loại SP</a></li>
<li class ="Selected"><a href ="Default.aspx" >Danh sách Loại SP</a></li>
</ul>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="contentPlaceHolder" Runat="Server">
<div style="padding:12px 12px 12px 12px;">
<div>
<div class="title">
Update Loại SP
</div>
<div>
<table width="100%" cellspacing="1" cellpadding="3" border="0" bgcolor="#cccccc">
<tr>
<td style="width:30%">Mã Loại</td>
<td style="width:70%"><asp:TextBox Enabled="false" ID="txt_MaLoai" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td style="width:30%">Tên Loại</td>
<td style="width:70%"><asp:TextBox ID="txt_TenLoai" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td style="width:30%"></td>
<td style="width:70%"><asp:Button ID="btn_Update" runat="server" Text="Update Loại SP" OnClick="btn_Update_Click" /></td>
</tr>
</table>
</div>
</div>
</div>
</asp:Content>
| 02cdnth2 | trunk/Test/Admin/LoaiSPEdit.aspx | ASP.NET | epl | 1,674 |
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Utility;
using Entities;
using BUS;
public partial class Admin_TrangThaiSPAdd : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btn_Add_Click(object sender, EventArgs e)
{
tbTrangThaiSP ttsp = new tbTrangThaiSP();
ttsp.TenTrangThai = txt_TenTT.Text;
tbTrangThaiSPBUS.Insert_TTSP(ttsp);
Response.Redirect("~/Admin/TrangThaiSPList.aspx");
}
}
| 02cdnth2 | trunk/Test/Admin/TrangThaiSPAdd.aspx.cs | C# | epl | 738 |
<%@ Page Language="C#" MasterPageFile ="~/Admin/MasterPage.master" AutoEventWireup="true" CodeFile="DiaDiemAdd.aspx.cs" Inherits="Admin_DiaDiemAdd" %>
<%@ Register Assembly="ASPnetPagerV2_8" Namespace="ASPnetControls" TagPrefix="cc1" %>
<asp:Content ID ="Content1" ContentPlaceHolderID ="menuPlaceHolder" runat ="server" >
<h5 >Menu</h5>
<ul class ="Actions">
<li > <a href ="sanphamAdd.aspx" >Thêm mới sản phẩm</a></li>
<li > <a href ="sanphamList.aspx" >Danh sách Sản phẩm</a></li>
</ul>
<ul class ="Actions">
<li class ="Selected"> <a href ="DiaDiemAdd.aspx" >Thêm mới Địa điểm</a></li>
<li > <a href ="DiaDiemList.aspx" >Danh sách Đại điểm</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="DoanhNghiepAdd.aspx" >Thêm mới Doanh nghiệp</a></li>
<li > <a href ="DoanhNghiepList.aspx" >Danh sách Doanh nghiệp</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="KhachHangAdd.aspx" >Thêm mới Khách hàng</a></li>
<li > <a href ="KhachHangList.aspx" >Danh sách Khach hàng</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="NhanVienAdd.aspx" >Thêm mới Nhân viên</a></li>
<li > <a href ="NhanVienList.aspx" >Danh sách Nhân viên</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="HinhThucTTAdd.aspx" >Thêm mới Hình thức thanh toán</a></li>
<li > <a href ="HinhThucTTList.aspx" >Danh sách Hình thức thanh toán</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="LoaiSPAdd.aspx" >Thêm mới Loại sản phẩm</a></li>
<li > <a href ="LoaiSPList.aspx" >Danh sách Loại sản phẩm</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="MaSoSPList.aspx" >Danh sách Mã số sản phẩm</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="TrangThaiSPAdd.aspx" >Thêm mới Trạng thái sản phẩm</a></li>
<li > <a href ="TrangThaiSPList.aspx" >Danh sách Trạng thái sản phẩm</a></li>
</ul>
<ul class ="Actions">
<li > <a href ="TrangThaiDHList.aspx" >Danh sách Trạng thái đơn hàng</a></li>
<li ><a href ="TTGiaoDichList.aspx" >Danh sách Thông tin giao dịch</a></li>
</ul></asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="contentPlaceHolder" Runat="Server">
<div style="padding:12px 12px 12px 12px;">
<div>
<div class="title">
Thêm mới Địa điểm
</div>
<div>
<table width="100%" cellspacing="1" cellpadding="3" border="0" bgcolor="#cccccc">
<tr>
<td style="width:30%">Tên Địa điểm</td>
<td style="width:70%"><asp:TextBox ID="txt_TenDD" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td style="width:30%"></td>
<td style="width:70%"><asp:Button ID="btn_Add" runat="server" Text="Thêm mới" OnClick="btn_Add_Click" /></td>
</tr>
</table>
</div>
</div>
</div>
</asp:Content> | 02cdnth2 | trunk/Test/Admin/DiaDiemAdd.aspx | ASP.NET | epl | 3,291 |
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btnUpload_Click(object sender, EventArgs e)
{
try
{
// Get the HttpFileCollection
HttpFileCollection hfc = Request.Files;
for (int i = 0; i < hfc.Count; i++)
{
HttpPostedFile hpf = hfc[i];
if (hpf.ContentLength > 0)
{
hpf.SaveAs(Server.MapPath("MyFiles") + "\\" +
System.IO.Path.GetFileName(hpf.FileName));
Response.Write("<b>File: </b>" + hpf.FileName + " <b>Size:</b> " +
hpf.ContentLength + " <b>Type:</b> " + hpf.ContentType + " Uploaded Successfully <br/>");
}
}
}
catch
{
}
}
}
| 02cdnth2 | trunk/Test/Default.aspx.cs | C# | epl | 1,069 |
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Entities;
using BUS;
using Utility;
public partial class DealDuLich : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
LoadData();
}
}
private void LoadData()
{
tbLoaiSP loaiSP = tbLoaiSPBUS.GetId(6);
int Total = 0;
Criteria Cri = new Criteria();
Cri.add(Condition.AND, tbSanPhamColumns.IdLoaiSP, Condition.EQUAL, loaiSP.IdLoaiSP.ToString());
tbSanPhamCollection sanPhamCollection = tbSanPhamBUS.Get(Cri.Criter, PagerV2_8_1.CurrentIndex, PagerV2_8_1.PageSize,
tbSanPhamColumns.IdLoaiSP.ToString(),
OrderDirection.ASC.ToString(), out Total);
repeater1.DataSource= sanPhamCollection;
repeater1.DataBind();
PagerV2_8_1.ItemCount = Total;
if (PagerV2_8_1.ItemCount <= PagerV2_8_1.PageSize)
PagerV2_8_1.Visible = false;
else
PagerV2_8_1.Visible = true;
}
protected void repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
tbSanPham sanPham = (tbSanPham)e.Item.DataItem;
HyperLink hyp_tensp = (HyperLink)e.Item.FindControl("hyp_tensp");
Literal lit_old = (Literal)e.Item.FindControl("lit_old");
Literal lit_giaban = (Literal)e.Item.FindControl("lit_giaban");
Literal lit_tietkiem = (Literal)e.Item.FindControl("lit_tietkiem");
Literal lit_count = (Literal)e.Item.FindControl("lit_count");
Image img_HinhAnh = (Image)e.Item.FindControl("img_HinhAnh");
hyp_tensp.Text = sanPham.TenSP;
lit_old.Text = sanPham.GiaTriThuc.ToString();
lit_giaban.Text = sanPham.GiaBan.ToString();
lit_count.Text = sanPham.SLDaBan.ToString();
int tietkiem = sanPham.GiaTriThuc - sanPham.GiaBan;
lit_tietkiem.Text = tietkiem.ToString();
int Id = 0;
int MaHA = tbHinhAnhBUS.FirstImage(int.Parse(sanPham.IdSanPham.ToString()), Id);
if (MaHA > 0)
{
tbHinhAnh hinhAnh = tbHinhAnhBUS.GetById(MaHA);
img_HinhAnh.ImageUrl = "~/Photos/" + hinhAnh.TenHinh.ToString();
}
else
{
img_HinhAnh.ImageUrl = "~/Photos/no_images.jpg";
}
}
}
}
| 02cdnth2 | trunk/Test/DealDuLich.aspx.cs | C# | epl | 2,932 |
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Upload Multiple Files in ASP.NET Using jQuery</title>
<script src="Scripts/jquery-1.3.2.js" type="text/javascript"></script>
<script src="Scripts/jquery.MultiFile.js" type="text/javascript"></script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:FileUpload ID="FileUpload1" runat="server" class="multi" />
<br />
<asp:Button ID="btnUpload" runat="server" Text="Upload All"
onclick="btnUpload_Click" />
</div>
</form>
</body>
</html>
| 02cdnth2 | trunk/Test/Default.aspx | ASP.NET | epl | 844 |
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class MasterPage : System.Web.UI.MasterPage
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
| 02cdnth2 | trunk/Test/MasterPage.master.cs | C# | epl | 414 |
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Entities;
using BUS;
public partial class Detail : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
loadData();
}
}
private void loadData()
{
int id =int.Parse ( Request.QueryString["id"].ToString ());
tbSanPham sanPham = tbSanPhamBUS.GetId(id);
lit_tensp.Text = sanPham.MoTa ;
int Id = 0;
int MaHA = tbHinhAnhBUS.FirstImage(int.Parse(sanPham.IdSanPham.ToString()), Id);
if (MaHA > 0)
{
tbHinhAnh hinhAnh = tbHinhAnhBUS.GetById(MaHA);
img_hinh .ImageUrl = "~/Photos/" + hinhAnh.TenHinh.ToString();
}
else
{
img_hinh.ImageUrl = "~/Photos/no_images.jpg";
}
}
}
| 02cdnth2 | trunk/Test/Detail.aspx.cs | C# | epl | 1,098 |
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class MasterPage2 : System.Web.UI.MasterPage
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
| 02cdnth2 | trunk/Test/MasterPage2.master.cs | C# | epl | 415 |
<%@ Page Language="C#" MasterPageFile="~/MasterPage2.master" AutoEventWireup="true" CodeFile="test.aspx.cs" Inherits="test" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<form id ="form1" runat ="server" >
<div id="bdw" class="bdw" style="text-align: left" >
<div id="bd" class="cf" style="left: 0px; top: 0px; text-align: center;">
<div style="margin: 15px auto -10px; float:none ; margin: 8px auto 0; width :100%; margin-left :6" class ="deal_feature" >
<div class="sysmsg-tip-deal-close-moz1;" style ="width :100% " >
<div class="cat_choose_df" style="text-align: justify">
Chọn thể loại</div>
<div > </div>
<div class="cat_choose" style="z-index:1001; text-align: justify;">
<!--<a class="active" href="http://www.hotdeal.vn/ho-chi-minh/"><b>Tất cả</b> <span>(105)</span></a> |
<a class="" href="http://www.hotdeal.vn/ho-chi-minh/an-uong-557.html">Ăn uống <span>(12)</span></a> |
<a class="" href="http://www.hotdeal.vn/ho-chi-minh/suc-khoe---lam-dep-579.html">Sức khỏe & Làm đẹp <span>(9)</span></a> |
<a class="" href="http://www.hotdeal.vn/ho-chi-minh/hoat-dong---giai-tri-555.html">Hoạt động & Giải trí <span>(3)</span></a> |
<a class="" href="http://www.hotdeal.vn/ho-chi-minh/dao-tao-567.html">Đào tạo <span>(7)</span></a> |
<a class="" href="http://www.hotdeal.vn/ho-chi-minh/san-pham-571.html">Sản Phẩm <span>(63)</span></a> |
<a class="" href="http://www.hotdeal.vn/ho-chi-minh/du-lich-581.html">Du lịch <span>(11)</span></a> | -->
<asp:Repeater ID="Repeater2" runat="server" OnItemDataBound="Repeater2_ItemDataBound">
<ItemTemplate >
<asp:HyperLink ID ="hyp_loaisp" runat ="server" ></asp:HyperLink><span >(<asp:Literal ID ="lit_count" runat ="server"></asp:Literal>)</span> |
</ItemTemplate>
</asp:Repeater>
</div>
</div>
</div>
<asp:Repeater ID="Repeater1" runat="server" OnItemDataBound="Repeater1_ItemDataBound">
<ItemTemplate >
<div class="deal_list" style ="margin-right :18.5px">
<div class="deal_list_title">
<a title="Quyến Rũ, Gợi Cảm Cùng Các Loại Trang Phục Lót, Đồ Mặc Nhà Thương Hiệu Wannabe. Voucher 200.000 VNĐ, Còn 85.000 VNĐ, Giảm 58% Chỉ Có Tại Hotdeal.vn!">
<asp:HyperLink ID ="hyp_tensp" runat ="server" ></asp:HyperLink>
</a>
<div style="font-size:11px; font-style:italic;">
<asp:Image ID ="img_voucher" runat ="server" ImageUrl ="~/images/voucher-icon.png" />
</div>
</div>
<div class="deal_list_img">
<a href="http://www.hotdeal.vn/ho-chi-minh/trang-phuc-lot--nu-wannabe_3416.html">
<asp:Image ID ="img_hinhanh" runat ="server" Height ="183" Width ="268" />
</a>
</div>
<div class="deal_list_desc"><asp:Literal ID ="lit_mota" runat ="server" ></asp:Literal></div>
<div style="width:150px; float:left;">
<div class="deal_list_view_price">
<div class="number"><asp:Literal ID ="lit_giaban" runat ="server"></asp:Literal><span>VNĐ</span></div>
</div>
<div style="margin-top:0px; float:left; font-style:normal;">
<span style="font-size:13px;">Giá gốc: <em style="text-decoration:line-through;font-size:13px; color:#666; font-style:normal; "><asp:Literal ID="lit_giatrithuc" runat ="server" ></asp:Literal></em></span></div>
</div>
<div class="deal_list_view">
<div class="view_list_bt">
<asp:HyperLink ID="hyp_xem" runat="server"><asp:Image ID ="img_hinh" runat ="server" ImageUrl ="~/images/xem.JPG" /></asp:HyperLink>
<asp:HiddenField ID="hf_id" runat="server" />
</div>
</div>
<div class="list_view_price">
<div class="small-box-save">
<span>Tiết kiệm</span>
<span class="number"><asp:Literal ID ="lit_tietkiem" runat ="server" ></asp:Literal>%</span>
</div>
<div class="small-box-buyer">
<span>Số người đã mua</span>
<span class="number"><asp:Literal ID ="lit_songuoimua" runat ="server" ></asp:Literal></span>
</div>
<div class="small-box-timer">
<span>Thời gian còn lại</span>
<div class="deal-timeleft1" id="Div5" >
<div id="Div6">111:26:14</div>
</div>
</div>
</div>
</div>
</ItemTemplate>
</asp:Repeater>
<div style="clear:both"></div>
<div id="pagination">
</div>
</div>
<!-- bd end -->
<div id="listdeal" style="margin-top:-35px; width: 841px; text-align: center;">
</div>
</div>
</form>
</asp:Content>
| 02cdnth2 | trunk/Test/test.aspx | ASP.NET | epl | 6,672 |
<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/MasterPage.master" CodeFile="DealGanDay.aspx.cs" Inherits="DealGanDay" %>
<%@ Register Assembly="ASPnetPagerV2_8" Namespace="ASPnetControls" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:Repeater ID ="repeater1" runat ="server" OnItemDataBound="repeater1_ItemDataBound">
<ItemTemplate >
<div class="box" >
<div class="sect" >
<ul class="deals-list" >
<li style =" background-color :White">
<h4><asp:HyperLink ID ="hyp_tensp" runat ="server" ></asp:HyperLink> <span class="time" style="color:#999;"><asp:Literal ID ="lit_ngaythang" runat ="server" ></asp:Literal></span></h4>
<div class="pic">
<div class="isopen"></div>
<a href="http://www.hotdeal.vn/ho-chi-minh/princess-resort---spa-2n1d_3704.html" title="Nghỉ Dưỡng 2 N1Đ Dành Cho 02 NgườiTrong Không Gian Ngập Tràn Sắc Xanh Tại Princess Resort & Spa Tiêu Chuẩn Tương Đương 4* Tại Bình Dương. Voucher 1.700.000VNĐ, Còn 590.000VNĐ, Giảm 66%." target="_blank">
<asp:Image ID="img_HinhAnh" runat ="server" Height ="120" Width ="200" />
</a>
</div>
<div class="info">
<p class="total" align="center"><strong class="count"><asp:Literal ID ="lit_count" runat ="server" ></asp:Literal></strong><br>người đã mua<!--persons have bought--></p>
</div>
<div class="clear">
<table border="0" width="100%">
<tbody>
<tr>
<td class="price"><!--Original price:-->Giá gốc: <strong class="old"><asp:Literal ID ="lit_old" runat ="server" ></asp:Literal><span class="money">VNĐ</span></strong></td>
<td class="price">Giảm: <strong class="discount"><asp:Literal ID ="lit_discount" runat ="server" ></asp:Literal></strong></td>
</tr>
<tr>
<td class="price">Giá bán: <strong><asp:Literal ID ="lit_giaban" runat ="server" ></asp:Literal> <span class="money">VNĐ</span></strong></td>
<td class="price">Tiết kiệm: <strong><asp:Literal ID ="lit_tietkiem" runat ="server" ></asp:Literal> <span class="money">VNĐ</span></strong></td>
</tr>
</tbody>
</table>
</div>
</li>
</ul>
</div>
</div>
</ItemTemplate>
</asp:Repeater>
<div style="width:100%; ">
<div style="float:right ;">
<cc1:PagerV2_8 ID="PagerV2_8_1" runat="server" />
</div>
</div>
</asp:Content>
| 02cdnth2 | trunk/Test/DealGanDay.aspx | ASP.NET | epl | 3,249 |
using System;
using System.Collections.Generic;
using System.Text;
namespace Entities
{
public class tbTTGiaoDich
{
private int idTTGiaoDich;
public int IdTTGiaoDich
{
get { return idTTGiaoDich; }
set { idTTGiaoDich = value; }
}
private int idDH;
public int IdDH
{
get { return idDH; }
set { idDH = value; }
}
private int idHinhThuc;
public int IdHinhThuc
{
get { return idHinhThuc; }
set { idHinhThuc = value; }
}
private int soTien;
public int SoTien
{
get { return soTien; }
set { soTien = value; }
}
}
public enum tbTTGiaoDichColumns
{
IdTTGiaoDich,
IdDH,
IdHinhThuc,
SoTien
}
public class tbTTGiaoDichCollection : List<tbTTGiaoDich> { }
}
| 02cdnth2 | trunk/Entities/tbTTGiaoDich.cs | C# | epl | 994 |
using System;
using System.Collections.Generic;
using System.Text;
namespace Entities
{
public class tbSanPham
{
private int idSanPham;
public int IdSanPham
{
get { return idSanPham; }
set { idSanPham = value; }
}
private int idLoaiSP;
public int IdLoaiSP
{
get { return idLoaiSP; }
set { idLoaiSP = value; }
}
private int idDiaDiem;
public int IdDiaDiem
{
get { return idDiaDiem; }
set { idDiaDiem = value; }
}
private int idTrangThaiSP;
public int IdTrangThaiSP
{
get { return idTrangThaiSP; }
set { idTrangThaiSP = value; }
}
private int idNhanVien;
public int IdNhanVien
{
get { return idNhanVien; }
set { idNhanVien = value; }
}
private int idDoanhNghiep;
public int IdDoanhNghiep
{
get { return idDoanhNghiep; }
set { idDoanhNghiep = value; }
}
private String tenSP;
public String TenSP
{
get { return tenSP; }
set { tenSP = value; }
}
private int giaBan;
public int GiaBan
{
get { return giaBan; }
set { giaBan = value; }
}
private int giaTriThuc;
public int GiaTriThuc
{
get { return giaTriThuc; }
set { giaTriThuc = value; }
}
private String dKSuDung;
public String DKSungDung
{
get { return dKSuDung; }
set { dKSuDung = value; }
}
private String moTa;
public String MoTa
{
get { return moTa; }
set { moTa = value; }
}
private int sLBan;
public int SLBan
{
get { return sLBan; }
set { sLBan = value; }
}
private int sLDaBan;
public int SLDaBan
{
get { return sLDaBan; }
set { sLDaBan = value; }
}
private DateTime ngayBDBan;
public DateTime NgayBDBan
{
get { return ngayBDBan; }
set { ngayBDBan = value; }
}
private DateTime ngayKTBan;
public DateTime NgayKTBan
{
get { return ngayKTBan; }
set { ngayKTBan = value; }
}
private DateTime ngayUpdate;
public DateTime NgayUpdate
{
get { return ngayUpdate; }
set { ngayUpdate = value; }
}
private DateTime ngayDNBan;
public DateTime NgayDNBan
{
get { return ngayDNBan; }
set { ngayDNBan = value; }
}
private float tLHoaHong;
public float TLHoaHong
{
get { return tLHoaHong; }
set { tLHoaHong = value; }
}
}
public enum tbSanPhamColumns
{
IdSanPham,
TenSP,
IdLoaiSP,
IdDiaDiem,
IdTrangThaiSP,
IdNhanVien,
IdDoanhNghiep,
GiaBan,
GiaTriThuc,
DKSuDung,
MoTaSP,
SLBan,
SLDaBan,
NgayBDBan,
NgayKTBan,
NgayUpdate,
NgayDNBan,
TLHoaHong
}
public class tbSanPhamCollection : List<tbSanPham> { }
}
| 02cdnth2 | trunk/Entities/tbSanPham.cs | C# | epl | 3,652 |
using System;
using System.Collections.Generic;
using System.Text;
namespace Entities
{
public class tbHinhAnh
{
private int idHinhAnh;
public int IdHinhAnh
{
get { return idHinhAnh; }
set { idHinhAnh = value; }
}
private String tenHinh;
public String TenHinh
{
get { return tenHinh; }
set { tenHinh = value; }
}
private String duongDan;
public String DuongDan
{
get { return duongDan; }
set { duongDan = value; }
}
private int idSanPham;
public int IdSanPham
{
get { return idSanPham; }
set { idSanPham = value; }
}
}
public enum tbHinhAnhColumns
{
IdHinhAnh,
TenHinh,
DuongDan,
IdSanPham
}
public class tbHinhAnhCollection : List<tbHinhAnh> { }
}
| 02cdnth2 | trunk/Entities/tbHinhAnh.cs | C# | epl | 999 |
using System;
using System.Collections.Generic;
using System.Text;
namespace Entities
{
public class tbHinhThucTT
{
private int idHinhThuc;
public int IdHinhThuc
{
get { return idHinhThuc; }
set { idHinhThuc = value; }
}
private String tenHinhThuc;
public String TenHinhThuc
{
get { return tenHinhThuc; }
set { tenHinhThuc = value; }
}
}
public enum tbHinhThucTTColumns
{
IdHinhThuc,
TenHinhThuc
}
public class tbHinhThucTTCollection : List<tbHinhThucTT> { }
}
| 02cdnth2 | trunk/Entities/tbHinhThucTT.cs | C# | epl | 661 |
using System;
using System.Collections.Generic;
using System.Text;
namespace Entities
{
public class tbTrangThaiDH
{
private int idTrangThaiDH;
public int IdTrangThaiDH
{
get { return idTrangThaiDH; }
set { idTrangThaiDH = value; }
}
private bool trangThai_DH;
public bool TrangThai_DH
{
get { return trangThai_DH; }
set { trangThai_DH = value; }
}
}
public enum tbTrangThaiDHColumns
{
IdTrangThaiDH,
TrangThai_DH
}
public class tbTrangThaiDHCollection : List<tbTrangThaiDH> { }
}
| 02cdnth2 | trunk/Entities/tbTrangThaiDH.cs | C# | epl | 683 |
using System;
using System.Collections.Generic;
using System.Text;
namespace Entities
{
public class tbTrangThaiSP
{
private int idTrangThaiSP;
public int IdTrangThaiSP
{
get { return idTrangThaiSP; }
set { idTrangThaiSP = value; }
}
private string tenTrangThai;
public string TenTrangThai
{
get { return tenTrangThai; }
set { tenTrangThai = value; }
}
}
public enum tbTrangThaiSPColumns
{
IdTrangThaiSP,
TenTrangThai
}
public class tbTrangThaiSPCollection : List<tbTrangThaiSP> { }
}
| 02cdnth2 | trunk/Entities/tbTrangThaiSP.cs | C# | epl | 678 |
using System;
using System.Collections.Generic;
using System.Text;
namespace Entities
{
public class tbDiaDiem
{
private int idDiaDiem;
public int IdDiaDiem
{
get { return idDiaDiem; }
set { idDiaDiem = value; }
}
private String tenDiaDiem;
public String TenDiaDiem
{
get { return tenDiaDiem; }
set { tenDiaDiem = value; }
}
}
public enum tbDiaDiemColumns
{
IdDiaDiem,
TenDiaDiem
}
public class tbDiaDiemCollection : List<tbDiaDiem> { }
}
| 02cdnth2 | trunk/Entities/tbDiaDiem.cs | C# | epl | 653 |
using System;
using System.Collections.Generic;
using System.Text;
namespace Entities
{
public class tbLoaiSP
{
private int idLoaiSP;
public int IdLoaiSP
{
get { return idLoaiSP; }
set { idLoaiSP = value; }
}
private string tenLoai;
public string TenLoai
{
get { return tenLoai; }
set { tenLoai = value; }
}
}
public enum tbLoaiSPColumns
{
IdLoaiSP,
TenLoai
}
public class tbLoaiSPCollection : List<tbLoaiSP> { }
}
| 02cdnth2 | trunk/Entities/tbLoaiSP.cs | C# | epl | 620 |
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Entities")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Entities")]
[assembly: AssemblyCopyright("Copyright © 2011")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("26b5d680-7fb1-48d2-8502-290e2aba8604")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
| 02cdnth2 | trunk/Entities/Properties/AssemblyInfo.cs | C# | epl | 1,387 |
using System;
using System.Collections.Generic;
using System.Text;
namespace Entities
{
public class tbCTDonHang
{
private int idCTDonHang;
public int IdCTDonHang
{
get { return idCTDonHang; }
set { idCTDonHang = value; }
}
private int idDH;
public int IdDH
{
get { return idDH; }
set { idDH = value; }
}
private int idSanPham;
public int IdSanPham
{
get { return idSanPham; }
set { idSanPham = value; }
}
private int soLuong;
public int SoLuong
{
get { return soLuong; }
set { soLuong = value; }
}
private int donGia;
public int DonGia
{
get { return donGia; }
set { donGia = value; }
}
}
public enum tbCTDonHangColumns
{
IdCTDonHang,
IdDH,
IdSanPham,
SoLuong,
DonGia
}
public class tbCTDonHangCollection : List<tbCTDonHang> { }
}
| 02cdnth2 | trunk/Entities/tbCTDonHang.cs | C# | epl | 1,150 |
using System;
using System.Collections.Generic;
using System.Text;
namespace Entities
{
public class tbDonHang
{
private int idDH;
public int IdDH
{
get { return idDH; }
set { idDH = value; }
}
private int idKhachHang;
public int IdKhachHang
{
get { return idKhachHang; }
set { idKhachHang = value; }
}
private DateTime ngayDatHang;
public DateTime NgayDatHang
{
get { return ngayDatHang; }
set { ngayDatHang = value; }
}
private int triGia;
public int TriGia
{
get { return triGia; }
set { triGia = value; }
}
private int idTrangThaiDH;
public int IdTrangThaiDH
{
get { return idTrangThaiDH; }
set { idTrangThaiDH = value; }
}
private DateTime ngayGiaoHang;
public DateTime NgayGiaoHang
{
get { return ngayGiaoHang; }
set { ngayGiaoHang = value; }
}
private String diaChiNhanHang;
public String DiaChiNhanHang
{
get { return diaChiNhanHang; }
set { diaChiNhanHang = value; }
}
}
public enum tbDonHangColumns
{
IdDH,
IdKhachHang,
NgayDatHang,
TriGia,
IdTrangThaiDH,
NgayGiaoHang,
DiaChiNhanHang
}
public class tbDonHangCollection : List<tbDonHang> { }
}
| 02cdnth2 | trunk/Entities/tbDonHang.cs | C# | epl | 1,635 |
using System;
using System.Collections.Generic;
using System.Text;
namespace Entities
{
public class tbDoanhNghiep
{
private int idDoanhNghiep;
public int IdDoanhNghiep
{
get { return idDoanhNghiep; }
set { idDoanhNghiep = value; }
}
private string tenDoanhNghiep;
public string TenDoanhNghiep
{
get { return tenDoanhNghiep; }
set { tenDoanhNghiep = value; }
}
private string diaChi;
public string DiaChi
{
get { return diaChi; }
set { diaChi = value; }
}
private string dienThoai;
public string DienThoai
{
get { return dienThoai; }
set { dienThoai = value; }
}
}
public enum tbDoanhNghiepColumns
{
IdDoanhNghiep,
TenDoanhNghiep,
DiaChi,
DienThoai
}
public class tbDoanhNghiepCollection : List<tbDoanhNghiep> { }
}
| 02cdnth2 | trunk/Entities/tbDoanhNghiep.cs | C# | epl | 1,055 |
using System;
using System.Collections.Generic;
using System.Text;
namespace Entities
{
public class tbMaSoSP
{
private int idMaSoSP;
public int IdMaSoSP
{
get { return idMaSoSP; }
set { idMaSoSP = value; }
}
private int idCTDonHang;
public int IdCTDonHang
{
get { return idCTDonHang; }
set { idCTDonHang = value; }
}
private int maSo;
public int MaSo
{
get { return maSo; }
set { maSo = value; }
}
private bool trangThai;
public bool TrangThai
{
get { return trangThai; }
set { trangThai = value; }
}
}
public enum tbMaSoSPColumns
{
IdMaSoSP,
IdCTDonHang,
MaSo,
TrangThai
}
public class tbMaSoSPCollection : List<tbMaSoSP> { }
}
| 02cdnth2 | trunk/Entities/tbMaSoSP.cs | C# | epl | 984 |
using System;
using System.Collections.Generic;
using System.Text;
namespace Entities
{
public class tbNhanVien
{
private int idNhanVien;
public int IdNhanVien
{
get { return idNhanVien; }
set { idNhanVien = value; }
}
private string taiKhoan;
public string TaiKhoan
{
get { return taiKhoan; }
set { taiKhoan = value; }
}
private string matKhau;
public string MatKhau
{
get { return matKhau; }
set { matKhau = value; }
}
private string tenNhanVien;
public string TenNhanVien
{
get { return tenNhanVien; }
set { tenNhanVien = value; }
}
private string diaChi;
public string DiaChi
{
get { return diaChi; }
set { diaChi = value; }
}
private string dienThoai;
public string DienThoai
{
get { return dienThoai; }
set { dienThoai = value; }
}
}
public enum tbNhanVienColumns
{
IdNhanVien,
TaiKhoan,
MatKhau,
TenNhanVien,
DiaChi,
DienThoai
}
public class tbNhanVienCollection : List<tbNhanVien> { }
}
| 02cdnth2 | trunk/Entities/tbNhanVien.cs | C# | epl | 1,388 |
using System;
using System.Collections.Generic;
using System.Text;
namespace Entities
{
public class tbKhachHang
{
private int idKhachHang;
public int IdKhachHang
{
get { return idKhachHang; }
set { idKhachHang = value; }
}
private String hoTen;
public String HoTen
{
get { return hoTen; }
set { hoTen = value; }
}
private String email;
public String Email
{
get { return email; }
set { email = value; }
}
private String matKhau;
public String MatKhau
{
get { return matKhau; }
set { matKhau = value; }
}
private String diaChi;
public String DiaChi
{
get { return diaChi; }
set { diaChi = value; }
}
private String dienThoai;
public String DienThoai
{
get { return dienThoai; }
set { dienThoai = value; }
}
}
public enum tbKhachHangColumns
{
IdKhachHang,
HoTen,
Email,
MatKhau,
DiaChi,
DienThoai
}
public class tbKhachHangCollection : List<tbKhachHang> { }
}
| 02cdnth2 | trunk/Entities/tbKhachHang.cs | C# | epl | 1,356 |
using System;
using System.Collections.Generic;
using System.Text;
using System.Configuration;
using System.Data.SqlClient;
using System.Data;
using Entities;
namespace DAL
{
public class tbLoaiSPDAL
{
private SqlConnection cn = null;
public tbLoaiSPDAL()
{
cn = new SqlConnection(ConfigurationManager.ConnectionStrings["strConnection"].ConnectionString);
cn.Open();
}
public void Insert(tbLoaiSP loaisp)
{
SqlCommand cm = new SqlCommand("sp_LoaiSP_insert", cn);
cm.CommandType = System.Data.CommandType.StoredProcedure;
cm.Parameters.AddWithValue("@TenLoai", loaisp.TenLoai );
cm.ExecuteNonQuery();
}
public void Update(tbLoaiSP loaisp)
{
SqlCommand cm = new SqlCommand("sp_LoaiSP_update", cn);
cm.CommandType = System.Data.CommandType.StoredProcedure;
cm.Parameters.AddWithValue("@IdLoaiSP", loaisp.IdLoaiSP );
cm.Parameters.AddWithValue("@TenLoai", loaisp.TenLoai);
cm.ExecuteNonQuery();
}
public void Delete(int Id)
{
SqlCommand cm = new SqlCommand("sp_LoaiSP_delete", cn);
cm.CommandType = System.Data.CommandType.StoredProcedure;
cm.Parameters.AddWithValue("@IdLoaiSP", Id);
cm.ExecuteNonQuery();
}
public tbLoaiSPCollection Get(string Where, int PageIndex,
int PageSize, string OderBy,
string OrderDirection, out int TotalRecords)
{
SqlCommand cm = new SqlCommand("sp_LoaiSP_Get", cn);
cm.CommandType = System.Data.CommandType.StoredProcedure;
cm.Parameters.AddWithValue("@Where", Where);
cm.Parameters.AddWithValue("@PageIndex", PageIndex);
cm.Parameters.AddWithValue("@PageSize", PageSize);
cm.Parameters.AddWithValue("@OrderBy", OderBy);
cm.Parameters.AddWithValue("@OrderDirection", OrderDirection);
cm.Parameters.Add(new SqlParameter("@TotalRecords", DbType.Int32)).Direction = ParameterDirection.Output;
SqlDataReader dr = cm.ExecuteReader ();
tbLoaiSPCollection loaispcollection = new tbLoaiSPCollection();
while (dr.Read())
{
tbLoaiSP tbloaisp = new tbLoaiSP();
tbloaisp.IdLoaiSP = int.Parse(dr.GetValue(0).ToString());
tbloaisp.TenLoai = dr.GetValue(1).ToString();
loaispcollection.Add(tbloaisp);
}
dr.Close();
TotalRecords = int.Parse(cm.Parameters["@TotalRecords"].Value.ToString());
return loaispcollection;
}
}
}
| 02cdnth2 | trunk/DAL/tbLoaiSPDAL.cs | C# | epl | 2,873 |
using System;
using System.Collections.Generic;
using System.Text;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using Entities;
namespace DAL
{
public class tbDoanhNghiepDAL
{
private SqlConnection cn = null;
public tbDoanhNghiepDAL ()
{
cn = new SqlConnection(ConfigurationManager.ConnectionStrings["strConnection"].ConnectionString);
cn.Open();
}
public void Insert(tbDoanhNghiep doanhnghiep)
{
SqlCommand cm = new SqlCommand("sp_DoanhNghiep_Insert", cn);
cm.CommandType = System.Data.CommandType.StoredProcedure;
cm.Parameters.AddWithValue("@TenDoanhNghiep", doanhnghiep.TenDoanhNghiep);
cm.Parameters.AddWithValue("@DiaChi", doanhnghiep.DiaChi);
cm.Parameters.AddWithValue("@DienThoai", doanhnghiep.DienThoai);
cm.ExecuteNonQuery();
}
public void Update(tbDoanhNghiep doanhnghiep)
{
SqlCommand cm = new SqlCommand("sp_DoanhNghiep_Update", cn);
cm.CommandType = System.Data.CommandType.StoredProcedure;
cm.Parameters.AddWithValue("@IdDoanhNghiep", doanhnghiep.IdDoanhNghiep);
cm.Parameters.AddWithValue("@TenDoanhNghiep", doanhnghiep.TenDoanhNghiep);
cm.Parameters.AddWithValue("@DiaChi", doanhnghiep.DiaChi);
cm.Parameters.AddWithValue("@DienThoai", doanhnghiep.DienThoai);
cm.ExecuteNonQuery();
}
public void Delete(int Id)
{
SqlCommand cm = new SqlCommand("sp_DoanhNghiep_Delete", cn);
cm.CommandType = System.Data.CommandType.StoredProcedure;
cm.Parameters.AddWithValue("@IdDoanhNghiep", Id);
cm.ExecuteNonQuery();
}
public tbDoanhNghiepCollection Get(string Where, int PageIndex,
int PageSize, string OrderBy, string OrderDirection, out int TotalRecords)
{
SqlCommand cm = new SqlCommand("sp_DoanhNghiep_Get", cn);
cm.CommandType = System.Data.CommandType.StoredProcedure;
cm.Parameters.AddWithValue("@Where", Where);
cm.Parameters.AddWithValue("@PageIndex", PageIndex);
cm.Parameters.AddWithValue("@PageSize", PageSize);
cm.Parameters.AddWithValue("@OrderBy", OrderBy);
cm.Parameters.AddWithValue("@OrderDirection", OrderDirection);
cm.Parameters.Add(new SqlParameter("@TotalRecords", DbType.Int32)).Direction = ParameterDirection.Output;
tbDoanhNghiepCollection doanhnghiepCollection = new tbDoanhNghiepCollection();
SqlDataReader dr = cm.ExecuteReader();
while (dr.Read())
{
tbDoanhNghiep doanhnghiep = new tbDoanhNghiep();
doanhnghiep.IdDoanhNghiep = int.Parse(dr.GetValue(0).ToString());
doanhnghiep.TenDoanhNghiep = dr.GetValue(1).ToString();
doanhnghiep.DiaChi = dr.GetValue(2).ToString();
doanhnghiep.DienThoai = dr.GetValue(3).ToString();
doanhnghiepCollection.Add(doanhnghiep);
}
dr.Close();
TotalRecords = int.Parse(cm.Parameters["@TotalRecords"].Value.ToString());
return doanhnghiepCollection;
}
}
}
| 02cdnth2 | trunk/DAL/tbDoanhNghiepDAL.cs | C# | epl | 3,395 |
using System;
using System.Collections.Generic;
using System.Text;
using Entities;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
namespace DAL
{
public class tbDiaDiemDAL
{
private SqlConnection cn = null;
public tbDiaDiemDAL()
{
cn = new SqlConnection(ConfigurationManager.ConnectionStrings["strConnection"].ConnectionString);
cn.Open();
}
public void Insert(tbDiaDiem dd)
{
SqlCommand cm = new SqlCommand("sp_DiaDiem_insert", cn);
cm.CommandType = System.Data.CommandType.StoredProcedure;
cm.Parameters.AddWithValue("@TenDiaDiem", dd.TenDiaDiem);
cm.ExecuteNonQuery();
}
public void Update(tbDiaDiem dd)
{
SqlCommand cm = new SqlCommand("sp_DiaDiem_update", cn);
cm.CommandType = System.Data.CommandType.StoredProcedure;
cm.Parameters.AddWithValue("@IdDiaDiem", dd.IdDiaDiem);
cm.Parameters.AddWithValue("@TenDiaDiem", dd.TenDiaDiem);
cm.ExecuteNonQuery();
}
public void Delete(int Id)
{
SqlCommand cm = new SqlCommand("sp_DiaDiem_delete", cn);
cm.CommandType = System.Data.CommandType.StoredProcedure;
cm.Parameters.AddWithValue("@IdDiaDiem", Id);
cm.ExecuteNonQuery();
}
public tbDiaDiemCollection Get(string Where, int pageIndex, int pageSize, string orderBy, string orderDirection, out int totalRecords)
{
SqlCommand cm = new SqlCommand("sp_DiaDiem_Get", cn);
cm.CommandType = System.Data.CommandType.StoredProcedure;
cm.Parameters.AddWithValue("@Where", Where);
cm.Parameters.AddWithValue("@PageIndex", pageIndex);
cm.Parameters.AddWithValue("@PageSize", pageSize);
cm.Parameters.AddWithValue("@OrderBy", orderBy);
cm.Parameters.AddWithValue("@OrderDirection", orderDirection);
cm.Parameters.Add(new SqlParameter("@TotalRecords", System.Data.DbType.Int32)).Direction = System.Data.ParameterDirection.Output;
SqlDataReader dr = cm.ExecuteReader();
tbDiaDiemCollection ddcollection = new tbDiaDiemCollection();
while (dr.Read())
{
tbDiaDiem dd = new tbDiaDiem();
dd.IdDiaDiem = int.Parse(dr.GetValue(0).ToString());
dd.TenDiaDiem = (dr.GetValue(1).ToString());
ddcollection.Add(dd);
}
dr.Close();
totalRecords = int.Parse(cm.Parameters["@TotalRecords"].Value.ToString());
return ddcollection;
}
}
}
| 02cdnth2 | trunk/DAL/tbDiaDiemDAL.cs | C# | epl | 2,789 |
using System;
using System.Collections.Generic;
using System.Text;
using Entities;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
namespace DAL
{
public class tbTrangThaiSPDAL
{
private SqlConnection cn = null;
public tbTrangThaiSPDAL()
{
cn = new SqlConnection(ConfigurationManager.ConnectionStrings["strConnection"].ConnectionString);
cn.Open();
}
public void Insert(tbTrangThaiSP trangthaisp)
{
SqlCommand cm = new SqlCommand("sp_TrangThaiSP_Insert", cn);
cm.CommandType = System.Data.CommandType.StoredProcedure;
cm.Parameters.AddWithValue("@TenTrangThai",trangthaisp.TenTrangThai);
cm.ExecuteNonQuery();
}
public void Update(tbTrangThaiSP trangthaisp)
{
SqlCommand cm = new SqlCommand("sp_TrangThaiSP_Update", cn);
cm.CommandType = System.Data.CommandType.StoredProcedure;
cm.Parameters.AddWithValue("@IdTrangThaiSP", trangthaisp.IdTrangThaiSP);
cm.Parameters.AddWithValue("@TenTrangThai", trangthaisp.TenTrangThai);
cm.ExecuteNonQuery();
}
public void Delete(int Id)
{
SqlCommand cm = new SqlCommand("sp_TrangThaiSP_Delete", cn);
cm.CommandType = System.Data.CommandType.StoredProcedure;
cm.Parameters.AddWithValue("@IdTrangThaiSP", Id);
cm.ExecuteNonQuery();
}
public tbTrangThaiSPCollection Get(string Where, int PageIndex, int PageSize, string OrderBy, string OrderDirection, out int TotalRecords)
{
SqlCommand cm = new SqlCommand("sp_TrangThaiSP_Get", cn);
cm.CommandType = System.Data.CommandType.StoredProcedure;
cm.Parameters.AddWithValue("@Where", Where);
cm.Parameters.AddWithValue("@PageIndex", PageIndex);
cm.Parameters.AddWithValue("@PageSize", PageSize);
cm.Parameters.AddWithValue("@OrderBy", OrderBy);
cm.Parameters.AddWithValue("@OrderDirection", OrderDirection);
cm .Parameters .Add (new SqlParameter ("@TotalRecords",DbType .Int32 )).Direction =ParameterDirection .Output ;
SqlDataReader dr = cm.ExecuteReader();
tbTrangThaiSPCollection ttspCollection = new tbTrangThaiSPCollection();
while (dr.Read())
{
tbTrangThaiSP ttsp = new tbTrangThaiSP();
ttsp.IdTrangThaiSP = int.Parse(dr.GetValue(0).ToString());
ttsp.TenTrangThai = dr.GetValue(1).ToString();
ttspCollection.Add(ttsp);
}
dr.Close();
TotalRecords = int.Parse(cm.Parameters["@TotalRecords"].Value.ToString());
return ttspCollection;
}
}
}
| 02cdnth2 | trunk/DAL/tbTrangThaiSPDAL.cs | C# | epl | 2,890 |
using System;
using System.Collections.Generic;
using System.Text;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using Entities;
namespace DAL
{
public class tbHinhThucTTDAL
{
private SqlConnection cn = null;
public tbHinhThucTTDAL()
{
cn = new SqlConnection(ConfigurationManager.ConnectionStrings["strConnection"].ConnectionString);
cn.Open();
}
public void Insert(tbHinhThucTT hinhthuctt)
{
SqlCommand cm = new SqlCommand("sp_HinhThucTT_Insert", cn);
cm.CommandType = System.Data.CommandType.StoredProcedure;
cm.Parameters.AddWithValue("@TenHinhThuc", hinhthuctt.TenHinhThuc);
cm.ExecuteNonQuery();
}
public void Update(tbHinhThucTT hinhthuctt)
{
SqlCommand cm = new SqlCommand("sp_HinhThucTT_Update", cn);
cm.CommandType = System.Data.CommandType.StoredProcedure;
cm.Parameters.AddWithValue("@IdHinhThuc", hinhthuctt.IdHinhThuc);
cm.Parameters.AddWithValue("@TenHinhThuc", hinhthuctt.TenHinhThuc);
cm.ExecuteNonQuery();
}
public void Delete(int Id)
{
SqlCommand cm = new SqlCommand("sp_HinhThucTT_Delete", cn);
cm.CommandType = System.Data.CommandType.StoredProcedure;
cm.Parameters.AddWithValue("@IdHinhThuc", Id);
cm.ExecuteNonQuery();
}
public tbHinhThucTTCollection Get(string Where, int pageIndex, int pageSize, string orderBy, string orderDirection, out int totalRecords)
{
SqlCommand cm = new SqlCommand("sp_HinhThucTT_Get", cn);
cm.CommandType = System.Data.CommandType.StoredProcedure;
cm.Parameters.AddWithValue("@Where", Where);
cm.Parameters.AddWithValue("@PageIndex", pageIndex);
cm.Parameters.AddWithValue("@PageSize", pageSize);
cm.Parameters.AddWithValue("@OrderBy", orderBy);
cm.Parameters.AddWithValue("@OrderDirection", orderDirection);
cm.Parameters.Add(new SqlParameter("@TotalRecords", System.Data.DbType.Int32)).Direction = System.Data.ParameterDirection.Output;
SqlDataReader dr = cm.ExecuteReader();
tbHinhThucTTCollection hinhthucttcollection = new tbHinhThucTTCollection();
while (dr.Read())
{
tbHinhThucTT hinhthuctt = new tbHinhThucTT();
hinhthuctt.IdHinhThuc = int.Parse(dr.GetValue(0).ToString());
hinhthuctt.TenHinhThuc = dr.GetValue(1).ToString();
hinhthucttcollection.Add(hinhthuctt);
}
dr.Close();
totalRecords = int.Parse(cm.Parameters["@TotalRecords"].Value.ToString());
return hinhthucttcollection;
}
}
}
| 02cdnth2 | trunk/DAL/tbHinhThucTTDAL.cs | C# | epl | 2,926 |
using System;
using System.Collections.Generic;
using System.Text;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using Entities;
namespace DAL
{
public class tbKhachHangDAL
{
private SqlConnection cn = null;
public tbKhachHangDAL()
{
cn = new SqlConnection(ConfigurationManager.ConnectionStrings["strConnection"].ConnectionString);
cn.Open();
}
public void Insert(tbKhachHang kh)
{
SqlCommand cm = new SqlCommand("sp_KhachHang_Insert", cn);
cm.CommandType = System.Data.CommandType.StoredProcedure;
cm.Parameters.AddWithValue("@HoTen", kh.HoTen);
cm.Parameters.AddWithValue("@Email", kh.Email);
cm.Parameters.AddWithValue("@MatKhau", kh.MatKhau);
cm.Parameters.AddWithValue("@DiaChi", kh.DiaChi);
cm.Parameters.AddWithValue("@DienThoai", kh.DienThoai);
cm.ExecuteNonQuery();
}
public void Update(tbKhachHang kh)
{
SqlCommand cm = new SqlCommand("sp_KhachHang_Update", cn);
cm.CommandType = System.Data.CommandType.StoredProcedure;
cm.Parameters.AddWithValue("@IdKhachHang", kh.IdKhachHang);
cm.Parameters.AddWithValue("@HoTen", kh.HoTen);
cm.Parameters.AddWithValue("@Email", kh.Email);
cm.Parameters.AddWithValue("@MatKhau", kh.MatKhau);
cm.Parameters.AddWithValue("@DiaChi", kh.DiaChi);
cm.Parameters.AddWithValue("@DienThoai", kh.DienThoai);
cm.ExecuteNonQuery();
}
public void Delete(int Id)
{
SqlCommand cm = new SqlCommand("sp_KhachHang_Delete", cn);
cm.CommandType = System.Data.CommandType.StoredProcedure;
cm.Parameters.AddWithValue("@IdKhachHang", Id);
cm.ExecuteNonQuery();
}
public tbKhachHangCollection Get(string Where, int pageIndex, int pageSize, string orderBy, string orderDirection, out int totalRecords)
{
SqlCommand cm = new SqlCommand("sp_KhachHang_Get", cn);
cm.CommandType = System.Data.CommandType.StoredProcedure;
cm.Parameters.AddWithValue("@Where", Where);
cm.Parameters.AddWithValue("@PageIndex", pageIndex);
cm.Parameters.AddWithValue("@PageSize", pageSize);
cm.Parameters.AddWithValue("@OrderBy", orderBy);
cm.Parameters.AddWithValue("@OrderDirection", orderDirection);
cm.Parameters.Add(new SqlParameter("@TotalRecords", System.Data.DbType.Int32)).Direction = System.Data.ParameterDirection.Output;
SqlDataReader dr = cm.ExecuteReader();
tbKhachHangCollection khcollection = new tbKhachHangCollection();
while (dr.Read())
{
tbKhachHang kh = new tbKhachHang();
kh.IdKhachHang = int.Parse(dr.GetValue(0).ToString());
kh.HoTen = dr.GetValue(1).ToString();
kh.Email = dr.GetValue(2).ToString();
kh.MatKhau = dr.GetValue(3).ToString();
kh.DiaChi = dr.GetValue(4).ToString();
kh.DienThoai = dr.GetValue(5).ToString();
khcollection.Add(kh);
}
dr.Close();
totalRecords = int.Parse(cm.Parameters["@TotalRecords"].Value.ToString());
return khcollection;
}
}
}
| 02cdnth2 | trunk/DAL/tbKhachHangDAL.cs | C# | epl | 3,535 |
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using Entities;
namespace DAL
{
public class tbDonHangDAL
{
private SqlConnection cn = null;
public tbDonHangDAL()
{
cn = new SqlConnection(ConfigurationManager.ConnectionStrings["strConnection"].ConnectionString);
cn.Open();
}
public int Insert(tbDonHang donhang)
{
SqlCommand cm = new SqlCommand("sp_DonHang_Insert", cn);
cm.CommandType = System.Data.CommandType.StoredProcedure;
cm.Parameters.AddWithValue("@IdKhachHang", donhang.IdKhachHang);
cm.Parameters.AddWithValue("@NgayDatHang", donhang.NgayDatHang);
cm.Parameters.AddWithValue("@IdTrangThaiDH", donhang.IdTrangThaiDH);
cm.Parameters.AddWithValue("@NgayGiaoHang", donhang.NgayGiaoHang);
cm.Parameters.AddWithValue("@DiaChiNhanHang", donhang.DiaChiNhanHang);
return int.Parse(cm.ExecuteScalar().ToString());
}
public void Update(tbDonHang donhang)
{
SqlCommand cm = new SqlCommand("sp_DonHang_Update", cn);
cm.CommandType = System.Data.CommandType.StoredProcedure;
cm.Parameters.AddWithValue("@IdDH", donhang.IdDH );
cm.Parameters.AddWithValue("@IdKhachHang", donhang.IdKhachHang);
cm.Parameters.AddWithValue("@NgayDatHang", donhang.NgayDatHang);
cm.Parameters.AddWithValue("@TriGia", donhang.TriGia );
cm.Parameters.AddWithValue("@IdTrangThaiDH", donhang.IdTrangThaiDH);
cm.Parameters.AddWithValue("@NgayGiaoHang", donhang.NgayGiaoHang);
cm.Parameters.AddWithValue("@DiaChiNhanHang", donhang.DiaChiNhanHang);
cm.ExecuteNonQuery();
}
public void Delete(int Id)
{
SqlCommand cm = new SqlCommand("sp_DonHang_Delete", cn);
cm.CommandType = System.Data.CommandType.StoredProcedure;
cm.Parameters.AddWithValue("@IdDH", Id);
cm.ExecuteNonQuery();
}
public tbDonHangCollection Get(string Where, int pageIndex, int pageSize, string orderBy, string orderDirection, out int totalRecords)
{
SqlCommand cm = new SqlCommand("sp_DonHang_Get", cn);
cm.CommandType = System.Data.CommandType.StoredProcedure;
cm.Parameters.AddWithValue("@Where", Where);
cm.Parameters.AddWithValue("@PageIndex", pageIndex);
cm.Parameters.AddWithValue("@PageSize", pageSize);
cm.Parameters.AddWithValue("@OrderBy", orderBy);
cm.Parameters.AddWithValue("@OrderDirection", orderDirection);
cm.Parameters.Add(new SqlParameter("@TotalRecords", DbType.Int32)).Direction = ParameterDirection.Output;
SqlDataReader dr = cm.ExecuteReader();
tbDonHangCollection donhangcollection = new tbDonHangCollection();
while (dr.Read())
{
tbDonHang donhang = new tbDonHang();
donhang.IdDH = int.Parse(dr.GetValue(0).ToString());
donhang.IdKhachHang = int.Parse(dr.GetValue(1).ToString());
donhang.NgayDatHang = DateTime.Parse(dr.GetValue(2).ToString());
donhang.TriGia = int.Parse(dr.GetValue(3).ToString());
donhang.IdTrangThaiDH = int.Parse(dr.GetValue(4).ToString());
donhang.NgayGiaoHang = DateTime.Parse(dr.GetValue(5).ToString());
donhang.DiaChiNhanHang = dr.GetValue(6).ToString();
donhangcollection.Add(donhang);
}
dr.Close();
totalRecords = int.Parse(cm.Parameters["@TotalRecords"].Value.ToString());
return donhangcollection;
}
}
}
| 02cdnth2 | trunk/DAL/tbDonHangDAL.cs | C# | epl | 3,944 |
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using Entities;
namespace DAL
{
public class tbMaSoSPDAL
{
private SqlConnection cn = null;
public tbMaSoSPDAL()
{
cn = new SqlConnection(ConfigurationManager.ConnectionStrings["strConnection"].ConnectionString);
cn.Open();
}
public void Insert(tbMaSoSP MS)
{
SqlCommand cm = new SqlCommand("sp_MaSoSP_Insert", cn);
cm.CommandType = System.Data.CommandType.StoredProcedure;
cm.Parameters.AddWithValue("@IdMaSoSP", MS.IdMaSoSP);
cm.Parameters.AddWithValue("@IdCTDonHang", MS.IdCTDonHang);
cm.Parameters.AddWithValue("@MaSo", MS.MaSo);
cm.Parameters.AddWithValue("@TrangThai", MS.TrangThai);
cm.ExecuteNonQuery();
}
public void Update(tbMaSoSP MS)
{
SqlCommand cm = new SqlCommand("sp_MaSoSP_Update", cn);
cm.CommandType = System.Data.CommandType.StoredProcedure;
cm.Parameters.AddWithValue("@IdMaSoSP", MS.IdMaSoSP);
cm.Parameters.AddWithValue("@IdCTDonHang", MS.IdCTDonHang);
cm.Parameters.AddWithValue("@MaSo", MS.MaSo);
cm.Parameters.AddWithValue("@TrangThai", MS.TrangThai);
cm.ExecuteNonQuery();
}
public void Delete(int Id)
{
SqlCommand cm = new SqlCommand("sp_MaSoSP_Delete", cn);
cm.CommandType = System.Data.CommandType.StoredProcedure;
cm.Parameters.AddWithValue("@IdMaSoSP", Id);
cm.ExecuteNonQuery();
}
public tbMaSoSPCollection Get(string Where, int pageIndex, int pageSize, string orderBy, string orderDirection, out int totalRecords)
{
SqlCommand cm = new SqlCommand("sp_MaSoSP_Get", cn);
cm.CommandType = System.Data.CommandType.StoredProcedure;
cm.Parameters.AddWithValue("@Where", Where);
cm.Parameters.AddWithValue("@PageIndex", pageIndex);
cm.Parameters.AddWithValue("@PageSize", pageSize);
cm.Parameters.AddWithValue("@OrderBy", orderBy);
cm.Parameters.AddWithValue("@OrderDirection", orderDirection);
cm.Parameters.Add(new SqlParameter("@TotalRecords", System.Data.DbType.Int32)).Direction = System.Data.ParameterDirection.Output;
SqlDataReader dr = cm.ExecuteReader();
tbMaSoSPCollection mscollection = new tbMaSoSPCollection ();
while (dr.Read())
{
tbMaSoSP MS = new tbMaSoSP ();
MS.IdMaSoSP = int.Parse(dr.GetValue(0).ToString());
MS.IdCTDonHang = int.Parse(dr.GetValue(1).ToString());
MS.MaSo = int.Parse(dr.GetValue(2).ToString());
MS.TrangThai = bool .Parse (dr.GetValue(3).ToString());
mscollection.Add(MS);
}
dr.Close();
totalRecords = int.Parse(cm.Parameters["@TotalRecords"].Value.ToString());
return mscollection;
}
}
}
| 02cdnth2 | trunk/DAL/tbMaSoSPDAL.cs | C# | epl | 3,250 |
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using Entities;
namespace DAL
{
public class tbTTGiaoDichDAL
{
private SqlConnection cn = null;
public tbTTGiaoDichDAL()
{
cn = new SqlConnection(ConfigurationManager.ConnectionStrings["strConnection"].ConnectionString);
cn.Open();
}
public void Insert(tbTTGiaoDich ttdg)
{
SqlCommand cm = new SqlCommand("sp_TTGiaoDich_insert", cn);
cm.CommandType = System.Data.CommandType.StoredProcedure;
cm.Parameters.AddWithValue("@IdTTGiaoDich ", ttdg.IdTTGiaoDich);
cm.Parameters.AddWithValue("@IdDH", ttdg.IdDH);
cm.Parameters.AddWithValue("@IdHinhThuc ", ttdg.IdHinhThuc);
cm.Parameters.AddWithValue("@SoTien", ttdg.SoTien);
cm.ExecuteNonQuery();
}
public void Update(tbTTGiaoDich ttdg)
{
SqlCommand cm = new SqlCommand("sp_TTGiaoDich_update", cn);
cm.CommandType = System.Data.CommandType.StoredProcedure;
cm.Parameters.AddWithValue("@IdTTGiaoDich ", ttdg.IdTTGiaoDich);
cm.Parameters.AddWithValue("@IdDH", ttdg.IdDH);
cm.Parameters.AddWithValue("@IdHinhThuc ", ttdg.IdHinhThuc);
cm.Parameters.AddWithValue("@SoTien", ttdg.SoTien);
cm.ExecuteNonQuery();
}
public void Delete(int Id)
{
SqlCommand cm = new SqlCommand("sp_TTGiaoDich_delete", cn);
cm.CommandType = System.Data.CommandType.StoredProcedure;
cm.Parameters.AddWithValue("@IdTTGiaoDich", Id);
cm.ExecuteNonQuery();
}
public tbTTGiaoDichCollection Get(string Where, int pageIndex, int pageSize, string orderBy, string orderDirection, out int totalRecords)
{
SqlCommand cm = new SqlCommand("sp_TTGiaoDich_Get", cn);
cm.CommandType = System.Data.CommandType.StoredProcedure;
cm.Parameters.AddWithValue("@Where", Where);
cm.Parameters.AddWithValue("@PageIndex", pageIndex);
cm.Parameters.AddWithValue("@PageSize", pageSize);
cm.Parameters.AddWithValue("@OrderBy", orderBy);
cm.Parameters.AddWithValue("@OrderDirection", orderDirection);
cm.Parameters.Add(new SqlParameter("@TotalRecords", System.Data.DbType.Int32)).Direction = System.Data.ParameterDirection.Output;
SqlDataReader dr = cm.ExecuteReader();
tbTTGiaoDichCollection ttdgcollection = new tbTTGiaoDichCollection();
while (dr.Read())
{
tbTTGiaoDich ttdg = new tbTTGiaoDich();
ttdg.IdTTGiaoDich = int.Parse(dr.GetValue(0).ToString());
ttdg.IdDH = int.Parse(dr.GetValue(1).ToString());
ttdg.IdHinhThuc = int.Parse(dr.GetValue(2).ToString());
ttdg.SoTien = int.Parse(dr.GetValue(3).ToString());
ttdgcollection.Add(ttdg);
}
dr.Close();
totalRecords = int.Parse(cm.Parameters["@TotalRecords"].Value.ToString());
return ttdgcollection;
}
}
}
| 02cdnth2 | trunk/DAL/tbTTGiaoDichDAL.cs | C# | epl | 3,348 |
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("DAL")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("DAL")]
[assembly: AssemblyCopyright("Copyright © 2011")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("f542ce90-36c7-4d8a-af20-16fd4a94f6b8")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
| 02cdnth2 | trunk/DAL/Properties/AssemblyInfo.cs | C# | epl | 1,377 |
using System;
using System.Collections.Generic;
using System.Text;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using Entities;
namespace DAL
{
public class tbSanPhamDAL
{
private SqlConnection cn = null;
public tbSanPhamDAL()
{
cn = new SqlConnection(ConfigurationManager.ConnectionStrings["strConnection"].ConnectionString);
cn.Open();
}
public int Insert(tbSanPham sanpham)
{
SqlCommand cm = new SqlCommand("sp_SanPham_Insert", cn);
cm.CommandType =System .Data .CommandType .StoredProcedure ;
cm.Parameters .AddWithValue ("@TenSP",sanpham .TenSP );
cm.Parameters .AddWithValue ("@IdLoaiSP",sanpham .IdLoaiSP );
cm.Parameters .AddWithValue ("@IdDiaDiem",sanpham .IdDiaDiem );
cm.Parameters .AddWithValue ("@IdTrangThaiSP",sanpham .IdTrangThaiSP );
cm.Parameters .AddWithValue ("@IdNhanVien",sanpham .IdNhanVien );
cm.Parameters .AddWithValue ("@IdDoanhNghiep",sanpham .IdDoanhNghiep );
cm.Parameters .AddWithValue ("@GiaBan",sanpham .GiaBan );
cm.Parameters .AddWithValue ("@GiaTriThuc",sanpham .GiaTriThuc );
cm.Parameters .AddWithValue ("@DKSuDung",sanpham .DKSungDung );
cm.Parameters .AddWithValue ("@MoTaSP",sanpham .MoTa );
cm.Parameters .AddWithValue ("@SLBan",sanpham .SLBan );
cm.Parameters .AddWithValue ("@SLDaBan",sanpham .SLDaBan );
cm.Parameters .AddWithValue ("@NgayBDBan",sanpham .NgayBDBan );
cm.Parameters .AddWithValue ("@NgayKTBan",sanpham .NgayKTBan );
cm.Parameters .AddWithValue ("@NgayUpdate",sanpham .NgayUpdate );
cm.Parameters .AddWithValue ("@NgayDNBan",sanpham .NgayDNBan );
cm.Parameters .AddWithValue ("@TLHoaHong",sanpham .TLHoaHong );
return int.Parse (cm.ExecuteScalar ().ToString ());
}
public void Update(tbSanPham sanpham)
{
SqlCommand cm = new SqlCommand("sp_SanPham_Update", cn);
cm.CommandType = System.Data.CommandType.StoredProcedure;
cm.Parameters.AddWithValue("@IdSanPham", sanpham.IdSanPham );
cm.Parameters.AddWithValue("@TenSP", sanpham.TenSP);
cm.Parameters.AddWithValue("@IdLoaiSP", sanpham.IdLoaiSP);
cm.Parameters.AddWithValue("@IdDiaDiem", sanpham.IdDiaDiem);
cm.Parameters.AddWithValue("@IdTrangThaiSP", sanpham.IdTrangThaiSP);
cm.Parameters.AddWithValue("@IdNhanVien", sanpham.IdNhanVien);
cm.Parameters.AddWithValue("@IdDoanhNghiep", sanpham.IdDoanhNghiep);
cm.Parameters.AddWithValue("@GiaBan", sanpham.GiaBan);
cm.Parameters.AddWithValue("@GiaTriThuc", sanpham.GiaTriThuc);
cm.Parameters.AddWithValue("@DKSuDung", sanpham.DKSungDung);
cm.Parameters.AddWithValue("@MoTaSP", sanpham.MoTa);
cm.Parameters.AddWithValue("@SLBan", sanpham.SLBan);
cm.Parameters.AddWithValue("@SLDaBan", sanpham.SLDaBan);
cm.Parameters.AddWithValue("@NgayBDBan", sanpham.NgayBDBan);
cm.Parameters.AddWithValue("@NgayKTBan", sanpham.NgayKTBan);
cm.Parameters.AddWithValue("@NgayUpdate", sanpham.NgayUpdate);
cm.Parameters.AddWithValue("@NgayDNBan", sanpham.NgayDNBan);
cm.Parameters.AddWithValue("@TLHoaHong", sanpham.TLHoaHong);
cm.ExecuteNonQuery();
}
public void Delete(int Id)
{
SqlCommand cm = new SqlCommand("sp_SanPham_Delete", cn);
cm.CommandType = System.Data.CommandType.StoredProcedure;
cm.Parameters.AddWithValue("@IdSanPham", Id);
cm.ExecuteNonQuery();
}
public tbSanPhamCollection Get(string where, int PageIndex, int PageSize, string OrderBy, string OrderDirection, out int TotalRecords)
{
SqlCommand cm = new SqlCommand("sp_SanPham_Get", cn);
cm.CommandType = System.Data.CommandType.StoredProcedure;
cm.Parameters.AddWithValue("@Where", where);
cm.Parameters.AddWithValue("@PageIndex", PageIndex);
cm.Parameters.AddWithValue("@PageSize", PageSize);
cm.Parameters.AddWithValue("@OrderBy", OrderBy);
cm.Parameters.AddWithValue("@OrderDirection", OrderDirection);
cm.Parameters.Add(new SqlParameter("@TotalRecords", System.Data.DbType.Int32)).Direction = System.Data.ParameterDirection.Output;
SqlDataReader dr = cm.ExecuteReader();
tbSanPhamCollection SPColection = new tbSanPhamCollection();
while (dr.Read())
{
tbSanPham sanpham = new tbSanPham();
sanpham .IdSanPham = int.Parse(dr.GetValue(0).ToString());
sanpham.TenSP = dr.GetValue(1).ToString();
sanpham.IdLoaiSP = int.Parse (dr.GetValue(2).ToString());
sanpham.IdDiaDiem = int.Parse (dr.GetValue(3).ToString());
sanpham.IdTrangThaiSP = int.Parse (dr.GetValue(4).ToString());
sanpham.IdNhanVien = int.Parse (dr.GetValue(5).ToString());
sanpham.IdDoanhNghiep = int.Parse (dr.GetValue(6).ToString());
sanpham.GiaBan = int.Parse (dr.GetValue(7).ToString());
sanpham.GiaTriThuc = int.Parse (dr.GetValue(8).ToString());
sanpham.DKSungDung = dr.GetValue(9).ToString();
sanpham.MoTa = dr.GetValue(10).ToString();
sanpham.SLBan = int.Parse (dr.GetValue(11).ToString());
sanpham.SLDaBan = int.Parse (dr.GetValue(12).ToString());
sanpham.NgayBDBan = DateTime .Parse (dr.GetValue(13).ToString());
sanpham.NgayKTBan = DateTime .Parse (dr.GetValue(14).ToString());
sanpham.NgayUpdate = DateTime .Parse (dr.GetValue(15).ToString());
sanpham.NgayDNBan = DateTime .Parse (dr.GetValue(16).ToString());
sanpham.TLHoaHong = float .Parse (dr.GetValue(17).ToString());
SPColection.Add(sanpham);
}
dr.Close();
TotalRecords = int.Parse(cm.Parameters["@TotalRecords"].Value.ToString());
return SPColection;
}
}
}
| 02cdnth2 | trunk/DAL/tbSanPhamDAL.cs | C# | epl | 6,489 |
using System;
using System.Collections.Generic;
using System.Text;
using Entities;
using System.Data.SqlClient;
using System.Data;
using System.Configuration;
namespace DAL
{
public class tbNhanVienDAL
{
private SqlConnection cn = null;
public tbNhanVienDAL()
{
cn = new SqlConnection(ConfigurationManager.ConnectionStrings["strConnection"].ConnectionString);
cn.Open();
}
public void Insert(tbNhanVien nhanvien)
{
SqlCommand cm = new SqlCommand("sp_NhanVien_Insert", cn);
cm.CommandType = System.Data.CommandType.StoredProcedure;
cm.Parameters.AddWithValue("@TaiKhoan", nhanvien.TaiKhoan);
cm.Parameters.AddWithValue("@MatKhau", nhanvien.MatKhau);
cm.Parameters.AddWithValue("@TenNhanVien", nhanvien.TenNhanVien);
cm.Parameters.AddWithValue("@DiaChi", nhanvien.DiaChi);
cm.Parameters.AddWithValue("@DienThoai", nhanvien.DienThoai);
cm.ExecuteNonQuery();
}
public void Update(tbNhanVien nhanvien)
{
SqlCommand cm = new SqlCommand("sp_NhanVien_Update", cn);
cm.CommandType = System.Data.CommandType.StoredProcedure;
cm.Parameters.AddWithValue("@IdNhanVien", nhanvien.IdNhanVien );
cm.Parameters.AddWithValue("@TaiKhoan", nhanvien.TaiKhoan);
cm.Parameters.AddWithValue("@MatKhau", nhanvien.MatKhau);
cm.Parameters.AddWithValue("@TenNhanVien", nhanvien.TenNhanVien);
cm.Parameters.AddWithValue("@DiaChi", nhanvien.DiaChi);
cm.Parameters.AddWithValue("@DienThoai", nhanvien.DienThoai);
cm.ExecuteNonQuery();
}
public void Delete(int Id)
{
SqlCommand cm = new SqlCommand("sp_NhanVien_Delete", cn);
cm.CommandType = System.Data.CommandType.StoredProcedure;
cm.Parameters.AddWithValue("@IdNhanVien", Id);
cm.ExecuteNonQuery();
}
public tbNhanVienCollection Get(string where, int PageIndex, int PageSize, string OderBy, string OderDirection, out int TotalRecords)
{
SqlCommand cm = new SqlCommand("sp_NhanVien_Get", cn);
cm.CommandType = System.Data.CommandType.StoredProcedure;
cm.Parameters.AddWithValue("@Where", where);
cm.Parameters.AddWithValue("@PageIndex", PageIndex);
cm.Parameters.AddWithValue("@PageSize", PageSize);
cm.Parameters.AddWithValue("@OrderBy", OderBy);
cm.Parameters.AddWithValue("@OrderDirection", OderDirection);
cm.Parameters.Add(new SqlParameter("@TotalRecords", System.Data.DbType.Int32)).Direction = System.Data.ParameterDirection.Output;
SqlDataReader dr = cm.ExecuteReader();
tbNhanVienCollection NVColection = new tbNhanVienCollection();
while (dr.Read())
{
tbNhanVien nhanvien = new tbNhanVien();
nhanvien.IdNhanVien = int.Parse(dr.GetValue(0).ToString());
nhanvien.TaiKhoan = dr.GetValue(1).ToString();
nhanvien.MatKhau = dr.GetValue(2).ToString();
nhanvien.TenNhanVien = dr.GetValue(3).ToString();
nhanvien.DiaChi = dr.GetValue(4).ToString();
nhanvien.DienThoai = dr.GetValue(5).ToString();
NVColection.Add(nhanvien);
}
dr.Close();
TotalRecords = int.Parse(cm.Parameters["@TotalRecords"].Value.ToString());
return NVColection;
}
public Boolean DangNhap(string User, string Pass)
{
string sql = "select count(*) from NhanVien where TaiKhoan='" + User + "' and MatKhau='" + Pass + "'";
SqlCommand cm = new SqlCommand(sql, cn);
int kq = (int)cm.ExecuteScalar();
if (kq > 0)
return true;
else
return false;
}
}
}
| 02cdnth2 | trunk/DAL/tbNhanVienDAL.cs | C# | epl | 4,074 |
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using Entities;
namespace DAL
{
public class tbTrangThaiDHDAL
{
private SqlConnection cn = null;
public tbTrangThaiDHDAL()
{
cn = new SqlConnection(ConfigurationManager.ConnectionStrings["strConnection"].ConnectionString);
cn.Open();
}
public void Insert(tbTrangThaiDH ttdh)
{
SqlCommand cm = new SqlCommand("sp_TrangThaiDH_insert", cn);
cm.CommandType = System.Data.CommandType.StoredProcedure;
cm.Parameters.AddWithValue("@IdTrangThaiDH ", ttdh.IdTrangThaiDH);
cm.Parameters.AddWithValue("@TrangThaiDH", ttdh.TrangThai_DH);
cm.ExecuteNonQuery();
}
public void Update(tbTrangThaiDH ttdh)
{
SqlCommand cm = new SqlCommand("sp_TrangThaiDH_update", cn);
cm.CommandType = System.Data.CommandType.StoredProcedure;
cm.Parameters.AddWithValue("@IdTrangThaiDH ", ttdh.IdTrangThaiDH);
cm.Parameters.AddWithValue("@TrangThaiDH ", ttdh.TrangThai_DH);
cm.ExecuteNonQuery();
}
public void Delete(int Id)
{
SqlCommand cm = new SqlCommand("sp_TrangThaiDH_delete", cn);
cm.CommandType = System.Data.CommandType.StoredProcedure;
cm.Parameters.AddWithValue("@IdTrangThaiDH", Id);
cm.ExecuteNonQuery();
}
public tbTrangThaiDHCollection Get(string Where, int pageIndex, int pageSize, string orderBy, string orderDirection, out int totalRecords)
{
SqlCommand cm = new SqlCommand("sp_TrangThaiDH_Get", cn);
cm.CommandType = System.Data.CommandType.StoredProcedure;
cm.Parameters.AddWithValue("@Where", Where);
cm.Parameters.AddWithValue("@PageIndex", pageIndex);
cm.Parameters.AddWithValue("@PageSize", pageSize);
cm.Parameters.AddWithValue("@OrderBy", orderBy);
cm.Parameters.AddWithValue("@OrderDirection", orderDirection);
cm.Parameters.Add(new SqlParameter("@TotalRecords", System.Data.DbType.Int32)).Direction = System.Data.ParameterDirection.Output;
SqlDataReader dr = cm.ExecuteReader();
tbTrangThaiDHCollection ttdhcollection = new tbTrangThaiDHCollection();
while (dr.Read())
{
tbTrangThaiDH ttdh = new tbTrangThaiDH();
ttdh.IdTrangThaiDH = int.Parse(dr.GetValue(0).ToString());
ttdh.TrangThai_DH = bool.Parse (dr.GetValue(1).ToString());
ttdhcollection.Add(ttdh);
}
dr.Close();
totalRecords = int.Parse(cm.Parameters["@TotalRecords"].Value.ToString());
return ttdhcollection;
}
}
}
| 02cdnth2 | trunk/DAL/tbTrangThaiDHDAL.cs | C# | epl | 2,968 |
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using Entities;
using System.IO;
namespace DAL
{
public class tbHinhAnhDAL
{
private SqlConnection cn = null;
public tbHinhAnhDAL()
{
cn = new SqlConnection(ConfigurationManager.ConnectionStrings["strConnection"].ConnectionString);
cn.Open();
}
public void Insert(tbHinhAnh hinhanh)
{
SqlCommand cm = new SqlCommand("sp_HinhAnh_Insert", cn);
cm.CommandType = System.Data.CommandType.StoredProcedure;
cm.Parameters.AddWithValue("@TenHinh", hinhanh.TenHinh);
cm.Parameters.AddWithValue("@DuongDan", hinhanh.DuongDan);
cm.Parameters.AddWithValue("@IdSanPham",hinhanh.IdSanPham );
cm.ExecuteNonQuery();
}
public void Update(tbHinhAnh hinhanh)
{
SqlCommand cm = new SqlCommand("sp_HinhAnh_Insert", cn);
cm.CommandType = System.Data.CommandType.StoredProcedure;
cm.Parameters.AddWithValue("@IdHinhAnh", hinhanh.IdHinhAnh);
cm.Parameters.AddWithValue("@TenHinh", hinhanh.TenHinh);
cm.Parameters.AddWithValue("@DuongDan", hinhanh.DuongDan);
cm.Parameters.AddWithValue("@IdSanPham", hinhanh.IdSanPham);
cm.ExecuteNonQuery();
}
public void Delete(int Id)
{
SqlCommand cm = new SqlCommand("sp_HinhAnh_Delete", cn);
cm.CommandType = System.Data.CommandType.StoredProcedure;
cm.Parameters.AddWithValue("@IdHinhAnh", Id);
cm.ExecuteNonQuery();
}
public void DeleteIdSP(int IdSanPham)
{
string sql = "delete from HinhAnh where IdSanPham='" + IdSanPham + "'";
SqlCommand cm = new SqlCommand(sql, cn);
cm.ExecuteNonQuery();
}
public string[] DeleteImageByIdSP(int IdSanPham)
{
string sql = "select * from HinhAnh where IdSanPham='" + IdSanPham + "'";
SqlCommand cm = new SqlCommand(sql, cn);
SqlDataReader dr = cm.ExecuteReader();
string[] array =new string [100];
int i=0;
while (dr.Read())
{
array[i]= dr.GetValue(1).ToString();
i++;
}
dr.Close();
return array;
}
public tbHinhAnhCollection Get(string Where, int pageIndex, int pageSize, string orderBy, string orderDirection, out int totalRecords)
{
SqlCommand cm = new SqlCommand("sp_HinhAnh_Get", cn);
cm.CommandType = System.Data.CommandType.StoredProcedure;
cm.Parameters.AddWithValue("@Where", Where);
cm.Parameters.AddWithValue("@PageIndex", pageIndex);
cm.Parameters.AddWithValue("@PageSize", pageSize);
cm.Parameters.AddWithValue("@OrderBy", orderBy);
cm.Parameters.AddWithValue("@OrderDirection", orderDirection);
cm.Parameters.Add(new SqlParameter("@TotalRecords", System.Data.DbType.Int32)).Direction = System.Data.ParameterDirection.Output;
SqlDataReader dr = cm.ExecuteReader();
tbHinhAnhCollection hinhanhcollection = new tbHinhAnhCollection();
while (dr.Read())
{
tbHinhAnh hinhanh = new tbHinhAnh();
hinhanh.IdHinhAnh = int.Parse(dr.GetValue(0).ToString());
hinhanh.TenHinh = dr.GetValue(1).ToString();
hinhanh.DuongDan = dr.GetValue(2).ToString();
hinhanh.IdSanPham = int.Parse(dr.GetValue(3).ToString());
hinhanhcollection.Add(hinhanh);
}
dr.Close();
totalRecords = int.Parse(cm.Parameters["@TotalRecords"].Value.ToString());
return hinhanhcollection;
}
public int FirstImage(int IdSanPham,int Id)
{
SqlCommand cm = new SqlCommand("sp_HinhAnh_GetFirstImage", cn);
cm.CommandType = System.Data.CommandType.StoredProcedure;
cm.Parameters.AddWithValue("@IdSanPham", IdSanPham);
cm.Parameters.Add(new SqlParameter("@IdHA", DbType.Int32)).Direction = ParameterDirection.Output;
cm.ExecuteReader();
Id = int.Parse(cm.Parameters["@IdHA"].Value.ToString());
return Id ;
}
}
}
| 02cdnth2 | trunk/DAL/tbHinhAnhDAL.cs | C# | epl | 4,584 |
using System;
using System.Collections.Generic;
using System.Text;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using Entities;
namespace DAL
{
public class tbCTDonHangDAL
{
private SqlConnection cn = null;
public tbCTDonHangDAL()
{
cn = new SqlConnection(ConfigurationManager.ConnectionStrings["strConnection"].ConnectionString);
cn.Open();
}
public void Insert(tbCTDonHang ctdh)
{
SqlCommand cm = new SqlCommand("sp_CTDonHang_insert", cn);
cm.CommandType = System.Data.CommandType.StoredProcedure;
cm.Parameters.AddWithValue("@IdCTDonHang", ctdh.IdCTDonHang);
cm.Parameters.AddWithValue("@IdDH", ctdh.IdDH);
cm.Parameters.AddWithValue("@IdSanPham", ctdh.IdSanPham);
cm.Parameters.AddWithValue("@SoLuong", ctdh.SoLuong );
cm.Parameters.AddWithValue("@DonGia", ctdh.DonGia);
cm.ExecuteNonQuery();
}
public void Update(tbCTDonHang ctdh)
{
SqlCommand cm = new SqlCommand("sp_CTDonHang_update", cn);
cm.CommandType = System.Data.CommandType.StoredProcedure;
cm.Parameters.AddWithValue("@IdCTDonHang", ctdh.IdCTDonHang);
cm.Parameters.AddWithValue("@IdDH", ctdh.IdDH);
cm.Parameters.AddWithValue("@IdSanPham", ctdh.IdSanPham);
cm.Parameters.AddWithValue("@SoLuong", ctdh.SoLuong );
cm.Parameters.AddWithValue("@DonGia", ctdh.DonGia);
cm.ExecuteNonQuery();
}
public void Delete(int Id)
{
SqlCommand cm = new SqlCommand("sp_CTDonHang_delete", cn);
cm.CommandType = System.Data.CommandType.StoredProcedure;
cm.Parameters.AddWithValue("@IdCTDonHang", Id);
cm.ExecuteNonQuery();
}
public tbCTDonHangCollection Get(string Where, int pageIndex, int pageSize, string orderBy, string orderDirection, out int totalRecords)
{
SqlCommand cm = new SqlCommand("sp_CTDonHang_Get", cn);
cm.CommandType = System.Data.CommandType.StoredProcedure;
cm.Parameters.AddWithValue("@Where", Where);
cm.Parameters.AddWithValue("@PageIndex", pageIndex);
cm.Parameters.AddWithValue("@PageSize", pageSize);
cm.Parameters.AddWithValue("@OrderBy", orderBy);
cm.Parameters.AddWithValue("@OrderDirection", orderDirection);
cm.Parameters.Add(new SqlParameter("@TotalRecords", System.Data.DbType.Int32)).Direction = System.Data.ParameterDirection.Output;
SqlDataReader dr = cm.ExecuteReader();
tbCTDonHangCollection ctdhcollection = new tbCTDonHangCollection();
while (dr.Read())
{
tbCTDonHang ctdh = new tbCTDonHang();
ctdh.IdCTDonHang = int.Parse(dr.GetValue(0).ToString());
ctdh.IdDH = int.Parse(dr.GetValue(1).ToString());
ctdh.IdSanPham = int.Parse(dr.GetValue(2).ToString());
ctdh.SoLuong = int.Parse (dr.GetValue(3).ToString());
ctdh.DonGia = int.Parse (dr.GetValue(4).ToString());
ctdhcollection.Add(ctdh);
}
dr.Close();
totalRecords = int.Parse(cm.Parameters["@TotalRecords"].Value.ToString());
return ctdhcollection;
}
}
}
| 02cdnth2 | trunk/DAL/tbCTDonHangDAL.cs | C# | epl | 3,525 |
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is itstructures.com code.
*
* The Initial Developer of the Original Code is IT Structures.
* Portions created by the Initial Developer are Copyright (C) 2008
* the Initial Developer. All Rights Reserved.
*
* Contributor:
* Ruediger Jungbeck <ruediger.jungbeck@rsj.de>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include <comdef.h>
#include "ffactivex.h"
#include "scriptable.h"
#include "axhost.h"
#ifdef NO_REGISTRY_AUTHORIZE
static const char *WellKnownProgIds[] = {
NULL
};
static const char *WellKnownClsIds[] = {
NULL
};
#endif
static const bool AcceptOnlyWellKnown = false;
static const bool TrustWellKnown = true;
static bool
isWellKnownProgId(const char *progid)
{
#ifdef NO_REGISTRY_AUTHORIZE
unsigned int i = 0;
if (!progid) {
return false;
}
while (WellKnownProgIds[i]) {
if (!strnicmp(WellKnownProgIds[i], progid, strlen(WellKnownProgIds[i])))
return true;
++i;
}
return false;
#else
return true;
#endif
}
static bool
isWellKnownClsId(const char *clsid)
{
#ifdef NO_REGISTRY_AUTHORIZE
unsigned int i = 0;
if (!clsid) {
return false;
}
while (WellKnownClsIds[i]) {
if (!strnicmp(WellKnownClsIds[i], clsid, strlen(WellKnownClsIds[i])))
return true;
++i;
}
return false;
#else
return true;
#endif
}
static LRESULT CALLBACK AxHostWinProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
LRESULT result;
CAxHost *host = (CAxHost *)GetWindowLong(hWnd, GWL_USERDATA);
if (!host) {
return DefWindowProc(hWnd, msg, wParam, lParam);
}
switch (msg)
{
case WM_SETFOCUS:
case WM_KILLFOCUS:
case WM_SIZE:
if (host->Site) {
host->Site->OnDefWindowMessage(msg, wParam, lParam, &result);
return result;
}
else {
return DefWindowProc(hWnd, msg, wParam, lParam);
}
// Window being destroyed
case WM_DESTROY:
break;
default:
return DefWindowProc(hWnd, msg, wParam, lParam);
}
return true;
}
CAxHost::~CAxHost()
{
log(instance, 0, "AxHost.~AXHost: destroying the control...");
if (Window){
if (OldProc)
::SetWindowLong(Window, GWL_WNDPROC, (LONG)OldProc);
::SetWindowLong(Window, GWL_USERDATA, (LONG)NULL);
}
if (Sink) {
Sink->UnsubscribeFromEvents();
Sink->Release();
}
if (Site) {
Site->Detach();
Site->Release();
}
CoFreeUnusedLibraries();
}
CAxHost::CAxHost(NPP inst):
instance(inst),
ClsID(CLSID_NULL),
isValidClsID(false),
Sink(NULL),
Site(NULL),
Window(NULL),
OldProc(NULL),
Props(),
isKnown(false),
CodeBaseUrl(NULL)
{
}
void
CAxHost::setWindow(HWND win)
{
if (win != Window) {
if (win) {
// subclass window so we can intercept window messages and
// do our drawing to it
OldProc = (WNDPROC)::SetWindowLong(win, GWL_WNDPROC, (LONG)AxHostWinProc);
// associate window with our CAxHost object so we can access
// it in the window procedure
::SetWindowLong(win, GWL_USERDATA, (LONG)this);
}
else {
if (OldProc)
::SetWindowLong(Window, GWL_WNDPROC, (LONG)OldProc);
::SetWindowLong(Window, GWL_USERDATA, (LONG)NULL);
}
Window = win;
}
}
HWND
CAxHost::getWinfow()
{
return Window;
}
void
CAxHost::UpdateRect(RECT rcPos)
{
HRESULT hr = -1;
if (Site && Window) {
if (Site->GetParentWindow() == NULL) {
hr = Site->Attach(Window, rcPos, NULL);
if (FAILED(hr)) {
log(instance, 0, "AxHost.UpdateRect: failed to attach control");
}
}
else {
Site->SetPosition(rcPos);
}
// Ensure clipping on parent to keep child controls happy
::SetWindowLong(Window, GWL_STYLE, ::GetWindowLong(Window, GWL_STYLE) | WS_CLIPCHILDREN);
}
}
bool
CAxHost::verifyClsID(LPOLESTR oleClsID)
{
CRegKey keyExplorer;
if (ERROR_SUCCESS == keyExplorer.Open(HKEY_LOCAL_MACHINE,
_T("SOFTWARE\\Microsoft\\Internet Explorer\\ActiveX Compatibility"),
KEY_READ)) {
CRegKey keyCLSID;
if (ERROR_SUCCESS == keyCLSID.Open(keyExplorer, W2T(oleClsID), KEY_READ)) {
DWORD dwType = REG_DWORD;
DWORD dwFlags = 0;
DWORD dwBufSize = sizeof(dwFlags);
if (ERROR_SUCCESS == ::RegQueryValueEx(keyCLSID,
_T("Compatibility Flags"),
NULL,
&dwType,
(LPBYTE)
&dwFlags,
&dwBufSize)) {
// Flags for this reg key
const DWORD kKillBit = 0x00000400;
if (dwFlags & kKillBit) {
log(instance, 0, "AxHost.verifyClsID: the control is marked as unsafe by IE kill bits");
return false;
}
}
}
}
log(instance, 1, "AxHost.verifyClsID: verified successfully");
return true;
}
bool
CAxHost::setClsID(const char *clsid)
{
HRESULT hr = -1;
USES_CONVERSION;
LPOLESTR oleClsID = A2OLE(clsid);
if (isWellKnownClsId(clsid)) {
isKnown = true;
}
else if (AcceptOnlyWellKnown) {
log(instance, 0, "AxHost.setClsID: the requested CLSID is not on the Well Known list");
return false;
}
// Check the Internet Explorer list of vulnerable controls
if (oleClsID && verifyClsID(oleClsID)) {
hr = CLSIDFromString(oleClsID, &ClsID);
if (SUCCEEDED(hr) && !::IsEqualCLSID(ClsID, CLSID_NULL)) {
isValidClsID = true;
log(instance, 1, "AxHost.setClsID: CLSID %s set", clsid);
return true;
}
}
log(instance, 0, "AxHost.setClsID: failed to set the requested clsid");
return false;
}
void CAxHost::setCodeBaseUrl(LPCWSTR codeBaseUrl)
{
CodeBaseUrl = codeBaseUrl;
}
bool
CAxHost::setClsIDFromProgID(const char *progid)
{
HRESULT hr = -1;
CLSID clsid = CLSID_NULL;
USES_CONVERSION;
LPOLESTR oleClsID = NULL;
LPOLESTR oleProgID = A2OLE(progid);
if (AcceptOnlyWellKnown) {
if (isWellKnownProgId(progid)) {
isKnown = true;
}
else {
log(instance, 0, "AxHost.setClsIDFromProgID: the requested PROGID is not on the Well Known list");
return false;
}
}
hr = CLSIDFromProgID(oleProgID, &clsid);
if (FAILED(hr)) {
log(instance, 0, "AxHost.setClsIDFromProgID: could not resolve PROGID");
return false;
}
hr = StringFromCLSID(clsid, &oleClsID);
// Check the Internet Explorer list of vulnerable controls
if ( SUCCEEDED(hr)
&& oleClsID
&& verifyClsID(oleClsID)) {
ClsID = clsid;
if (!::IsEqualCLSID(ClsID, CLSID_NULL)) {
isValidClsID = true;
log(instance, 1, "AxHost.setClsIDFromProgID: PROGID %s resolved and set", progid);
return true;
}
}
log(instance, 0, "AxHost.setClsIDFromProgID: failed to set the resolved CLSID");
return false;
}
bool
CAxHost::hasValidClsID()
{
return isValidClsID;
}
bool
CAxHost::CreateControl(bool subscribeToEvents)
{
if (!isValidClsID) {
log(instance, 0, "AxHost.CreateControl: current location is not trusted");
return false;
}
// Create the control site
CControlSiteInstance::CreateInstance(&Site);
if (Site == NULL) {
log(instance, 0, "AxHost.CreateControl: CreateInstance failed");
return false;
}
Site->m_bSupportWindowlessActivation = false;
if (TrustWellKnown && isKnown) {
Site->SetSecurityPolicy(NULL);
Site->m_bSafeForScriptingObjectsOnly = false;
}
else {
Site->m_bSafeForScriptingObjectsOnly = true;
}
Site->AddRef();
// Create the object
HRESULT hr;
hr = Site->Create(ClsID, Props, CodeBaseUrl);
if (FAILED(hr)) {
LPSTR lpMsgBuf;
DWORD dw = GetLastError();
FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
dw,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPSTR) &lpMsgBuf,
0,
NULL );
log(instance, 0, lpMsgBuf);
log(instance, 0, "AxHost.CreateControl: failed to create site");
return false;
}
IUnknown *control = NULL;
Site->GetControlUnknown(&control);
if (!control) {
log(instance, 0, "AxHost.CreateControl: failed to create control (was it just downloaded?)");
return false;
}
// Create the event sink
CControlEventSinkInstance::CreateInstance(&Sink);
Sink->AddRef();
Sink->instance = instance;
hr = Sink->SubscribeToEvents(control);
control->Release();
if (FAILED(hr) && subscribeToEvents) {
LPSTR lpMsgBuf;
DWORD dw = GetLastError();
FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
dw,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPSTR) &lpMsgBuf,
0,
NULL );
log(instance, 0, lpMsgBuf);
log(instance, 0, "AxHost.CreateControl: SubscribeToEvents failed");
return false;
}
log(instance, 1, "AxHost.CreateControl: control created successfully");
return true;
}
bool
CAxHost::AddEventHandler(wchar_t *name, wchar_t *handler)
{
HRESULT hr;
DISPID id = 0;
USES_CONVERSION;
LPOLESTR oleName = name;
if (!Sink) {
log(instance, 0, "AxHost.AddEventHandler: no valid sink");
return false;
}
hr = Sink->m_spEventSinkTypeInfo->GetIDsOfNames(&oleName, 1, &id);
if (FAILED(hr)) {
log(instance, 0, "AxHost.AddEventHandler: GetIDsOfNames failed to resolve event name");
return false;
}
Sink->events[id] = handler;
log(instance, 1, "AxHost.AddEventHandler: handler %S set for event %S", handler, name);
return true;
}
int16
CAxHost::HandleEvent(void *event)
{
NPEvent *npEvent = (NPEvent *)event;
LRESULT result = 0;
if (!npEvent) {
return 0;
}
// forward all events to the hosted control
return (int16)Site->OnDefWindowMessage(npEvent->event, npEvent->wParam, npEvent->lParam, &result);
}
NPObject *
CAxHost::GetScriptableObject()
{
IUnknown *unk;
NPObject *obj = NPNFuncs.createobject(instance, &ScriptableNPClass);
Site->GetControlUnknown(&unk);
((Scriptable *)obj)->setControl(unk);
((Scriptable *)obj)->setInstance(instance);
return obj;
}
| 007slmg-ff | ff-activex-host/ffactivex/axhost.cpp | C++ | lgpl | 11,705 |
// stdafx.cpp : source file that includes just the standard includes
// ffactivex.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"
// TODO: reference any additional headers you need in STDAFX.H
// and not in this file
| 007slmg-ff | ff-activex-host/ffactivex/stdafx.cpp | C++ | lgpl | 296 |
#pragma once
// The following macros define the minimum required platform. The minimum required platform
// is the earliest version of Windows, Internet Explorer etc. that has the necessary features to run
// your application. The macros work by enabling all features available on platform versions up to and
// including the version specified.
// Modify the following defines if you have to target a platform prior to the ones specified below.
// Refer to MSDN for the latest info on corresponding values for different platforms.
#ifndef WINVER // Specifies that the minimum required platform is Windows Vista.
#define WINVER 0x0600 // Change this to the appropriate value to target other versions of Windows.
#endif
#ifndef _WIN32_WINNT // Specifies that the minimum required platform is Windows Vista.
#define _WIN32_WINNT 0x0600 // Change this to the appropriate value to target other versions of Windows.
#endif
#ifndef _WIN32_WINDOWS // Specifies that the minimum required platform is Windows 98.
#define _WIN32_WINDOWS 0x0410 // Change this to the appropriate value to target Windows Me or later.
#endif
#ifndef _WIN32_IE // Specifies that the minimum required platform is Internet Explorer 7.0.
#define _WIN32_IE 0x0700 // Change this to the appropriate value to target other versions of IE.
#endif
| 007slmg-ff | ff-activex-host/ffactivex/targetver.h | C | lgpl | 1,428 |
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is itstructures.com code.
*
* The Initial Developer of the Original Code is IT Structures.
* Portions created by the Initial Developer are Copyright (C) 2008
* the Initial Developer. All Rights Reserved.
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#pragma once
#include <atlbase.h>
#include <comdef.h>
#include <npapi.h>
#include <npfunctions.h>
#include <npruntime.h>
#include "variants.h"
extern NPNetscapeFuncs NPNFuncs;
extern NPClass ScriptableNPClass;
class Scriptable: public NPObject
{
private:
Scriptable(const Scriptable &);
// This method iterates all members of the current interface, looking for the member with the
// id of member_id. If not found within this interface, it will iterate all base interfaces
// recursively, until a match is found, or all the hierarchy was searched.
bool find_member(ITypeInfoPtr info, TYPEATTR *attr, DISPID member_id, unsigned int invKind) {
bool found = false;
unsigned int i = 0;
FUNCDESC *fDesc;
for (i = 0;
(i < attr->cFuncs)
&& !found;
++i) {
HRESULT hr = info->GetFuncDesc(i, &fDesc);
if ( SUCCEEDED(hr)
&& fDesc
&& (fDesc->memid == member_id)) {
if (invKind & fDesc->invkind)
found = true;
}
info->ReleaseFuncDesc(fDesc);
}
if (!found && (invKind & ~INVOKE_FUNC)) {
VARDESC *vDesc;
for (i = 0;
(i < attr->cVars)
&& !found;
++i) {
HRESULT hr = info->GetVarDesc(i, &vDesc);
if ( SUCCEEDED(hr)
&& vDesc
&& (vDesc->memid == member_id)) {
found = true;
}
info->ReleaseVarDesc(vDesc);
}
}
if (!found) {
// iterate inherited interfaces
HREFTYPE refType = NULL;
for (i = 0; (i < attr->cImplTypes) && !found; ++i) {
ITypeInfoPtr baseInfo;
TYPEATTR *baseAttr;
if (FAILED(info->GetRefTypeOfImplType(0, &refType))) {
continue;
}
if (FAILED(info->GetRefTypeInfo(refType, &baseInfo))) {
continue;
}
if (FAILED(baseInfo->GetTypeAttr(&baseAttr))) {
continue;
}
found = find_member(baseInfo, baseAttr, member_id, invKind);
baseInfo->ReleaseTypeAttr(baseAttr);
}
}
return found;
}
DISPID ResolveName(NPIdentifier name, unsigned int invKind) {
bool found = false;
DISPID dID = -1;
USES_CONVERSION;
if (!name || !invKind) {
return -1;
}
if (!NPNFuncs.identifierisstring(name)) {
return -1;
}
NPUTF8 *npname = NPNFuncs.utf8fromidentifier(name);
LPOLESTR oleName = A2W(npname);
IDispatchPtr disp = control.GetInterfacePtr();
if (!disp) {
return -1;
}
disp->GetIDsOfNames(IID_NULL, &oleName, 1, LOCALE_SYSTEM_DEFAULT, &dID);
if (dID != -1) {
ITypeInfoPtr info;
disp->GetTypeInfo(0, LOCALE_SYSTEM_DEFAULT, &info);
if (!info) {
return -1;
}
TYPEATTR *attr;
if (FAILED(info->GetTypeAttr(&attr))) {
return -1;
}
found = find_member(info, attr, dID, invKind);
info->ReleaseTypeAttr(attr);
}
return found ? dID : -1;
}
bool InvokeControl(DISPID id, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult) {
IDispatchPtr disp = control.GetInterfacePtr();
if (!disp) {
return false;
}
HRESULT hr = disp->Invoke(id, IID_NULL, LOCALE_SYSTEM_DEFAULT, wFlags, pDispParams, pVarResult, NULL, NULL);
return (SUCCEEDED(hr)) ? true : false;
}
IUnknownPtr control;
NPP instance;
bool invalid;
public:
Scriptable():
invalid(false),
control(NULL),
instance(NULL) {
}
~Scriptable() {control->Release();}
void setControl(IUnknown *unk) {control = unk;}
void setControl(IDispatch *disp) {disp->QueryInterface(IID_IUnknown, (void **)&control);}
void setInstance(NPP inst) {instance = inst;}
void Invalidate() {invalid = true;}
static bool _HasMethod(NPObject *npobj, NPIdentifier name) {
return ((Scriptable *)npobj)->HasMethod(name);
}
static bool _Invoke(NPObject *npobj, NPIdentifier name,
const NPVariant *args, uint32_t argCount,
NPVariant *result) {
return ((Scriptable *)npobj)->Invoke(name, args, argCount, result);
}
static bool _HasProperty(NPObject *npobj, NPIdentifier name) {
return ((Scriptable *)npobj)->HasProperty(name);
}
static bool _GetProperty(NPObject *npobj, NPIdentifier name, NPVariant *result) {
return ((Scriptable *)npobj)->GetProperty(name, result);
}
static bool _SetProperty(NPObject *npobj, NPIdentifier name, const NPVariant *value) {
return ((Scriptable *)npobj)->SetProperty(name, value);
}
bool HasMethod(NPIdentifier name) {
if (invalid) return false;
DISPID id = ResolveName(name, INVOKE_FUNC);
return (id != -1) ? true : false;
}
bool Invoke(NPIdentifier name, const NPVariant *args, uint32_t argCount, NPVariant *result) {
if (invalid) return false;
DISPID id = ResolveName(name, INVOKE_FUNC);
if (-1 == id) {
return false;
}
VARIANT *vArgs = NULL;
if (argCount) {
vArgs = new VARIANT[argCount];
if (!vArgs) {
return false;
}
for (unsigned int i = 0; i < argCount; ++i) {
// copy the arguments in reverse order
NPVar2Variant(&args[i], &vArgs[argCount - i - 1], instance);
}
}
DISPPARAMS params = {NULL, NULL, 0, 0};
params.cArgs = argCount;
params.cNamedArgs = 0;
params.rgdispidNamedArgs = NULL;
params.rgvarg = vArgs;
VARIANT vResult;
bool rc = InvokeControl(id, DISPATCH_METHOD, ¶ms, &vResult);
if (vArgs) delete[] vArgs;
if (!rc) {
return false;
}
Variant2NPVar(&vResult, result, instance);
return true;
}
bool HasProperty(NPIdentifier name) {
if (invalid) return false;
DISPID id = ResolveName(name, INVOKE_PROPERTYGET | INVOKE_PROPERTYPUT);
return (id != -1) ? true : false;
}
bool GetProperty(NPIdentifier name, NPVariant *result) {
if (invalid) return false;
DISPID id = ResolveName(name, INVOKE_PROPERTYGET);
if (-1 == id) {
return false;
}
DISPPARAMS params;
params.cArgs = 0;
params.cNamedArgs = 0;
params.rgdispidNamedArgs = NULL;
params.rgvarg = NULL;
VARIANT vResult;
if (!InvokeControl(id, DISPATCH_PROPERTYGET, ¶ms, &vResult)) {
return false;
}
Variant2NPVar(&vResult, result, instance);
return true;
}
bool SetProperty(NPIdentifier name, const NPVariant *value) {
if (invalid) return false;
DISPID id = ResolveName(name, INVOKE_PROPERTYPUT);
if (-1 == id) {
return false;
}
VARIANT val;
NPVar2Variant(value, &val, instance);
DISPPARAMS params;
// Special initialization needed when using propery put.
DISPID dispidNamed = DISPID_PROPERTYPUT;
params.cNamedArgs = 1;
params.rgdispidNamedArgs = &dispidNamed;
params.cArgs = 1;
params.rgvarg = &val;
VARIANT vResult;
if (!InvokeControl(id, DISPATCH_PROPERTYPUT, ¶ms, &vResult)) {
return false;
}
return true;
}
};
| 007slmg-ff | ff-activex-host/ffactivex/scriptable.h | C++ | lgpl | 8,523 |
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is itstructures.com code.
*
* The Initial Developer of the Original Code is IT Structures.
* Portions created by the Initial Developer are Copyright (C) 2008
* the Initial Developer. All Rights Reserved.
*
* Contributor:
* Ruediger Jungbeck <ruediger.jungbeck@rsj.de>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#pragma once
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
// Windows Header Files:
#include <windows.h>
#include "npapi.h"
#include <npfunctions.h>
#include <prtypes.h>
#include "targetver.h"
#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit
#include <atlbase.h>
#include <atlstr.h>
#include <atlcom.h>
#include <atlctl.h>
#include <varargs.h>
#include "variants.h"
#include "common/PropertyList.h"
#include "common/PropertyBag.h"
#include "common/ItemContainer.h"
#include "common/ControlSite.h"
#include "common/ControlSiteIPFrame.h"
#include "common/ControlEventSink.h"
extern NPNetscapeFuncs NPNFuncs;
//#define NO_REGISTRY_AUTHORIZE
static const char PARAM_CLSID[] = "clsid";
static const char PARAM_PROGID[] = "progid";
static const char PARAM_DEBUG[] = "debugLevel";
static const char PARAM_LOGGER[] = "logger";
static const char PARAM_CODEBASEURL [] = "codeBaseUrl";
static const char PARAM_ONEVENT[] = "Event_";
static const char PARAM_PARAM[] = "PARAM_";
void *ffax_calloc(unsigned int size);
void ffax_free(void *ptr);
void log(NPP instance, unsigned int level, char *message, ...);
NPError NPP_New(NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, char *argn[], char *argv[], NPSavedData *saved);
NPError NPP_Destroy(NPP instance, NPSavedData **save);
NPError NPP_SetWindow(NPP instance, NPWindow *window);
| 007slmg-ff | ff-activex-host/ffactivex/ffactivex.h | C | lgpl | 3,257 |
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is itstructures.com code.
*
* The Initial Developer of the Original Code is IT Structures.
* Portions created by the Initial Developer are Copyright (C) 2008
* the Initial Developer. All Rights Reserved.
*
* Contributor:
* Ruediger Jungbeck <ruediger.jungbeck@rsj.de>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
// dllmain.cpp : Defines the entry point for the DLL application.
#include "ffactivex.h"
#include "axhost.h"
CComModule _Module;
NPNetscapeFuncs NPNFuncs;
BOOL APIENTRY DllMain( HMODULE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}
// ==============================
// ! Scriptability related code !
// ==============================
//
// here the plugin is asked by Mozilla to tell if it is scriptable
// we should return a valid interface id and a pointer to
// nsScriptablePeer interface which we should have implemented
// and which should be defined in the corressponding *.xpt file
// in the bin/components folder
NPError NPP_GetValue(NPP instance, NPPVariable variable, void *value)
{
if(instance == NULL)
return NPERR_INVALID_INSTANCE_ERROR;
NPError rv = NPERR_NO_ERROR;
if(instance == NULL)
return NPERR_GENERIC_ERROR;
CAxHost *host = (CAxHost *)instance->pdata;
if(host == NULL)
return NPERR_GENERIC_ERROR;
switch (variable) {
case NPPVpluginNameString:
*((char **)value) = "ITSTActiveX";
break;
case NPPVpluginDescriptionString:
*((char **)value) = "IT Structures ActiveX for Firefox";
break;
case NPPVpluginScriptableNPObject:
*(NPObject **)value = host->GetScriptableObject();
break;
default:
rv = NPERR_GENERIC_ERROR;
}
return rv;
}
NPError NPP_NewStream(NPP instance,
NPMIMEType type,
NPStream* stream,
NPBool seekable,
uint16* stype)
{
if(instance == NULL)
return NPERR_INVALID_INSTANCE_ERROR;
NPError rv = NPERR_NO_ERROR;
return rv;
}
int32_t NPP_WriteReady (NPP instance, NPStream *stream)
{
if(instance == NULL)
return NPERR_INVALID_INSTANCE_ERROR;
int32 rv = 0x0fffffff;
return rv;
}
int32_t NPP_Write (NPP instance, NPStream *stream, int32_t offset, int32_t len, void *buffer)
{
if(instance == NULL)
return NPERR_INVALID_INSTANCE_ERROR;
int32 rv = len;
return rv;
}
NPError NPP_DestroyStream (NPP instance, NPStream *stream, NPError reason)
{
if(instance == NULL)
return NPERR_INVALID_INSTANCE_ERROR;
NPError rv = NPERR_NO_ERROR;
return rv;
}
void NPP_StreamAsFile (NPP instance, NPStream* stream, const char* fname)
{
if(instance == NULL)
return;
}
void NPP_Print (NPP instance, NPPrint* printInfo)
{
if(instance == NULL)
return;
}
void NPP_URLNotify(NPP instance, const char* url, NPReason reason, void* notifyData)
{
if(instance == NULL)
return;
}
NPError NPP_SetValue(NPP instance, NPNVariable variable, void *value)
{
if(instance == NULL)
return NPERR_INVALID_INSTANCE_ERROR;
NPError rv = NPERR_NO_ERROR;
return rv;
}
int16 NPP_HandleEvent(NPP instance, void* event)
{
if(instance == NULL)
return 0;
int16 rv = 0;
CAxHost *host = (CAxHost *)instance->pdata;
if (host)
rv = host->HandleEvent(event);
return rv;
}
NPError OSCALL NP_GetEntryPoints(NPPluginFuncs* pFuncs)
{
if(pFuncs == NULL)
return NPERR_INVALID_FUNCTABLE_ERROR;
if(pFuncs->size < sizeof(NPPluginFuncs))
return NPERR_INVALID_FUNCTABLE_ERROR;
pFuncs->version = (NP_VERSION_MAJOR << 8) | NP_VERSION_MINOR;
pFuncs->newp = NPP_New;
pFuncs->destroy = NPP_Destroy;
pFuncs->setwindow = NPP_SetWindow;
pFuncs->newstream = NPP_NewStream;
pFuncs->destroystream = NPP_DestroyStream;
pFuncs->asfile = NPP_StreamAsFile;
pFuncs->writeready = NPP_WriteReady;
pFuncs->write = NPP_Write;
pFuncs->print = NPP_Print;
pFuncs->event = NPP_HandleEvent;
pFuncs->urlnotify = NPP_URLNotify;
pFuncs->getvalue = NPP_GetValue;
pFuncs->setvalue = NPP_SetValue;
pFuncs->javaClass = NULL;
return NPERR_NO_ERROR;
}
#define MIN(x, y) ((x) < (y)) ? (x) : (y)
/*
* Initialize the plugin. Called the first time the browser comes across a
* MIME Type this plugin is registered to handle.
*/
NPError OSCALL NP_Initialize(NPNetscapeFuncs* pFuncs)
{
// _asm {int 3};
if(pFuncs == NULL)
return NPERR_INVALID_FUNCTABLE_ERROR;
#ifdef NDEF
// The following statements prevented usage of newer Mozilla sources than installed browser at runtime
if(HIBYTE(pFuncs->version) > NP_VERSION_MAJOR)
return NPERR_INCOMPATIBLE_VERSION_ERROR;
if(pFuncs->size < sizeof(NPNetscapeFuncs))
return NPERR_INVALID_FUNCTABLE_ERROR;
#endif
if (!AtlAxWinInit()) {
return NPERR_GENERIC_ERROR;
}
CoInitialize(NULL);
_pAtlModule = &_Module;
memset(&NPNFuncs, 0, sizeof(NPNetscapeFuncs));
memcpy(&NPNFuncs, pFuncs, MIN(pFuncs->size, sizeof(NPNetscapeFuncs)));
return NPERR_NO_ERROR;
}
/*
* Shutdown the plugin. Called when no more instanced of this plugin exist and
* the browser wants to unload it.
*/
NPError OSCALL NP_Shutdown(void)
{
AtlAxWinTerm();
return NPERR_NO_ERROR;
}
| 007slmg-ff | ff-activex-host/ffactivex/dllmain.cpp | C++ | lgpl | 6,973 |
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is itstructures.com code.
*
* The Initial Developer of the Original Code is IT Structures.
* Portions created by the Initial Developer are Copyright (C) 2008
* the Initial Developer. All Rights Reserved.
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#pragma once
void Variant2NPVar(const VARIANT *var, NPVariant *npvar, NPP instance);
void NPVar2Variant(const NPVariant *npvar, VARIANT *var, NPP instance);
BSTR Utf8StringToBstr(LPCSTR szStr, int iSize);
| 007slmg-ff | ff-activex-host/ffactivex/variants.h | C | lgpl | 1,904 |
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is itstructures.com code.
*
* The Initial Developer of the Original Code is IT Structures.
* Portions created by the Initial Developer are Copyright (C) 2008
* the Initial Developer. All Rights Reserved.
*
* Contributor:
* Ruediger Jungbeck <ruediger.jungbeck@rsj.de>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "scriptable.h"
static NPObject*
AllocateScriptable(NPP npp, NPClass *aClass)
{
return new Scriptable();
}
static void
DeallocateScriptable(NPObject *obj)
{
if (!obj) {
return;
}
Scriptable *s = (Scriptable *)obj;
delete s;
}
static void
InvalidateScriptable(NPObject *obj)
{
if (!obj) {
return;
}
((Scriptable *)obj)->Invalidate();
}
NPClass ScriptableNPClass = {
/* version */ NP_CLASS_STRUCT_VERSION,
/* allocate */ AllocateScriptable,
/* deallocate */ DeallocateScriptable,
/* invalidate */ InvalidateScriptable,
/* hasMethod */ Scriptable::_HasMethod,
/* invoke */ Scriptable::_Invoke,
/* invokeDefault */ NULL,
/* hasProperty */ Scriptable::_HasProperty,
/* getProperty */ Scriptable::_GetProperty,
/* setProperty */ Scriptable::_SetProperty,
/* removeProperty */ NULL,
/* enumerate */ NULL,
/* construct */ NULL
};
| 007slmg-ff | ff-activex-host/ffactivex/scriptable.cpp | C++ | lgpl | 2,691 |