Example #1
0
        private void HienThiChiTiet()
        {
            string macongty   = Session["congty"].ToString();
            string nguoiduyet = Session["UserID"].ToString();
            string maphieu    = Session["maphieu"].ToString();

            pdna        list      = pdnaBUS.LayNoiDungVanBanTheoIDPhieuIDNhanVien(maphieu, nguoiduyet, macongty);
            abill       loaiphieu = abillBUS.SearchAbillByID(list.Abtype);
            BDepartment bp        = BDepartmentDAO.TimMaDonVi(list.pddepid, macongty);
            aABC        douutien  = ABCDAO.TimDoUuTien(int.Parse(list.ABC.ToString()));

            if (douutien != null)
            {
                lblDoUutien.Text = douutien.NameABC + "-" + douutien.NameABCTW;
            }
            Session["mabophan"] = bp.ID;
            Session["bophan"]   = bp.DepName;
            string tenloaiphieuVN = loaiphieu.abname;
            string tenloaiphieuTW = loaiphieu.abnameTW;

            Session["loaiphieu"] = tenloaiphieuVN + " " + tenloaiphieuTW;
            lbLoaiPhieu.Text     = tenloaiphieuVN + " " + tenloaiphieuTW;
            lbBoPhan.Text        = bp.DepName;
            lbSoPhieu.Text       = maphieu;
            lbNoiDung.Text       = list.pdmemovn;
            lblTieuDe.Text       = list.mytitle + "-" + list.pdnsubject;
            lbNoidungdich.Text   = list.NoiDungDich;
            string dinhdang = list.CFMDate0.ToString();
            string thang    = dinhdang.Substring(3, 2);
            string ngay     = dinhdang.Substring(0, 2);
            string nam      = dinhdang.Substring(6, 4);

            lbNgay.Text = "Ngày 日  " + ngay + " Tháng 月 " + thang + " Năm 年 " + nam + "";
        }
Example #2
0
        private void HienThi()
        {
            string idphieu = Session["maphieu"].ToString();
            //string bophan = Session["bophan"].ToString();

            //string noidung = Session["noidung"].ToString();
            //string ngaytao = Session["ngaythang"].ToString();
            string user = Session["user"].ToString();

            string congty = Session["congty"].ToString();

            DataTable dt = dalP.TimPhieuTheoMaNguoiTao(idphieu, congty, user);

            if (dt.Rows.Count > 0)
            {
                string      madonvi        = dt.Rows[0]["pddepid"].ToString();
                string      maloaiphieu    = dt.Rows[0]["Abtype"].ToString();
                int         Abc            = int.Parse(dt.Rows[0]["ABC"].ToString());
                BDepartment bophan         = BDepartmentBUS.TimMaDonVi(madonvi, congty);
                abill       loaiphieu      = abillBUS.SearchAbillByID(maloaiphieu);
                aABC        douutien       = ABCDAO.TimDoUuTien(Abc);
                string      tenloaiphieuVN = loaiphieu.abname;
                string      tenloaiphieuTW = loaiphieu.abnameTW;

                if (douutien != null)
                {
                    lblDoUutien.Text = douutien.NameABC + "-" + douutien.NameABCTW;
                }
                lbLoaiPhieu.Text = tenloaiphieuVN + " " + tenloaiphieuTW;


                lblTieuDe.Text     = dt.Rows[0]["mytitle"].ToString() + " " + dt.Rows[0]["pdnsubject"].ToString();
                lbBoPhan.Text      = bophan.DepName;
                lbSoPhieu.Text     = idphieu;
                lbNoiDung.Text     = dt.Rows[0]["pdmemovn"].ToString();
                LbNoiDungDich.Text = dt.Rows[0]["NoiDungDich"].ToString();
                //lbNgay.Text = phieu.CFMDate0.ToString();
                string dinhdang = dt.Rows[0]["CFMDate0"].ToString();
                string thang    = dinhdang.Substring(3, 2);
                string ngay     = dinhdang.Substring(0, 2);
                string nam      = dinhdang.Substring(6, 4);
                lbNgay.Text = "Ngày 日  " + ngay + " Tháng 月 " + thang + " Năm 年 " + nam + "";
            }
            Busers2 user0 = AbconBUS.LayMaNguoiTaoTheoIDVanBan(idphieu, congty);

            if (user0 != null)
            {
                TextBox1.Text = user0.USERID;
                //ImageLevel0.ImageUrl = users.signatue;
                ImageLevel0.Width    = 100;
                ImageLevel0.Height   = 100;
                ImageLevel0.ImageUrl = "~/MyPhoto.ashx?USERID=" + TextBox1.Text;
            }
        }
