private void HienThi()
        {
            string nguoiduyet = Session["user"].ToString();
            string maphieu    = Session["maphieu"].ToString();


            string macongty = Session["congty"].ToString();
            //string madonvi = Session["mabophan"].ToString();
            pdna        chitietduyet   = pnaDAO.LayPhieuTheoNguoiGui(maphieu, nguoiduyet, macongty);
            BDepartment timbophan      = BDepartmentDAO.TimMaDonVi(chitietduyet.pddepid, macongty);
            Busers2     users          = UserBUS.TimNhanVienTheoMa(nguoiduyet, macongty);
            Abcon       lydokhongduyet = AbconDAO.LayPhieuKhongDuyetTheoPhieu(timbophan.ID, chitietduyet.Abtype, macongty, maphieu);

            if (lydokhongduyet == null)
            {
                lblLyDo.Visible     = false;
                lblNhanLyDo.Visible = false;
            }
            else
            {
                lblLyDo.Visible     = true;
                lblNhanLyDo.Visible = true;
                lblLyDo.Text        = lydokhongduyet.lydokhongduyet;
            }
            abill  loaiphieu      = abillBUS.SearchAbillByID(chitietduyet.Abtype);
            string tenloaiphieuVN = loaiphieu.abname;
            string tenloaiphieuTW = loaiphieu.abnameTW;

            lbLoaiPhieu.Text      = tenloaiphieuVN + " " + tenloaiphieuTW;
            lbldonvidenghi.Text   = timbophan.DepName;
            lbSoPhieu.Text        = maphieu;
            txtSoPhieu.Text       = maphieu.ToString().Trim();
            lblMucDichSuDung.Text = chitietduyet.UseIntent;
            lblTieuDe.Text        = chitietduyet.mytitle + chitietduyet.pdnsubject;
            // lbNgay.Text = chitietduyet.CFMDate0.ToString();
            string dinhdang = chitietduyet.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 + "";
            //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;
                            }
                        }
                    }
                }
            }
        }
Esempio n. 2
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;
                            }
                        }
                    }
                }
            }
        }
        private void HienThi()
        {
            string maphieu = Session["maphieu"].ToString();

            string macongty    = Session["congty"].ToString();
            string manguoidung = Session["user"].ToString();
            //pdna phieu = pnaDAO.TimKiemVanBanTheoMaNguoiTaoCongTy(maphieu, manguoidung, macongty, true);
            DataTable dt = dalP.TimPhieuTheoMaNguoiTao(maphieu, macongty, manguoidung);

            if (dt.Rows.Count > 0)
            {
                string      ngaythang   = dt.Rows[0]["CFMDate0"].ToString();
                string      madonvi     = dt.Rows[0]["pddepid"].ToString().Trim();
                string      maloaiphieu = dt.Rows[0]["Abtype"].ToString().Trim();
                string      noidung     = dt.Rows[0]["pdmemovn"].ToString().Trim();
                string      tieude      = dt.Rows[0]["mytitle"].ToString().Trim();
                string      tieudedich  = dt.Rows[0]["pdnsubject"].ToString().Trim();
                string      noidungdich = dt.Rows[0]["NoiDungDich"].ToString();
                int         Yn          = int.Parse(dt.Rows[0]["Yn"].ToString());
                BDepartment bophan      = BDepartmentDAO.TimMaDonVi(madonvi, macongty);
                abill       loaiphieu   = abillDAO.SearchAbillByID(maloaiphieu);
                Busers2     users       = UserBUS.TimNhanVienTheoMa(manguoidung, macongty);
                aABC        douutien    = ABCDAO.TimDoUuTien(int.Parse(dt.Rows[0]["ABC"].ToString()));
                if (douutien != null)
                {
                    lblDoUutien.Text = douutien.NameABC + "-" + douutien.NameABCTW;
                }
                string tenloaiphieuVN = loaiphieu.abname;
                string tenloaiphieuTW = loaiphieu.abnameTW;

                lbLoaiPhieu.Text   = tenloaiphieuVN + " " + tenloaiphieuTW;
                lblTieuDe.Text     = tieude + " " + tieudedich;
                lbBoPhan.Text      = bophan.DepName;
                lbSoPhieu.Text     = maphieu;
                lbNoiDung.Text     = noidung;
                LbNoiDungDich.Text = noidungdich;
                txtSoPhieu.Text    = maphieu.ToString().Trim();
                string dinhdang = ngaythang;
                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 timphieuchuaduyet = AbconDAO.TimPhieuChuaDuyet(maphieu, macongty);
                if (timphieuchuaduyet == null)
                {
                    btnHuy.Enabled = true;
                }
                else
                {
                    btnHuy.Enabled = false;
                }
            }

            //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;
                            }
                        }
                    }
                }
            }
        }
