using ABC.File;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;


namespace ABC.BaoCao
{
    public partial class design : DevExpress.XtraEditors.XtraForm
    {
        public design()
        {
            InitializeComponent();
            data();
        }
        #region lệnh dùng chung
        public void excel()
        {
        }
        public void xoa()
        {
            if (Pow.kiemtra("NCC_Forms", "Xoa", Get_CauHinh.Dt_Login.Rows[0]["ID"].ToString().ToUpper()) == true)
            {
                if (msgbox.dialog_yes_no("Xóa dòng chọn?") == DialogResult.Yes)
                {
                    DataRow[] dr = DuLieu.List_NCC.Tables[0].Select("Select = " + true + "");
                    for (int i = 0; i < dr.Length; i++)
                    {
                        //string sql = "Delete from Tbl_NCC where ID = '" + dr[i]["ID"].ToString().ToUpper() + "'";
                        //_NCC_Class.set(sql);
                    }
                    tailai();
                    data();

                }
            }
        }
        public void sua()
        {
        }
        public void chon()
        {
            for (int i = 0; i < DuLieu.List_NCC.Tables[0].Rows.Count; i++)
            {
                ///DuLieu.List_NCC.Tables[0].Rows[i]["Select"] = true;
            }
            //DuLieu.List_NCC.Tables[0].AcceptChanges();
            //gv.RefreshData();
        }
        public void bochon()
        {
            for (int i = 0; i < DuLieu.List_NCC.Tables[0].Rows.Count; i++)
            {
                //DuLieu.List_NCC.Tables[0].Rows[i]["Select"] = false;
            }
            //DuLieu.List_NCC.Tables[0].AcceptChanges();
            //gv.RefreshData();
        }

        public void tailai()
        {
            //_NCC_Class.get("Select Tbl_NCC.*,Tbl_NhomNCC.Name as _ID1_Name from Tbl_NCC INNER JOIN Tbl_NhomNCC on Tbl_NCC._ID1 = Tbl_NhomNCC.ID order by Tbl_NhomNCC.Name asc, Tbl_NCC.Name ASC");
            //data();
        }
        public void print()
        { 
        }
        public void print_bill()
        {
        }
        #endregion

        #region menu click
        public void event_click()
        {
           
            btn_del.Click += new EventHandler(btn_del_Click);          
            btn_all.Click += new EventHandler(btn_all_Click);
            btn_none.Click += new EventHandler(btn_none_Click);
           // btn_close.Click += new EventHandler(btn_close_Click);
            btn_load.Click += new EventHandler(btn_load_Click);
            btn_in.Click += new EventHandler(btn_in_Click);
            btn_bill.Click += new EventHandler(btn_bill_Click);
        }

        void btn_bill_Click(object sender, EventArgs e)
        {
            print_bill();
        }

        void btn_in_Click(object sender, EventArgs e)
        {
            print();
        }

        void btn_load_Click(object sender, EventArgs e)
        {
            tailai();
        }

        void btn_close_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        void btn_none_Click(object sender, EventArgs e)
        {
            bochon();
        }

        void btn_all_Click(object sender, EventArgs e)
        {
            chon();
        } 

        void btn_del_Click(object sender, EventArgs e)
        {
            xoa();
        }

       


        #endregion

        #region data       
        public void data()
        {

        }
        #endregion

    }
}