Example #3
0
        private void HienThiChiTiet()
        {
            string macongty   = Session["congty"].ToString();
            string nguoiduyet = Session["user"].ToString();
            string maphieu    = Session["maphieu"].ToString();

            //  pdna list = pdnaBUS.LayNoiDungVanBanTheoIDPhieuIDNhanVien(maphieu, nguoiduyet,macongty);
            DataTable dt = dalPDN.TimPhieuTheoMaNguoiDuyet(maphieu, macongty, nguoiduyet);

            if (dt.Rows.Count > 0)
            {
                string      madonvi   = dt.Rows[0]["pddepid"].ToString();
                string      maloaip   = dt.Rows[0]["Abtype"].ToString();
                int         dout      = int.Parse(dt.Rows[0]["ABC"].ToString());
                abill       loaiphieu = abillBUS.SearchAbillByID(maloaip);
                BDepartment bp        = BDepartmentDAO.TimMaDonVi(madonvi, macongty);
                aABC        douutien  = ABCDAO.TimDoUuTien(dout);
                if (douutien != null)
                {
                    lblDoUutien.Text = douutien.NameABC + "-" + douutien.NameABCTW;
                }
                Session["mabophan"] = bp.ID;
                Session["bophan"]   = bp.DepName;
                string tenloaiphieuVN = loaiphieu.abname;
                string tenloaiphieuTW = loaiphieu.abnameTW;
                Session["loaiphieu"] = tenloaiphieuVN + " " + tenloaiphieuTW;
                lbLoaiPhieu.Text     = tenloaiphieuVN + " " + tenloaiphieuTW;
                lbBoPhan.Text        = bp.DepName;
                lbSoPhieu.Text       = maphieu;
                lbNoiDung.Text       = dt.Rows[0]["pdmemovn"].ToString();
                lblTieuDe.Text       = dt.Rows[0]["mytitle"].ToString() + "-" + dt.Rows[0]["pdnsubject"].ToString();
                lbNoidungdich.Text   = dt.Rows[0]["NoiDungDich"].ToString();
                string dinhdang = dt.Rows[0]["CFMDate0"].ToString();
                string thang    = dinhdang.Substring(3, 2);
                string ngay     = dinhdang.Substring(0, 2);
                string nam      = dinhdang.Substring(6, 4);
                lbNgay.Text = "Ngày 日  " + ngay + " Tháng 月 " + thang + " Năm 年 " + nam + "";
            }
        }