Esempio n. 4
0
        private void HienThi()
        {
            string nguoiduyet = Session["user"].ToString();
            string maphieu    = Session["maphieu"].ToString();
            //string bophan = Session["bophan"].ToString();
            //string loaiphieu = Session["loaiphieu"].ToString();
            string      macongty = Session["congty"].ToString();
            pdna        phieu    = pdnaBUS.TimVanBanTheoMa(maphieu, macongty, true);
            Busers2     users    = UserBUS.TimNhanVienTheoMa(nguoiduyet, macongty);
            BDepartment bp       = BDepartmentDAO.TimMaDonVi(phieu.pddepid, macongty);

            Session["mabophan"] = bp.ID;
            Session["bophan"]   = bp.DepName;
            lbBoPhan.Text       = bp.DepName;
            lbSoPhieu.Text      = maphieu;
            lbNoiDung.Text      = phieu.pdmemovn;
            lbNoidungdich.Text  = phieu.NoiDungDich;
            //lbLoaiPhieu.Text = loaiphieu;
            // lbNgay.Text = phieu.CFMDate0.ToString();
            txtSoPhieu.Text = maphieu.ToString().Trim();
            string dinhdang = phieu.CFMDate0.ToString();
            string ngay     = dinhdang.Substring(3, 2);
            string thang    = 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)
                            {
                                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)
                                {
                                    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)
                            {
                                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;
                            }
                        }
                    }
                }
            }
        }
