Esempio n. 1
0
        public List <PhongBan> ReportDanhSachPhongBan_DoanhSo(int id_phongban, string tungay, string denngay)
        {
            DAC             kn        = new DAC();
            List <PhongBan> phongbans = new List <PhongBan>();
            SqlParameter    pm        = new SqlParameter("@id_phongban", id_phongban);
            SqlParameter    pm2       = new SqlParameter("@tungay", tungay);
            SqlParameter    pm3       = new SqlParameter("@denngay", denngay);


            SqlParameter[] param = new SqlParameter[3] {
                pm, pm2, pm3
            };
            DataTable tb = kn.get_by_procedure("proc_report_DanhSachPB_PO_theodoanhso", param);

            if (tb != null)
            {
                foreach (DataRow row in tb.Rows)
                {
                    PhongBan phongban = new PhongBan();
                    phongban.ID_PhongBan   = Convert.ToInt32(row["ID_PhongBan"]);
                    phongban.Ten_Phong_Ban = row["TenPhongBan"].ToString();
                    // phongban.Ten_Viet_Tat = row["TenVietTat"].ToString();

                    phongbans.Add(phongban);
                }
            }
            return(phongbans);
        }
Esempio n. 2
0
        public List <PhongBan> LayDanhSachPhongBan(int action, int id_phongban, string tenphongban, string tenviettat)
        {
            DAC             kn        = new DAC();
            List <PhongBan> phongbans = new List <PhongBan>();
            SqlParameter    pm        = new SqlParameter("@action", action);
            SqlParameter    pm2       = new SqlParameter("@id", id_phongban);
            SqlParameter    pm3       = new SqlParameter("@tenphongban", tenphongban);
            SqlParameter    pm4       = new SqlParameter("@tenviettat", tenviettat);

            SqlParameter[] param = new SqlParameter[4] {
                pm, pm2, pm3, pm4
            };
            DataTable tb = kn.get_by_procedure("proc_Action_PhongBan", param);

            if (tb != null)
            {
                foreach (DataRow row in tb.Rows)
                {
                    PhongBan phongban = new PhongBan();
                    phongban.ID_PhongBan   = Convert.ToInt16(row["ID"]);
                    phongban.Ten_Phong_Ban = row["TenPhongBan"].ToString();
                    phongban.Ten_Viet_Tat  = row["TenVietTat"].ToString();

                    phongbans.Add(phongban);
                }
            }
            return(phongbans);
        }