コード例 #1
0
    protected void btnTinhLuong_Click(object sender, EventArgs e)
    {
        int t;

        t = TongSoCa(DropMaNV.SelectedValue.ToString(), TxtTuNgay.Text, TxtDenNgay.Text);
        int h;

        h = hesoluong(DropMaNV.SelectedValue.ToString());
        int luong = t * h;

        txtTinhLuong.Text = Convert.ToSingle(luong).ToString();
        if (!IsPostBack)
        {
            DropMaNV.DataSource     = NhanVien();
            DropMaNV.DataTextField  = "TenNV";
            DropMaNV.DataValueField = "MaNV";
            DropMaNV.DataBind();
            DgTinhLuong.DataBind();
            if (DgTinhLuong.Rows.Count > 0)
            {
                DgTinhLuong.HeaderRow.Cells[0].Text = "Mã Nhân Viên ";
                DgTinhLuong.HeaderRow.Cells[1].Text = "Ngày ";
                DgTinhLuong.HeaderRow.Cells[2].Text = "Số Ca ";
            }
        }
    }
コード例 #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     DgTinhLuong.DataSource = dsChamCong();
     DgTinhLuong.DataBind();
     if (!IsPostBack)
     {
         DropMaNV.DataSource     = NhanVien();
         DropMaNV.DataTextField  = "TenNV";
         DropMaNV.DataValueField = "MaNV";
         DropMaNV.DataBind();
         DgTinhLuong.DataBind();
         if (DgTinhLuong.Rows.Count > 0)
         {
             DgTinhLuong.HeaderRow.Cells[0].Text = "Mã Nhân Viên ";
             DgTinhLuong.HeaderRow.Cells[1].Text = "Ngày ";
             DgTinhLuong.HeaderRow.Cells[2].Text = "Số Ca ";
         }
     }
 }
コード例 #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            if (!IsPostBack)
            {
                DropMaMon.DataSource     = ds_LoaiMon();
                DropMaMon.DataTextField  = "TenMon";
                DropMaMon.DataValueField = "MaMon";
                DropMaMon.DataBind();
            }
            if (!IsPostBack)
            {
                DropMaNV.DataSource     = ds_NHANVIEN();
                DropMaNV.DataTextField  = "TenNV";
                DropMaNV.DataValueField = "MaNV";
                DropMaNV.DataBind();
            }
            if (!IsPostBack)
            {
                DropMaBan.DataSource     = dsBan();
                DropMaBan.DataTextField  = "MaBan";
                DropMaBan.DataValueField = "MaBan";
                DropMaBan.DataBind();
            }
        }
        catch { }

        dgPhieu.DataSource = ds_Phieu();
        dgPhieu.DataBind();
        if (!IsPostBack)
        {
            DropMaMon.DataSource     = ds_LoaiMon();
            DropMaMon.DataTextField  = "TenMon";
            DropMaMon.DataValueField = "MaMon";
            DropMaMon.DataBind();


            DropMaNV.DataSource     = ds_NHANVIEN();
            DropMaNV.DataTextField  = "TenNV";
            DropMaNV.DataValueField = "MaNV";
            DropMaNV.DataBind();


            DropMaBan.DataSource     = dsBan();
            DropMaBan.DataTextField  = "MaBan";
            DropMaBan.DataValueField = "MaBan";
            DropMaBan.DataBind();
        }



        if (dgPhieu.Rows.Count > 0)
        {
            dgPhieu.HeaderRow.Cells[0].Text = "Mã Phiếu ";
            dgPhieu.HeaderRow.Cells[1].Text = "Mã Nhân Viên  ";
            dgPhieu.HeaderRow.Cells[2].Text = "Ngày Tạo  ";
            dgPhieu.HeaderRow.Cells[3].Text = "Mã Bàn ";
            dgPhieu.HeaderRow.Cells[4].Text = "Tổng Số Tiền  ";
            dgPhieu.HeaderRow.Cells[5].Text = "Trạng Thái  ";
        }
        string myFileName = String.Format("{0}{1}", DateTime.Now.ToString("dd-MM-yyyy"), "");

        txtNgay.Text = myFileName.ToString();
    }