Example #4
0
        private void HienThi()
        {
            string nguoiduyet = Session["user"].ToString();
            string maphieu    = Session["maphieu"].ToString();
            //string bophan = Session["bophan"].ToString();

            //string madonvi = Session["mabophan"].ToString();
            string macongty = Session["congty"].ToString();
            // pdna phieu = pdnaBUS.TimVanBanTheoMa(maphieu, macongty, true);
            DataTable dt = dal.TimPhieuTheoMaPhieu(maphieu, macongty);

            if (dt.Rows.Count > 0)
            {
                string      madonvi = dt.Rows[0]["pddepid"].ToString();
                string      maloaip = dt.Rows[0]["Abtype"].ToString();
                int         dout    = int.Parse(dt.Rows[0]["ABC"].ToString());
                pdna        phieucu = pnaDAO.TimPhieuDaTungBiHuy(maphieu, macongty);
                Busers2     users   = UserBUS.TimNhanVienTheoMa(nguoiduyet, macongty);
                BDepartment bp      = BDepartmentDAO.TimMaDonVi(madonvi, macongty);
                Session["bophan"]   = bp.DepName;
                Session["mabophan"] = bp.ID;
                Abcon lydokhongduyet = AbconDAO.LayPhieuKhongDuyetTheoPhieu(madonvi, maloaip, macongty, maphieu);
                abill loaiphieu      = abillBUS.SearchAbillByID(maloaip);
                aABC  douutien       = ABCDAO.TimDoUuTien(dout);
                if (douutien != null)
                {
                    lblDoUutien.Text = douutien.NameABC + "-" + douutien.NameABCTW;
                }
                string tenloaiphieuVN = loaiphieu.abname;
                string tenloaiphieuTW = loaiphieu.abnameTW;
                if (phieucu == null)
                {
                    idofPhieuCu.Visible = false;
                }
                else
                {
                    idofPhieuCu.Visible = true;
                }
                lbLoaiPhieu.Text = tenloaiphieuVN + " " + tenloaiphieuTW;
                if (lydokhongduyet == null)
                {
                    lblLyDo.Visible     = false;
                    lblNhanLyDo.Visible = false;
                }
                else
                {
                    lblLyDo.Visible     = true;
                    lblNhanLyDo.Visible = true;
                    lblLyDo.Text        = lydokhongduyet.lydokhongduyet;
                }
                lblTieuDe.Text = dt.Rows[0]["mytitle"].ToString() + "-" + dt.Rows[0]["pdnsubject"].ToString();
                // string ngay = DateTime.Parse(phieu.CFMDate0.ToShortDateString()).ToString("dd/MM/yyyy");
                txtSoPhieu.Text = maphieu.ToString().Trim();
                string dinhdang = dt.Rows[0]["CFMDate0"].ToString();
                string thang    = dinhdang.Substring(3, 2);
                string ngay     = dinhdang.Substring(0, 2);
                string nam      = dinhdang.Substring(6, 4);
                lblNgaytao.Text       = "Ngày 日  " + ngay + " Tháng 月 " + thang + " Năm 年 " + nam + "";
                lbldonvidenghi.Text   = bp.DepName;
                lbSoPhieu.Text        = maphieu;
                lblMucDichSuDung.Text = dt.Rows[0]["UseIntent"].ToString();
            }
            List <Abcon> listchitietxetduyet = AbconBUS.QryChiTietXetDuyetTheoIdVanBan(maphieu, true);
            // Abcon captruoc = AbconBUS.LayCapDuyetTruocCuaNhanVienTheoVanBan(Until.uNhanVien.USERID, maphieu);

            Busers2 user0 = AbconBUS.LayMaNguoiTaoTheoIDVanBan(maphieu, macongty);

            {
                if (user0 != null)
                {
                    TextBox1.Text        = user0.USERID;
                    ImageLevel0.Width    = 100;
                    ImageLevel0.Height   = 100;
                    ImageLevel0.ImageUrl = "~/MyPhoto.ashx?USERID=" + TextBox1.Text;
                }
                else
                {
                    ImageLevel0.ImageUrl = null;
                }
            }
            //Abcon caphientai = AbconBUS.LayCapDuyetHienTaiCuaNhanVienTheoVanBan(Until.uNhanVien.USERID, maphieu);
            foreach (Abcon abcon in listchitietxetduyet)
            {
                if (abcon == null)
                {
                    ImageLevel1.ImageUrl = null;
                    ImageLevel2.ImageUrl = null;
                    ImageLevel3.ImageUrl = null;
                    ImageLevel4.ImageUrl = null;
                    ImageLevel5.ImageUrl = null;
                    ImageLevel6.ImageUrl = null;

                    return;
                }
                else
                {
                    List <Abcon> lstChiTietXetDuyet1 = AbconBUS.QryChiTietXetDuyetTheoMaVanBanNguoiTrinhDuyet(maphieu, macongty);
                    int          max = (from ct1 in lstChiTietXetDuyet1
                                        select ct1.Abstep).Max();

                    if (abcon.IDCapDuyet == 5 || abcon.IDCapDuyet == 6)
                    {
                        Busers2 nguoiduyet1 = UserBUS.TimNhanVienTheoMa(abcon.Auditor, macongty);
                        //ChucVu chuc = ChucVuBUS.TimMaChucVu(nguoiduyet6.IDChucVu, macongty);
                        if (abcon.abrult == true && abcon.Yn == 1)
                        {
                            TextBox2.Text        = nguoiduyet1.USERID;
                            ImageLevel1.Width    = 100;
                            ImageLevel1.Height   = 100;
                            ImageLevel1.ImageUrl = "~/ProcessSignature/MyPhoto1.ashx?USERID=" + TextBox2.Text;
                        }
                        else
                        {
                            if (abcon.Yn == 2)
                            {
                                Abcon khongduyet = AbconDAO.LayPhieuKhongDuyetTheoNguoiDuyet(maphieu, abcon.Auditor, macongty);
                                if (khongduyet != null)
                                {
                                    lblLyDo.Visible = true;
                                    lblLyDo.Text    = khongduyet.lydokhongduyet;
                                }

                                TextBox2.Text        = nguoiduyet1.USERID;
                                txtKhongDuyet.Text   = "027276";
                                ImageLevel1.Width    = 100;
                                ImageLevel1.Height   = 100;
                                ImageLevel1.ImageUrl = "~/ProcessSignature/MyPhotoKhongDuyet.ashx?USERID=" + txtKhongDuyet.Text;
                            }
                            else
                            {
                                ImageLevel1.ImageUrl = null;
                            }
                        }
                    }
                    if (abcon.IDCapDuyet == 7)
                    {
                        if (capduyet == null)
                        {
                            Busers2 nguoiduyet2 = UserBUS.TimNhanVienTheoMa(abcon.Auditor, macongty);
                            if (abcon.abrult == true && abcon.Yn == 1)
                            {
                                TextBox3.Text   = nguoiduyet2.USERID;
                                Image1.Width    = 100;
                                Image1.Height   = 100;
                                Image1.ImageUrl = "~/ProcessSignature/MyPhoto8.ashx?USERID=" + TextBox3.Text;
                            }
                            else
                            {
                                if (abcon.Yn == 2)
                                {
                                    Abcon khongduyet = AbconDAO.LayPhieuKhongDuyetTheoNguoiDuyet(maphieu, abcon.Auditor, macongty);
                                    if (khongduyet != null)
                                    {
                                        lblLyDo.Visible = true;
                                        lblLyDo.Text    = khongduyet.lydokhongduyet;
                                    }

                                    TextBox3.Text      = nguoiduyet2.USERID;
                                    txtKhongDuyet.Text = "027276";
                                    Image1.Width       = 100;
                                    Image1.Height      = 100;
                                    Image1.ImageUrl    = "~/ProcessSignature/MyPhotoKhongDuyet.ashx?USERID=" + txtKhongDuyet.Text;
                                }
                                else
                                {
                                    Image1.ImageUrl = null;
                                }
                            }
                            capduyet = abcon.IDCapDuyet.ToString();
                        }
                        else
                        {
                            Busers2 nguoiduyet2 = UserBUS.TimNhanVienTheoMa(abcon.Auditor, macongty);
                            if (abcon.abrult == true && abcon.Yn == 1)
                            {
                                TextBox4.Text        = nguoiduyet2.USERID;
                                ImageLevel2.Width    = 100;
                                ImageLevel2.Height   = 100;
                                ImageLevel2.ImageUrl = "~/ProcessSignature/MyPhoto2.ashx?USERID=" + TextBox4.Text;
                            }
                            else
                            {
                                if (abcon.Yn == 2)
                                {
                                    Abcon khongduyet = AbconDAO.LayPhieuKhongDuyetTheoNguoiDuyet(maphieu, abcon.Auditor, macongty);
                                    if (khongduyet != null)
                                    {
                                        lblLyDo.Visible = true;
                                        lblLyDo.Text    = khongduyet.lydokhongduyet;
                                    }

                                    txtKhongDuyet.Text   = "027276";
                                    TextBox4.Text        = nguoiduyet2.USERID;
                                    ImageLevel2.Width    = 100;
                                    ImageLevel2.Height   = 100;
                                    ImageLevel2.ImageUrl = "~/ProcessSignature/MyPhotoKhongDuyet.ashx?USERID=" + txtKhongDuyet.Text;
                                }
                                else
                                {
                                    ImageLevel2.ImageUrl = null;
                                }
                            }
                        }
                    }
                    if (abcon.IDCapDuyet == 9)
                    {
                        Busers2 nguoiduyet3 = UserBUS.TimNhanVienTheoMa(abcon.Auditor, macongty);
                        ChucVu  chuc        = ChucVuBUS.TimMaChucVu(nguoiduyet3.IDChucVu, macongty);
                        if (abcon.abrult == true && abcon.Yn == 1)
                        {
                            TextBox5.Text        = nguoiduyet3.USERID;
                            ImageLevel3.Width    = 100;
                            ImageLevel3.Height   = 100;
                            ImageLevel3.ImageUrl = "~/ProcessSignature/MyPhoto3.ashx?USERID=" + TextBox5.Text;
                        }
                        else
                        {
                            if (abcon.Yn == 2)
                            {
                                Abcon khongduyet = AbconDAO.LayPhieuKhongDuyetTheoNguoiDuyet(maphieu, abcon.Auditor, macongty);
                                if (khongduyet != null)
                                {
                                    lblLyDo.Visible = true;
                                    lblLyDo.Text    = khongduyet.lydokhongduyet;
                                }

                                TextBox5.Text        = nguoiduyet3.USERID;
                                txtKhongDuyet.Text   = "027276";
                                ImageLevel3.Width    = 100;
                                ImageLevel3.Height   = 100;
                                ImageLevel3.ImageUrl = "~/ProcessSignature/MyPhotoKhongDuyet.ashx?USERID=" + txtKhongDuyet.Text;
                            }
                            else
                            {
                                ImageLevel3.ImageUrl = null;
                            }
                        }
                    }
                    if (abcon.IDCapDuyet == 13)
                    {
                        Busers2 nguoiduyet4 = UserBUS.TimNhanVienTheoMa(abcon.Auditor, macongty);
                        ChucVu  chuc        = ChucVuBUS.TimMaChucVu(nguoiduyet4.IDChucVu, macongty);
                        if (abcon.abrult == true && abcon.Yn == 1)
                        {
                            TextBox6.Text        = nguoiduyet4.USERID;
                            ImageLevel4.Width    = 100;
                            ImageLevel4.Height   = 100;
                            ImageLevel4.ImageUrl = "~/ProcessSignature/MyPhoto4.ashx?USERID=" + TextBox6.Text;
                        }
                        else
                        {
                            if (abcon.Yn == 2)
                            {
                                Abcon khongduyet = AbconDAO.LayPhieuKhongDuyetTheoNguoiDuyet(maphieu, abcon.Auditor, macongty);
                                if (khongduyet != null)
                                {
                                    lblLyDo.Visible = true;
                                    lblLyDo.Text    = khongduyet.lydokhongduyet;
                                }

                                TextBox6.Text        = nguoiduyet4.USERID;
                                txtKhongDuyet.Text   = "027276";
                                ImageLevel4.Width    = 100;
                                ImageLevel4.Height   = 100;
                                ImageLevel4.ImageUrl = "~/ProcessSignature/MyPhotoKhongDuyet.ashx?USERID=" + txtKhongDuyet.Text;
                            }
                            else
                            {
                                ImageLevel4.ImageUrl = null;
                            }
                        }
                    }
                    if (abcon.IDCapDuyet == 15 || abcon.IDCapDuyet == 14)
                    {
                        Busers2 nguoiduyet5 = UserBUS.TimNhanVienTheoMa(abcon.Auditor, macongty);
                        ChucVu  chuc        = ChucVuBUS.TimMaChucVu(nguoiduyet5.IDChucVu, macongty);
                        if (abcon.abrult == true && abcon.Yn == 1)
                        {
                            TextBox7.Text        = nguoiduyet5.USERID;
                            ImageLevel5.Width    = 100;
                            ImageLevel5.Height   = 100;
                            ImageLevel5.ImageUrl = "~/ProcessSignature/MyPhoto5.ashx?USERID=" + TextBox7.Text;
                        }
                        else
                        {
                            if (abcon.Yn == 2)
                            {
                                Abcon khongduyet = AbconDAO.LayPhieuKhongDuyetTheoNguoiDuyet(maphieu, abcon.Auditor, macongty);
                                if (khongduyet != null)
                                {
                                    lblLyDo.Visible = true;
                                    lblLyDo.Text    = khongduyet.lydokhongduyet;
                                }

                                txtKhongDuyet.Text   = "027276";
                                TextBox7.Text        = nguoiduyet5.USERID;
                                ImageLevel5.Width    = 100;
                                ImageLevel5.Height   = 100;
                                ImageLevel5.ImageUrl = "~/ProcessSignature/MyPhotoKhongDuyet.ashx?USERID=" + txtKhongDuyet.Text;
                            }
                            else
                            {
                                ImageLevel5.ImageUrl = null;
                            }
                        }
                    }
                    if (abcon.IDCapDuyet == 16)
                    {
                        Busers2 nguoiduyet6 = UserBUS.TimNhanVienTheoMa(abcon.Auditor, macongty);
                        ChucVu  chuc        = ChucVuBUS.TimMaChucVu(nguoiduyet6.IDChucVu, macongty);
                        if (abcon.abrult == true && abcon.Yn == 1)
                        {
                            TextBox8.Text        = nguoiduyet6.USERID;
                            ImageLevel6.Width    = 100;
                            ImageLevel6.Height   = 100;
                            ImageLevel6.ImageUrl = "~/ProcessSignature/MyPhoto6.ashx?USERID=" + TextBox8.Text;
                        }
                        else
                        {
                            if (abcon.Yn == 2)
                            {
                                Abcon khongduyet = AbconDAO.LayPhieuKhongDuyetTheoNguoiDuyet(maphieu, abcon.Auditor, macongty);
                                if (khongduyet != null)
                                {
                                    lblLyDo.Visible = true;
                                    lblLyDo.Text    = khongduyet.lydokhongduyet;
                                }

                                TextBox8.Text        = nguoiduyet6.USERID;
                                txtKhongDuyet.Text   = "027276";
                                ImageLevel6.Width    = 100;
                                ImageLevel6.Height   = 100;
                                ImageLevel6.ImageUrl = "~/ProcessSignature/MyPhotoKhongDuyet.ashx?USERID=" + txtKhongDuyet.Text;
                            }
                            else
                            {
                                ImageLevel6.ImageUrl = null;
                            }
                        }
                    }

                    else if (abcon.IDCapDuyet == 17)
                    {
                        Busers2 nguoiduyet7 = UserBUS.TimNhanVienTheoMa(abcon.Auditor, macongty);
                        ChucVu  chuc        = ChucVuBUS.TimMaChucVu(nguoiduyet7.IDChucVu, macongty);

                        if (abcon.abrult == true && abcon.Yn == 1)
                        {
                            TextBox9.Text        = nguoiduyet7.USERID;
                            ImageLevel7.Width    = 100;
                            ImageLevel7.Height   = 100;
                            ImageLevel7.ImageUrl = "~/ProcessSignature/MyPhoto7.ashx?USERID=" + TextBox9.Text;
                        }
                        else
                        {
                            if (abcon.Yn == 2)
                            {
                                Abcon khongduyet = AbconDAO.LayPhieuKhongDuyetTheoNguoiDuyet(maphieu, abcon.Auditor, macongty);
                                if (khongduyet != null)
                                {
                                    lblLyDo.Visible = true;
                                    lblLyDo.Text    = khongduyet.lydokhongduyet;
                                }

                                TextBox9.Text        = nguoiduyet7.USERID;
                                txtKhongDuyet.Text   = "027276";
                                ImageLevel7.Width    = 100;
                                ImageLevel7.Height   = 100;
                                ImageLevel7.ImageUrl = "~/ProcessSignature/MyPhotoKhongDuyet.ashx?USERID=" + txtKhongDuyet.Text;
                            }
                            else
                            {
                                ImageLevel7.ImageUrl = null;
                            }
                        }
                    }
                }
            }
        }