Esempio n. 5
0
        private void HienThi()
        {
            string nguoiduyet = Session["user"].ToString();
            string maphieu    = Session["maphieu"].ToString();
            string bophan     = Session["bophan"].ToString();
            string loaiphieu  = Session["loaiphieu"].ToString();
            string macongty   = Session["congty"].ToString();

            var     list  = pdnaBUS.LayNoiDungVanBanTheoIDPhieuIDNhanVien(maphieu, nguoiduyet, macongty);
            Busers2 users = UserBUS.TimNhanVienTheoMa(nguoiduyet, macongty);


            lbBoPhan.Text    = bophan;
            lbSoPhieu.Text   = maphieu;
            lbNoiDung.Text   = list.pdmemovn;
            lbLoaiPhieu.Text = loaiphieu;
            lbNgay.Text      = list.CFMDate0.ToString();
            //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.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 (max == 5)
                    //{
                    //    ImageLevel1.Visible = false;

                    //}
                    //else
                    //{

                    //}
                    if (abcon.IDCapDuyet == 1)
                    {
                        Busers2 nguoiduyet1 = UserBUS.TimNhanVienTheoMa(abcon.Auditor, macongty);
                        //ChucVu chuc = ChucVuBUS.TimMaChucVu(nguoiduyet6.IDChucVu, macongty);
                        if (abcon.abrult == true && abcon.Yn == 1)
                        {
                            TextBox1.Text        = nguoiduyet1.USERID;
                            ImageLevel1.ImageUrl = "~/ProcessSignature/MyPhoto1.ashx?USERID=" + TextBox1.Text;
                        }
                        else
                        {
                            if (abcon.Yn == 2)
                            {
                                TextBox1.Text = "027276";

                                ImageLevel1.ImageUrl = "~/ProcessSignature/MyPhotoKhongDuyet.ashx?USERID=" + TextBox1.Text;
                            }
                            else
                            {
                                ImageLevel1.ImageUrl = null;
                            }
                        }
                    }
                    if (abcon.IDCapDuyet == 2)
                    {
                        Busers2 nguoiduyet2 = UserBUS.TimNhanVienTheoMa(abcon.Auditor, macongty);
                        if (abcon.abrult == true && abcon.Yn == 1)
                        {
                            TextBox2.Text        = nguoiduyet2.USERID;
                            ImageLevel2.ImageUrl = "~/ProcessSignature/MyPhoto2.ashx?USERID=" + TextBox2.Text;
                        }
                        else
                        {
                            if (abcon.Yn == 2)
                            {
                                TextBox2.Text = "027276";

                                ImageLevel2.ImageUrl = "~/ProcessSignature/MyPhotoKhongDuyet.ashx?USERID=" + TextBox2.Text;
                            }
                            else
                            {
                                ImageLevel2.ImageUrl = null;
                            }
                        }
                    }
                    if (abcon.IDCapDuyet == 3)
                    {
                        Busers2 nguoiduyet3 = UserBUS.TimNhanVienTheoMa(abcon.Auditor, macongty);
                        ChucVu  chuc        = ChucVuBUS.TimMaChucVu(nguoiduyet3.IDChucVu, macongty);
                        if (abcon.abrult == true && abcon.Yn == 1)
                        {
                            TextBox3.Text        = nguoiduyet3.USERID;
                            ImageLevel3.ImageUrl = "~/ProcessSignature/MyPhoto3.ashx?USERID=" + TextBox3.Text;
                        }
                        else
                        {
                            if (abcon.Yn == 2)
                            {
                                TextBox3.Text = "027276";

                                ImageLevel3.ImageUrl = "~/ProcessSignature/MyPhotoKhongDuyet.ashx?USERID=" + TextBox3.Text;
                            }
                            else
                            {
                                ImageLevel3.ImageUrl = null;
                            }
                        }
                    }
                    if (abcon.IDCapDuyet == 4)
                    {
                        Busers2 nguoiduyet4 = UserBUS.TimNhanVienTheoMa(abcon.Auditor, macongty);
                        ChucVu  chuc        = ChucVuBUS.TimMaChucVu(nguoiduyet4.IDChucVu, macongty);
                        if (abcon.abrult == true && abcon.Yn == 1)
                        {
                            TextBox4.Text        = nguoiduyet4.USERID;
                            ImageLevel4.ImageUrl = "~/ProcessSignature/MyPhoto4.ashx?USERID=" + TextBox4.Text;
                        }
                        else
                        {
                            if (abcon.Yn == 2)
                            {
                                TextBox4.Text = "027276";

                                ImageLevel4.ImageUrl = "~/ProcessSignature/MyPhotoKhongDuyet.ashx?USERID=" + TextBox4.Text;
                            }
                            else
                            {
                                ImageLevel4.ImageUrl = null;
                            }
                        }
                    }
                    if (abcon.IDCapDuyet == 5)
                    {
                        Busers2 nguoiduyet5 = UserBUS.TimNhanVienTheoMa(abcon.Auditor, macongty);
                        ChucVu  chuc        = ChucVuBUS.TimMaChucVu(nguoiduyet5.IDChucVu, macongty);
                        if (abcon.abrult == true && abcon.Yn == 2)
                        {
                            TextBox5.Text        = nguoiduyet5.USERID;
                            ImageLevel5.ImageUrl = "~/ProcessSignature/MyPhoto5.ashx?USERID=" + TextBox5.Text;
                        }
                        else
                        {
                            if (abcon.Yn == 2)
                            {
                                TextBox5.Text = "027276";

                                ImageLevel5.ImageUrl = "~/ProcessSignature/MyPhotoKhongDuyet.ashx?USERID=" + TextBox5.Text;
                            }
                            else
                            {
                                ImageLevel5.ImageUrl = null;
                            }
                        }
                    }
                    if (abcon.IDCapDuyet == 6)
                    {
                        Busers2 nguoiduyet6 = UserBUS.TimNhanVienTheoMa(abcon.Auditor, macongty);
                        ChucVu  chuc        = ChucVuBUS.TimMaChucVu(nguoiduyet6.IDChucVu, macongty);
                        if (abcon.abrult == true && abcon.Yn == 1)
                        {
                            TextBox6.Text = nguoiduyet6.USERID;

                            ImageLevel6.ImageUrl = "~/ProcessSignature/MyPhoto6.ashx?USERID=" + TextBox6.Text;
                        }
                        else
                        {
                            if (abcon.Yn == 2)
                            {
                                TextBox6.Text = "027276";

                                ImageLevel6.ImageUrl = "~/ProcessSignature/MyPhotoKhongDuyet.ashx?USERID=" + TextBox6.Text;
                            }
                            else
                            {
                                ImageLevel6.ImageUrl = null;
                            }
                        }
                    }

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

                        if (abcon.abrult == true && abcon.Yn == 1)
                        {
                            TextBox7.Text        = nguoiduyet7.USERID;
                            ImageLevel7.ImageUrl = "~/ProcessSignature/MyPhoto7.ashx?USERID=" + TextBox7.Text;
                        }
                        else
                        {
                            if (abcon.Yn == 2)
                            {
                                TextBox7.Text = "027276";

                                ImageLevel7.ImageUrl = "~/ProcessSignature/MyPhotoKhongDuyet.ashx?USERID=" + TextBox7.Text;
                            }
                            else
                            {
                                ImageLevel7.ImageUrl = null;
                            }
                        }
                    }
                }
            }
        }