Example #5
0
        private void HienThi()
        {
            // string nguoiduyet = Session["user"].ToString();
            string maphieu = Session["maphieu"].ToString();

            // string tenloaiphieu = Session["tenloaiphieu"].ToString();
            string macongty    = Session["congty"].ToString();
            string manguoidung = Session["user"].ToString();
            //string madonvi = Session["mabophan"].ToString();
            //var list = pdnaBUS.LayNoiDungVanBanTheoIDPhieuIDNhanVien(maphieu, nguoiduyet);
            pdna        chitietduyet   = pnaDAO.LayPhieuTheoNguoiGui(maphieu, manguoidung, macongty);
            Busers2     users          = UserBUS.TimNhanVienTheoMa(manguoidung, macongty);
            BDepartment timbophan      = BDepartmentDAO.TimMaDonVi(chitietduyet.pddepid, macongty);
            Abcon       lydokhongduyet = AbconDAO.LayPhieuKhongDuyetTheoPhieu(timbophan.ID, chitietduyet.Abtype, macongty, maphieu);
            abill       loaiphieu      = abillBUS.SearchAbillByID(chitietduyet.Abtype);
            aABC        douutien       = ABCDAO.TimDoUuTien(int.Parse(chitietduyet.ABC.ToString()));

            if (douutien != null)
            {
                lblDoUutien.Text = douutien.NameABC + "-" + douutien.NameABCTW;
            }
            string tenloaiphieuVN = loaiphieu.abname;
            string tenloaiphieuTW = loaiphieu.abnameTW;

            lbLoaiPhieu.Text = tenloaiphieuVN + " " + tenloaiphieuTW;
            if (lydokhongduyet == null)
            {
                lblLyDo.Visible     = false;
                lblNhanLyDo.Visible = false;
            }
            else
            {
                lblLyDo.Visible     = true;
                lblNhanLyDo.Visible = true;
                lblLyDo.Text        = lydokhongduyet.lydokhongduyet;
            }
            txtSoPhieu.Text    = maphieu.ToString().Trim();
            lbBoPhan.Text      = timbophan.DepName;
            lbSoPhieu.Text     = maphieu;
            lbNoiDung.Text     = chitietduyet.pdmemovn;
            LbNoiDungDich.Text = chitietduyet.NoiDungDich;
            lblTieuDe.Text     = chitietduyet.mytitle + chitietduyet.pdnsubject;
            string dinhdang = chitietduyet.CFMDate0.ToString();
            string thang    = dinhdang.Substring(3, 2);
            string ngay     = dinhdang.Substring(0, 2);
            string nam      = dinhdang.Substring(6, 4);

            lbNgay.Text = "Ngày 日  " + ngay + " Tháng 月 " + thang + " Năm 年 " + nam + "";

            //Abcon abcon6 = AbconBUS.LaymaVanBanTheoCapDuyet6(maphieu, 6);
            List <Abcon> listchitietxetduyet = AbconBUS.QryChiTietXetDuyetTheoIdVanBan(maphieu, true);
            // Abcon captruoc = AbconBUS.LayCapDuyetTruocCuaNhanVienTheoVanBan(Until.uNhanVien.USERID, maphieu);

            Busers2 user0 = AbconBUS.LayMaNguoiTaoTheoIDVanBan(maphieu, macongty);

            {
                if (user0 != null)
                {
                    TextBox1.Text        = user0.USERID;
                    ImageLevel0.Width    = 100;
                    ImageLevel0.Height   = 100;
                    ImageLevel0.ImageUrl = "~/MyPhoto.ashx?USERID=" + TextBox1.Text;
                }
                else
                {
                    ImageLevel0.ImageUrl = null;
                }
            }
            //Abcon caphientai = AbconBUS.LayCapDuyetHienTaiCuaNhanVienTheoVanBan(Until.uNhanVien.USERID, maphieu);
            foreach (Abcon abcon in listchitietxetduyet)
            {
                if (abcon == null)
                {
                    ImageLevel1.ImageUrl = null;
                    ImageLevel2.ImageUrl = null;
                    ImageLevel3.ImageUrl = null;
                    ImageLevel4.ImageUrl = null;
                    ImageLevel5.ImageUrl = null;
                    ImageLevel6.ImageUrl = null;

                    return;
                }
                else
                {
                    List <Abcon> lstChiTietXetDuyet1 = AbconBUS.QryChiTietXetDuyetTheoMaVanBanNguoiTrinhDuyet(maphieu, macongty);
                    int          max = (from ct1 in lstChiTietXetDuyet1
                                        select ct1.Abstep).Max();

                    if (abcon.IDCapDuyet == 5 || abcon.IDCapDuyet == 6)
                    {
                        Busers2 nguoiduyet1 = UserBUS.TimNhanVienTheoMa(abcon.Auditor, macongty);
                        //ChucVu chuc = ChucVuBUS.TimMaChucVu(nguoiduyet6.IDChucVu, macongty);
                        if (abcon.abrult == true && abcon.Yn == 1)
                        {
                            TextBox2.Text        = nguoiduyet1.USERID;
                            ImageLevel1.Width    = 100;
                            ImageLevel1.Height   = 100;
                            ImageLevel1.ImageUrl = "~/ProcessSignature/MyPhoto1.ashx?USERID=" + TextBox2.Text;
                        }
                        else
                        {
                            if (abcon.Yn == 2)
                            {
                                Abcon khongduyet = AbconDAO.LayPhieuKhongDuyetTheoNguoiDuyet(maphieu, abcon.Auditor, macongty);
                                if (khongduyet != null)
                                {
                                    lblLyDo.Visible = true;
                                    lblLyDo.Text    = khongduyet.lydokhongduyet;
                                }

                                TextBox2.Text        = nguoiduyet1.USERID;
                                txtKhongDuyet.Text   = "027276";
                                ImageLevel1.Width    = 100;
                                ImageLevel1.Height   = 100;
                                ImageLevel1.ImageUrl = "~/ProcessSignature/MyPhotoKhongDuyet.ashx?USERID=" + txtKhongDuyet.Text;
                            }
                            else
                            {
                                ImageLevel1.ImageUrl = null;
                            }
                        }
                    }
                    if (abcon.IDCapDuyet == 7)
                    {
                        if (capduyet == null)
                        {
                            Busers2 nguoiduyet2 = UserBUS.TimNhanVienTheoMa(abcon.Auditor, macongty);
                            if (abcon.abrult == true && abcon.Yn == 1)
                            {
                                TextBox3.Text   = nguoiduyet2.USERID;
                                Image1.Width    = 100;
                                Image1.Height   = 100;
                                Image1.ImageUrl = "~/ProcessSignature/MyPhoto8.ashx?USERID=" + TextBox3.Text;
                            }
                            else
                            {
                                if (abcon.Yn == 2)
                                {
                                    Abcon khongduyet = AbconDAO.LayPhieuKhongDuyetTheoNguoiDuyet(maphieu, abcon.Auditor, macongty);
                                    if (khongduyet != null)
                                    {
                                        lblLyDo.Visible = true;
                                        lblLyDo.Text    = khongduyet.lydokhongduyet;
                                    }

                                    TextBox3.Text      = nguoiduyet2.USERID;
                                    txtKhongDuyet.Text = "027276";
                                    Image1.Width       = 100;
                                    Image1.Height      = 100;
                                    Image1.ImageUrl    = "~/ProcessSignature/MyPhotoKhongDuyet.ashx?USERID=" + txtKhongDuyet.Text;
                                }
                                else
                                {
                                    Image1.ImageUrl = null;
                                }
                            }
                            capduyet = abcon.IDCapDuyet.ToString();
                        }
                        else
                        {
                            Busers2 nguoiduyet2 = UserBUS.TimNhanVienTheoMa(abcon.Auditor, macongty);
                            if (abcon.abrult == true && abcon.Yn == 1)
                            {
                                TextBox4.Text        = nguoiduyet2.USERID;
                                ImageLevel2.Width    = 100;
                                ImageLevel2.Height   = 100;
                                ImageLevel2.ImageUrl = "~/ProcessSignature/MyPhoto2.ashx?USERID=" + TextBox4.Text;
                            }
                            else
                            {
                                if (abcon.Yn == 2)
                                {
                                    Abcon khongduyet = AbconDAO.LayPhieuKhongDuyetTheoNguoiDuyet(maphieu, abcon.Auditor, macongty);
                                    if (khongduyet != null)
                                    {
                                        lblLyDo.Visible = true;
                                        lblLyDo.Text    = khongduyet.lydokhongduyet;
                                    }

                                    txtKhongDuyet.Text   = "027276";
                                    TextBox4.Text        = nguoiduyet2.USERID;
                                    ImageLevel2.Width    = 100;
                                    ImageLevel2.Height   = 100;
                                    ImageLevel2.ImageUrl = "~/ProcessSignature/MyPhotoKhongDuyet.ashx?USERID=" + txtKhongDuyet.Text;
                                }
                                else
                                {
                                    ImageLevel2.ImageUrl = null;
                                }
                            }
                        }
                    }
                    if (abcon.IDCapDuyet == 9)
                    {
                        Busers2 nguoiduyet3 = UserBUS.TimNhanVienTheoMa(abcon.Auditor, macongty);
                        ChucVu  chuc        = ChucVuBUS.TimMaChucVu(nguoiduyet3.IDChucVu, macongty);
                        if (abcon.abrult == true && abcon.Yn == 1)
                        {
                            TextBox5.Text        = nguoiduyet3.USERID;
                            ImageLevel3.Width    = 100;
                            ImageLevel3.Height   = 100;
                            ImageLevel3.ImageUrl = "~/ProcessSignature/MyPhoto3.ashx?USERID=" + TextBox5.Text;
                        }
                        else
                        {
                            if (abcon.Yn == 2)
                            {
                                Abcon khongduyet = AbconDAO.LayPhieuKhongDuyetTheoNguoiDuyet(maphieu, abcon.Auditor, macongty);
                                if (khongduyet != null)
                                {
                                    lblLyDo.Visible = true;
                                    lblLyDo.Text    = khongduyet.lydokhongduyet;
                                }

                                TextBox5.Text        = nguoiduyet3.USERID;
                                txtKhongDuyet.Text   = "027276";
                                ImageLevel3.Width    = 100;
                                ImageLevel3.Height   = 100;
                                ImageLevel3.ImageUrl = "~/ProcessSignature/MyPhotoKhongDuyet.ashx?USERID=" + txtKhongDuyet.Text;
                            }
                            else
                            {
                                ImageLevel3.ImageUrl = null;
                            }
                        }
                    }
                    if (abcon.IDCapDuyet == 13)
                    {
                        Busers2 nguoiduyet4 = UserBUS.TimNhanVienTheoMa(abcon.Auditor, macongty);
                        ChucVu  chuc        = ChucVuBUS.TimMaChucVu(nguoiduyet4.IDChucVu, macongty);
                        if (abcon.abrult == true && abcon.Yn == 1)
                        {
                            TextBox6.Text        = nguoiduyet4.USERID;
                            ImageLevel4.Width    = 100;
                            ImageLevel4.Height   = 100;
                            ImageLevel4.ImageUrl = "~/ProcessSignature/MyPhoto4.ashx?USERID=" + TextBox6.Text;
                        }
                        else
                        {
                            if (abcon.Yn == 2)
                            {
                                Abcon khongduyet = AbconDAO.LayPhieuKhongDuyetTheoNguoiDuyet(maphieu, abcon.Auditor, macongty);
                                if (khongduyet != null)
                                {
                                    lblLyDo.Visible = true;
                                    lblLyDo.Text    = khongduyet.lydokhongduyet;
                                }

                                TextBox6.Text        = nguoiduyet4.USERID;
                                txtKhongDuyet.Text   = "027276";
                                ImageLevel4.Width    = 100;
                                ImageLevel4.Height   = 100;
                                ImageLevel4.ImageUrl = "~/ProcessSignature/MyPhotoKhongDuyet.ashx?USERID=" + txtKhongDuyet.Text;
                            }
                            else
                            {
                                ImageLevel4.ImageUrl = null;
                            }
                        }
                    }
                    if (abcon.IDCapDuyet == 15 || abcon.IDCapDuyet == 14)
                    {
                        Busers2 nguoiduyet5 = UserBUS.TimNhanVienTheoMa(abcon.Auditor, macongty);
                        ChucVu  chuc        = ChucVuBUS.TimMaChucVu(nguoiduyet5.IDChucVu, macongty);
                        if (abcon.abrult == true && abcon.Yn == 1)
                        {
                            TextBox7.Text        = nguoiduyet5.USERID;
                            ImageLevel5.Width    = 100;
                            ImageLevel5.Height   = 100;
                            ImageLevel5.ImageUrl = "~/ProcessSignature/MyPhoto5.ashx?USERID=" + TextBox7.Text;
                        }
                        else
                        {
                            if (abcon.Yn == 2)
                            {
                                Abcon khongduyet = AbconDAO.LayPhieuKhongDuyetTheoNguoiDuyet(maphieu, abcon.Auditor, macongty);
                                if (khongduyet != null)
                                {
                                    lblLyDo.Visible = true;
                                    lblLyDo.Text    = khongduyet.lydokhongduyet;
                                }

                                txtKhongDuyet.Text   = "027276";
                                TextBox7.Text        = nguoiduyet5.USERID;
                                ImageLevel5.Width    = 100;
                                ImageLevel5.Height   = 100;
                                ImageLevel5.ImageUrl = "~/ProcessSignature/MyPhotoKhongDuyet.ashx?USERID=" + txtKhongDuyet.Text;
                            }
                            else
                            {
                                ImageLevel5.ImageUrl = null;
                            }
                        }
                    }
                    if (abcon.IDCapDuyet == 16)
                    {
                        Busers2 nguoiduyet6 = UserBUS.TimNhanVienTheoMa(abcon.Auditor, macongty);
                        ChucVu  chuc        = ChucVuBUS.TimMaChucVu(nguoiduyet6.IDChucVu, macongty);
                        if (abcon.abrult == true && abcon.Yn == 1)
                        {
                            TextBox8.Text        = nguoiduyet6.USERID;
                            ImageLevel6.Width    = 100;
                            ImageLevel6.Height   = 100;
                            ImageLevel6.ImageUrl = "~/ProcessSignature/MyPhoto6.ashx?USERID=" + TextBox8.Text;
                        }
                        else
                        {
                            if (abcon.Yn == 2)
                            {
                                Abcon khongduyet = AbconDAO.LayPhieuKhongDuyetTheoNguoiDuyet(maphieu, abcon.Auditor, macongty);
                                if (khongduyet != null)
                                {
                                    lblLyDo.Visible = true;
                                    lblLyDo.Text    = khongduyet.lydokhongduyet;
                                }

                                TextBox8.Text        = nguoiduyet6.USERID;
                                txtKhongDuyet.Text   = "027276";
                                ImageLevel6.Width    = 100;
                                ImageLevel6.Height   = 100;
                                ImageLevel6.ImageUrl = "~/ProcessSignature/MyPhotoKhongDuyet.ashx?USERID=" + txtKhongDuyet.Text;
                            }
                            else
                            {
                                ImageLevel6.ImageUrl = null;
                            }
                        }
                    }

                    else if (abcon.IDCapDuyet == 17)
                    {
                        Busers2 nguoiduyet7 = UserBUS.TimNhanVienTheoMa(abcon.Auditor, macongty);
                        ChucVu  chuc        = ChucVuBUS.TimMaChucVu(nguoiduyet7.IDChucVu, macongty);

                        if (abcon.abrult == true && abcon.Yn == 1)
                        {
                            TextBox9.Text        = nguoiduyet7.USERID;
                            ImageLevel7.Width    = 100;
                            ImageLevel7.Height   = 100;
                            ImageLevel7.ImageUrl = "~/ProcessSignature/MyPhoto7.ashx?USERID=" + TextBox9.Text;
                        }
                        else
                        {
                            if (abcon.Yn == 2)
                            {
                                Abcon khongduyet = AbconDAO.LayPhieuKhongDuyetTheoNguoiDuyet(maphieu, abcon.Auditor, macongty);
                                if (khongduyet != null)
                                {
                                    lblLyDo.Visible = true;
                                    lblLyDo.Text    = khongduyet.lydokhongduyet;
                                }

                                TextBox9.Text        = nguoiduyet7.USERID;
                                txtKhongDuyet.Text   = "027276";
                                ImageLevel7.Width    = 100;
                                ImageLevel7.Height   = 100;
                                ImageLevel7.ImageUrl = "~/ProcessSignature/MyPhotoKhongDuyet.ashx?USERID=" + txtKhongDuyet.Text;
                            }
                            else
                            {
                                ImageLevel7.ImageUrl = null;
                            }
                        }
                    }
                }
            }
        }