Exemple #1
0
        private void HienThiPhieuMuaHang()
        {
            string macongty = Session["congty"].ToString();
            string idphieu  = Session["maphieu"].ToString();

            string    manguoidung = Session["user"].ToString();
            DataTable dt          = dal.TimPhieuTheoMaNguoiTao(idphieu, 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 donvi          = BDepartmentDAO.TimMaDonVi(madonvi, macongty);
                abill       loaiphieu      = abillBUS.SearchAbillByID(maloaiphieu);
                string      tenloaiphieuVN = loaiphieu.abname;
                string      tenloaiphieuTW = loaiphieu.abnameTW;
                txtIDLoaiphieu.Text   = loaiphieu.abtype;
                lbLoaiPhieu.Text      = tenloaiphieuVN + " " + tenloaiphieuTW;
                lbldonvidenghi.Text   = donvi.DepName;
                lblsophieu.Text       = idphieu;
                lblMucDichSuDung.Text = dt.Rows[0]["UseIntent"].ToString();
                txtIDDonVi.Text       = donvi.ID;
                string dinhdang = ngaythang;
                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 + "";
            }
        }
        private void HienThiPhieuMuaHang()
        {
            string macongty = Session["congty"].ToString();
            string idphieu  = Session["maphieu"].ToString();

            string manguoidich = Session["user"].ToString();

            DataTable dt = dal.TimPhieuTheoMaNguoiDich(idphieu, macongty, manguoidich);

            if (dt.Rows.Count > 0)
            {
                string madonvi     = dt.Rows[0]["pddepid"].ToString();
                string maloaiphieu = dt.Rows[0]["Abtype"].ToString();

                abill  loaiphieu      = abillBUS.SearchAbillByID(maloaiphieu);
                string tenloaiphieuVN = loaiphieu.abname;
                string tenloaiphieuTW = loaiphieu.abnameTW;
                txtNguoiDUyet.Text = dt.Rows[0]["CFMID1"].ToString();
                lbLoaiPhieu.Text   = tenloaiphieuVN + " " + tenloaiphieuTW;
                BDepartment timdonvi = BDepartmentDAO.TimMaDonVi(madonvi, macongty);
                lbldonvidenghi.Text = timdonvi.DepName;
                lblsophieu.Text     = idphieu;
                txtMucDich.Text     = dt.Rows[0]["UseIntent"].ToString();
                lblTieuDe.Text      = dt.Rows[0]["mytitle"].ToString();
                txtTieuDe.Text      = dt.Rows[0]["pdnsubject"].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);
                lblNgaytao.Text = "Ngày 日  " + ngay + " Tháng 月 " + thang + " Năm 年 " + nam + "";
            }
        }
        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 + "";
        }
        private void HienThiChiTiet()
        {
            string macongty   = Session["congty"].ToString();
            string nguoiduyet = Session["user"].ToString();
            string maphieu    = Session["maphieu"].ToString();
            //string bophan = Session["bophan"].ToString();
            //string tenloaiphieu = Session["loaiphieu"].ToString();
            pdna        list = pdnaBUS.LayNoiDungVanBanTheoIDPhieuIDNhanVien(maphieu, nguoiduyet, macongty);
            BDepartment bp   = BDepartmentDAO.TimMaDonVi(list.pddepid, macongty);

            Session["mabophan"] = bp.ID;
            Session["bophan"]   = bp.DepName;
            abill  loaiphieu      = abillBUS.SearchAbillByID(list.Abtype);
            string tenloaiphieuVN = loaiphieu.abname;
            string tenloaiphieuTW = loaiphieu.abnameTW;

            lblTieuDe.Text      = list.mytitle + list.pdnsubject;
            lbLoaiPhieu.Text    = tenloaiphieuVN + " " + tenloaiphieuTW;
            lbldonvidenghi.Text = bp.DepName;
            lbSoPhieu.Text      = maphieu;

            string dinhdang = list.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 + "";
        }
        private void HienThiPhieuMuaHang()
        {
            string macongty = Session["congty"].ToString();
            string idphieu  = Session["maphieu"].ToString();

            string manguoidung = Session["user"].ToString();

            db.Refresh(System.Data.Linq.RefreshMode.OverwriteCurrentValues, db.ExecuteQuery <pdna>("select * from pdna where pdno='" + idphieu + "'and GSBH='" + macongty + "' and CFMID0='" + manguoidung + "'"));
            var list = db.ExecuteQuery <pdna>("select * from pdna where pdno='" + idphieu + "'and GSBH='" + macongty + "' and CFMID0='" + manguoidung + "'");

            foreach (pdna phieu in list)
            {
                abill       loaiphieu      = abillBUS.SearchAbillByID(phieu.Abtype);
                BDepartment donvi          = BDepartmentDAO.TimMaDonVi(phieu.pddepid, macongty);
                string      tenloaiphieuVN = loaiphieu.abname;
                string      tenloaiphieuTW = loaiphieu.abnameTW;
                txtTieuDe.Text        = phieu.mytitle;
                lblPhieuMuaHang.Text  = tenloaiphieuVN + " " + tenloaiphieuTW;
                lbldonvidenghi.Text   = donvi.DepName;
                lblsophieu.Text       = idphieu;
                lblMucDichSuDung.Text = phieu.UseIntent;

                string dinhdang = phieu.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 + "";
            }
        }
Exemple #6
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            string macongty = DropCty.SelectedValue.ToString();

            string madonvi = DropDownLDonVi.SelectedValue.ToString();

            string manguoiduyet = txtNguoiDuyet.Text;

            int buocduyet = int.Parse(txtBucoDuyet.Text);

            BDepartment              donvi     = BDepartmentDAO.TimMaDonVi(madonvi, macongty);
            AbDepartmentType         loaidonvi = LoaiDonViDAO.TimMaLoaiDonVi(int.Parse(donvi.DepartmentTypeID.ToString()), macongty);
            QuyTrinhXetDuyetCuaCanBo quytrinh  = new QuyTrinhXetDuyetCuaCanBo();

            //quytrinh.IDQuyTrinh = maquytrinh + (QuyTrinhXetDuyetDAO.DemQuyTrinhXetDuyet() + 1).ToString();
            quytrinh.BADEPID    = madonvi;
            quytrinh.tendonviTW = donvi.DepName;
            quytrinh.GSBH       = macongty;
            quytrinh.BuocDuyet  = buocduyet;

            quytrinh.IDLoaiDonVi          = loaidonvi.DepartmentTypeID;
            quytrinh.DepartmentTypeNameTW = loaidonvi.DepartmentTypeNameTW;
            if (cbLoaiPhieu.Checked == true)
            {
                quytrinh.abtype = DropDownLoaiPhieu.SelectedValue.ToString();
                abill timloai = abillBUS.SearchAbillByID(DropDownLoaiPhieu.SelectedValue.ToString());
                quytrinh.abtypenameTW = timloai.abnameTW;
            }
            else
            {
                quytrinh.abtype = "PDN1";
            }
            if (CheckThongQuaDonVi.Checked == true)
            {
                quytrinh.DonViThongQua = DropDownDonViThongQua.SelectedValue.ToString();
                BDepartment donvithongqua = BDepartmentDAO.TimMaDonVi(DropDownDonViThongQua.SelectedValue.ToString(), macongty);
                quytrinh.tendonvithongqua = donvithongqua.DepName;
            }
            else
            {
                quytrinh.DonViThongQua = null;
            }
            if (txtNguoiDuyet.Text.Trim() == "")
            {
                quytrinh.NguoiDuyet = "MD";
            }
            else
            {
                quytrinh.NguoiDuyet = manguoiduyet;
                Busers2 nguoi = UserDAO.TimNhanVienTheoMa(manguoiduyet, macongty);
                quytrinh.USERNAME = nguoi.USERNAME;
                ChucVu chuc = ChucVuDAO.TimMaChucVu(nguoi.IDChucVu, macongty);
                quytrinh.IDChucVu          = chuc.IDChucVu;
                quytrinh.TenChucVuTiengHoa = chuc.TenChucVuTiengHoa;
                quytrinh.IDCapDuyet        = nguoi.IDCapDuyet;
            }
            QuyTrinhXetDuyetCuaCanBoDAO.SuaQuyTrinhXetDuyetTheoCanBo(quytrinh);
            Response.Redirect("FQuyTrinhXetDuyetDanhChoCanBo.aspx");
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            DropDownNguoiDich.Enabled = false;

            // string ngaythang = DateTime.Parse(phieu.CFMDate0.ToString("dd/MM/yyyy"));
            if (!IsPostBack)
            {
                if (Session["user"] == null)
                {
                    //Response.Redirect("~/presentationLayer/DangNhap.aspx");
                    Response.Redirect("http://portal.footgear.com.vn");
                }
                string strNgonngu = (string)Session["languege"];
                if (strNgonngu != null)
                {
                    LayngonNgu(32, strNgonngu);
                }
                else
                {
                    Response.Redirect("http://portal.footgear.com.vn");
                }
                btnLuu.Attributes.Add("opacity", "0.3");
                btnLuu.Enabled = false;
                GanNgonNguVaoConTrol();
                string    maphieu     = Session["maphieu"].ToString();
                string    macongty    = Session["congty"].ToString();
                string    manguoidung = Session["user"].ToString();
                DataTable dt          = dal.TimPhieuTheoMaNguoiTao(maphieu, macongty, manguoidung);
                if (dt.Rows.Count > 0)
                {
                    string madonvi     = dt.Rows[0]["pddepid"].ToString();
                    string maloaiphieu = dt.Rows[0]["Abtype"].ToString();

                    BDepartment bophan    = BDepartmentBUS.TimMaDonVi(madonvi, macongty);
                    abill       loaiphieu = abillBUS.SearchAbillByID(maloaiphieu);

                    string tenloaiphieuVN = loaiphieu.abname;
                    string tenloaiphieuTW = loaiphieu.abnameTW;
                    txtTieuDe.Text   = dt.Rows[0]["mytitle"].ToString();
                    lbLoaiPhieu.Text = tenloaiphieuVN + " " + tenloaiphieuTW;
                    lbBoPhan.Text    = bophan.DepName;
                    lbSoPhieu.Text   = dt.Rows[0]["pdno"].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 + "";
                    //lbNgay.Text = ;
                    CKEditorControl1.Text = dt.Rows[0]["pdmemovn"].ToString();
                }
                DropDownNguoiDich.Enabled = false;
                CKEditorControl1.Enabled  = false;

                HienThiNguoiDich();
            }
        }
        private void HienThiPhieuMuaHang()
        {
            string macongty = Session["congty"].ToString();
            string idphieu  = Session["maphieu"].ToString();

            string manguoidung = Session["user"].ToString();

            db.Refresh(System.Data.Linq.RefreshMode.OverwriteCurrentValues, db.ExecuteQuery <pdna>("select * from pdna where pdno='" + idphieu + "'and GSBH='" + macongty + "' and CFMID0='" + manguoidung + "'"));
            var list = db.ExecuteQuery <pdna>("select * from pdna where pdno='" + idphieu + "'and GSBH='" + macongty + "' and CFMID0='" + manguoidung + "'");

            foreach (pdna phieu in list)
            {
                // pdna phieu = pdnaBUS.TimVanBanTheoMa(idphieu,macongty, true);
                if (phieu == null)
                {
                    BDepartment donvi          = BDepartmentDAO.TimMaDonVi(phieu.pddepid, macongty);
                    string      noidung        = Session["noidung"].ToString();
                    string      ngaytao        = Session["ngaytao"].ToString();
                    abill       loaiphieu      = abillBUS.SearchAbillByID(phieu.Abtype);
                    string      tenloaiphieuVN = loaiphieu.abname;
                    string      tenloaiphieuTW = loaiphieu.abnameTW;

                    lbLoaiPhieu.Text    = tenloaiphieuVN + " " + tenloaiphieuTW;
                    txtIDLoaiphieu.Text = loaiphieu.abtype;
                    txtIDDonVi.Text     = donvi.ID;
                    lbldonvidenghi.Text = donvi.DepName;
                    lblsophieu.Text     = idphieu;


                    DateTime date     = DateTime.Now;
                    string   dinhdang = DateTime.Parse(date.ToShortDateString()).ToString("dd/MM/yyyy");
                    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 + "";
                }
                else
                {
                    BDepartment donvi          = BDepartmentDAO.TimMaDonVi(phieu.pddepid, macongty);
                    abill       loaiphieu      = abillBUS.SearchAbillByID(phieu.Abtype);
                    string      tenloaiphieuVN = loaiphieu.abname;
                    string      tenloaiphieuTW = loaiphieu.abnameTW;
                    txtIDLoaiphieu.Text   = loaiphieu.abtype;
                    lbLoaiPhieu.Text      = tenloaiphieuVN + " " + tenloaiphieuTW;
                    lbldonvidenghi.Text   = donvi.DepName;
                    lblsophieu.Text       = idphieu;
                    lblMucDichSuDung.Text = phieu.UseIntent;
                    txtIDDonVi.Text       = donvi.ID;
                    string dinhdang = phieu.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 + "";
                }
            }
        }
Exemple #9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Session["user"] == null)
                {
                    //Response.Redirect("~/presentationLayer/DangNhap.aspx");
                    Response.Redirect("http://portal.footgear.com.vn");
                }
                string strNgonngu = (string)Session["languege"];
                if (strNgonngu != null)
                {
                    LayngonNgu(3, strNgonngu);
                }
                else
                {
                    Response.Redirect("http://portal.footgear.com.vn");
                }
                GanNgonNguVaoConTrol();
                string      maphieu     = Session["maphieu"].ToString();
                string      macongty    = Session["congty"].ToString();
                string      manguoidung = Session["user"].ToString();
                List <pdna> list        = db.pdnas.ToList();
                if (list.Count() > 0)
                {
                    //pdna phieu = pnaDAO.LayVanBanChuaDichTheoNguoiTrinhKy(maphieu, macongty, manguoidung);
                    DataTable dt = dal.TimPhieuGuiNguoiDich(maphieu, macongty, manguoidung);
                    if (dt.Rows.Count > 0)
                    {
                        string      madonvi   = dt.Rows[0]["pddepid"].ToString();
                        string      abtype    = dt.Rows[0]["Abtype"].ToString();
                        string      noidung   = dt.Rows[0]["pdmemovn"].ToString();
                        string      ngayt     = dt.Rows[0]["CFMDate0"].ToString();
                        BDepartment bophan    = BDepartmentBUS.TimMaDonVi(madonvi, macongty);
                        abill       loaiphieu = abillBUS.SearchAbillByID(abtype);

                        string tenloaiphieuVN = loaiphieu.abname;
                        string tenloaiphieuTW = loaiphieu.abnameTW;

                        lbLoaiPhieu.Text = tenloaiphieuVN + " " + tenloaiphieuTW;
                        lbBoPhan.Text    = bophan.DepName;

                        //lbNgay.Text = ;
                        lblNoiDung.Text = noidung;
                        lbSoPhieu.Text  = maphieu;
                        string dinhdang = ngayt;
                        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 + "";
                    }
                }
            }
            // string ngaythang = DateTime.Parse(phieu.CFMDate0.ToString("dd/MM/yyyy"));
        }
Exemple #10
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;
            }
        }
Exemple #11
0
        private void HienThiPhieuMuaHang()
        {
            string macongty = Session["congty"].ToString();
            string idphieu  = Session["maphieu"].ToString();

            string manguoidung = Session["user"].ToString();

            DataTable dt = dap.TimPhieuTheoMaNguoiTao(idphieu, 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());
                string      mucdicsudung = dt.Rows[0]["UseIntent"].ToString();
                BDepartment donvi        = BDepartmentDAO.TimMaDonVi(madonvi, macongty);

                abill  loaiphieu      = abillBUS.SearchAbillByID(maloaiphieu);
                string tenloaiphieuVN = loaiphieu.abname;
                string tenloaiphieuTW = loaiphieu.abnameTW;
                Session["bp"]         = donvi.ID;
                Session["bophan"]     = donvi.DepName;
                lblloaiphieumh.Text   = tenloaiphieuVN + " " + tenloaiphieuTW;
                lbldonvidenghi.Text   = donvi.DepName;
                lblsophieu.Text       = idphieu;
                lblMucDichSuDung.Text = mucdicsudung;
                lbTieuDe.Text         = tieude;
                string dinhdang = ngaythang;
                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 + "";
                if (Yn != 6)
                {
                    btnEdit.Enabled = true;
                    btnEdit.Attributes.Add("opacity", "100");
                    btnNhoNguoi.Enabled = true;
                    btnNhoNguoi.Attributes.Add("opacity", "100");
                }
                else
                {
                    btnEdit.Enabled     = false;
                    btnNhoNguoi.Enabled = false;
                    btnNhoNguoi.Attributes.Add("opacity", "0.3");
                    btnEdit.Attributes.Add("opacity", "0.3");
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Session["user"] == null)
                {
                    //Response.Redirect("~/presentationLayer/DangNhap.aspx");
                    Response.Redirect("http://portal.footgear.com.vn");
                }
                string strNgonngu = (string)Session["languege"];
                if (strNgonngu != null)
                {
                    LayngonNgu(3, strNgonngu);
                }
                else
                {
                    Response.Redirect("http://portal.footgear.com.vn");
                }
                GanNgonNguVaoConTrol();
                string    maphieu     = Session["maphieu"].ToString();
                string    macongty    = Session["congty"].ToString();
                string    manguoidung = Session["user"].ToString();
                DataTable dt          = dal.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      = BDepartmentBUS.TimMaDonVi(madonvi, macongty);
                    abill       loaiphieu   = abillBUS.SearchAbillByID(maloaiphieu);

                    string tenloaiphieuVN = loaiphieu.abname;
                    string tenloaiphieuTW = loaiphieu.abnameTW;

                    lbLoaiPhieu.Text = tenloaiphieuVN + " " + tenloaiphieuTW;
                    lbBoPhan.Text    = bophan.DepName;

                    //lbNgay.Text = ;
                    lblNoiDung.Text = noidung;
                    lbSoPhieu.Text  = maphieu;
                    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 + "";
                }
            }
        }
Exemple #13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["user"] == null)
            {
                //Response.Redirect("~/presentationLayer/DangNhap.aspx");
                Response.Redirect("http://portal.footgear.com.vn");
            }
            string strNgonngu = (string)Session["languege"];

            if (strNgonngu != null)
            {
                LayngonNgu(25, strNgonngu);
            }
            else
            {
                Response.Redirect("http://portal.footgear.com.vn");
            }
            GanNgonNguVaoConTrol();
            if (!IsPostBack)
            {
                string maphieu     = Session["maphieu"].ToString();
                string macongty    = Session["congty"].ToString();
                string manguoidung = Session["user"].ToString();
                //pdna phieu = pnaDAO.LayVanBanChuaDichTheoNguoiDich(maphieu, macongty, manguoidung);
                db.Refresh(System.Data.Linq.RefreshMode.OverwriteCurrentValues, db.ExecuteQuery <pdna>("select * from pdna where pdno='" + maphieu + "'and GSBH='" + macongty + "' and IDNguoiDich='" + manguoidung + "'"));
                var list = db.ExecuteQuery <pdna>("select * from pdna where pdno='" + maphieu + "'and GSBH='" + macongty + "' and IDNguoiDich='" + manguoidung + "'");
                foreach (pdna phieu in list)
                {
                    // string ngaythang = DateTime.Parse(phieu.CFMDate0.ToString("dd/MM/yyyy"));
                    BDepartment bophan    = BDepartmentBUS.TimMaDonVi(phieu.pddepid, macongty);
                    abill       loaiphieu = abillBUS.SearchAbillByID(phieu.Abtype);

                    string tenloaiphieuVN = loaiphieu.abname;
                    string tenloaiphieuTW = loaiphieu.abnameTW;

                    lbLoaiPhieu.Text   = tenloaiphieuVN + " " + tenloaiphieuTW;
                    lbBoPhan.Text      = bophan.DepName;
                    txtNguoiDUyet.Text = phieu.CFMID1;
                    //lbNgay.Text = ;
                    lbNoiDung.Text        = phieu.pdmemovn;
                    lbSoPhieu.Text        = phieu.pdno;
                    lblTieuDe.Text        = phieu.mytitle;
                    txtTieuDe.Text        = phieu.pdnsubject;
                    CKEditorControl1.Text = phieu.NoiDungDich;
                    string dinhdang = phieu.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 + "";
                }
            }
        }
Exemple #14
0
 public static bool InsertAbill(abill bill)
 {
     try
     {
         db.abills.InsertOnSubmit(bill);
         db.SubmitChanges();
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }
Exemple #15
0
        private void HienThi()
        {
            string maphieu     = Session["maphieu"].ToString();
            string macongty    = Session["congty"].ToString();
            string manguoidung = Session["user"].ToString();

            // pdna phieu = pnaDAO.LayVanBanTheoNguoiTrinh(maphieu, macongty,manguoidung);
            db.Refresh(System.Data.Linq.RefreshMode.OverwriteCurrentValues, db.ExecuteQuery <pdna>("select * from pdna where pdno='" + maphieu + "'and GSBH='" + macongty + "' and CFMID0='" + manguoidung + "'"));
            var list = db.ExecuteQuery <pdna>("select * from pdna where pdno='" + maphieu + "'and GSBH='" + macongty + "' and CFMID0='" + manguoidung + "'");

            foreach (pdna phieu in list)
            {
                Session["loaiphieu"]   = phieu.Abtype;
                Session["bp"]          = phieu.pddepid;
                Session["noidung"]     = phieu.pdmemovn;
                Session["noidungdich"] = phieu.NoiDungDich;
                Session["tieude"]      = phieu.mytitle;

                if (phieu == null)
                {
                    return;
                }
                else
                {
                    if (phieu.trangthaidich == true)
                    {
                        BDepartment bophan    = BDepartmentBUS.TimMaDonVi(phieu.pddepid, macongty);
                        abill       loaiphieu = abillBUS.SearchAbillByID(phieu.Abtype);

                        string tenloaiphieuVN = loaiphieu.abname;
                        string tenloaiphieuTW = loaiphieu.abnameTW;

                        lbLoaiPhieu.Text = tenloaiphieuVN + " " + tenloaiphieuTW;

                        lbBoPhan.Text = bophan.DepName;

                        // lbNgay.Text =ngaytao ;
                        lbNoiDung.Text     = phieu.pdmemovn;
                        lbSoPhieu.Text     = phieu.pdno;
                        LbNoiDungDich.Text = phieu.NoiDungDich;
                        string dinhdang = phieu.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 + "";
                    }
                }
            }
        }
Exemple #16
0
 public static bool DeleteAbill(string id)
 {
     try
     {
         abill b = new abill();
         b = db.abills.Where(p => p.abtype == id).FirstOrDefault();
         db.abills.DeleteOnSubmit(b);
         db.SubmitChanges();
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }
Exemple #17
0
        private void HienThi()
        {
            string macongty = Session["congty"].ToString();
            string idphieu  = Session["maphieu"].ToString();

            string manguoidung = Session["user"].ToString();

            DataTable dt = dalP.TimPhieuTheoMaNguoiTao(idphieu, macongty, manguoidung);

            if (dt.Rows.Count > 0)
            {
                string madonvi     = dt.Rows[0]["pddepid"].ToString();
                string maloaiphieu = dt.Rows[0]["Abtype"].ToString();
                int    yn          = int.Parse(dt.Rows[0]["Yn"].ToString());

                abill       loaiphieu      = abillBUS.SearchAbillByID(maloaiphieu);
                string      tenloaiphieuVN = loaiphieu.abname;
                string      tenloaiphieuTW = loaiphieu.abnameTW;
                BDepartment bophan         = BDepartmentBUS.TimMaDonVi(madonvi, macongty);
                Session["bp"]     = bophan.ID;
                Session["bophan"] = bophan.DepName;
                lbLoaiPhieu.Text  = tenloaiphieuVN + " " + tenloaiphieuTW;
                lbBoPhan.Text     = bophan.DepName;
                lbSoPhieu.Text    = idphieu;
                lbNoiDung.Text    = dt.Rows[0]["pdmemovn"].ToString();
                //lbNgay.Text = phieu.CFMDate0.ToString();
                lbTieuDe.Text = dt.Rows[0]["mytitle"].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 + "";
                if (yn != 6)
                {
                    btnEdit.Enabled = true;
                    Button2.Enabled = true;
                    btnEdit.Attributes.Add("opacity", "100");
                    Button2.Attributes.Add("opacity", "100");
                }
                else
                {
                    btnEdit.Enabled = false;
                    Button2.Enabled = false;
                    btnEdit.Attributes.Add("opacity", "0.3");
                    Button2.Attributes.Add("opacity", "0.3");
                }
            }
        }
Exemple #18
0
        private void HienThi()
        {
            string idphieu = Session["maphieu"].ToString();

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


            //pdna phieu = pdnaBUS.TimVanBanTheoMa(idphieu, congty, true);
            DataTable dt = dalPDN.TimPhieuTheoMaPhieu(idphieu, congty);

            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());
                BDepartment bophan    = BDepartmentBUS.TimMaDonVi(madonvi, congty);
                abill       loaiphieu = abillBUS.SearchAbillByID(maloaip);

                string tenloaiphieuVN = loaiphieu.abname;
                string tenloaiphieuTW = loaiphieu.abnameTW;

                lbLoaiPhieu.Text = tenloaiphieuVN + " " + tenloaiphieuTW;

                lbldonvidenghi.Text   = bophan.DepName;
                lbSoPhieu.Text        = idphieu;
                lblMucDichSuDung.Text = dt.Rows[0]["UseIntent"].ToString();
                lblTieuDe.Text        = dt.Rows[0]["mytitle"].ToString() + "-" + dt.Rows[0]["pdnsubject"].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);
                lblNgaytao.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;
            }
        }
        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      bp     = Session["bp"].ToString();
            string      congty = Session["congty"].ToString();
            BDepartment bophan = BDepartmentBUS.TimMaDonVi(bp, congty);
            //string loaiphieu = Session["loaiphieu"].ToString();
            pdna  phieu     = pdnaBUS.TimVanBanTheoMa(idphieu, congty, true);
            abill loaiphieu = abillBUS.SearchAbillByID(phieu.Abtype);

            string tenloaiphieuVN = loaiphieu.abname;
            string tenloaiphieuTW = loaiphieu.abnameTW;

            lbLoaiPhieu.Text = tenloaiphieuVN + " " + tenloaiphieuTW;
            //    lbBoPhan.Text = bophan;
            //    lbNoiDung.Text = phieu.pdmemovn.ToString();
            //    lbNgay.Text =Convert.ToString(phieu.CFMDate0);
            //  Buser users = UserBUS.TimMaNhanVienTheoBoPhan(user, bp);
            lblTieuDe.Text        = phieu.mytitle + phieu.pdnsubject;
            lbldonvidenghi.Text   = bophan.DepName;
            lbSoPhieu.Text        = idphieu;
            lblMucDichSuDung.Text = phieu.UseIntent;

            //lbNgay.Text = phieu.CFMDate0.ToString();
            string dinhdang = phieu.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 + "";


            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;
            }
        }
Exemple #20
0
 public static bool UpdateAbill(abill pabill)
 {
     try
     {
         abill b = new abill();
         b = db.abills.Where(p => p.abtype == pabill.abtype).FirstOrDefault();
         {
             b.abtype    = pabill.abtype;
             b.abname    = pabill.abname;
             b.maintable = pabill.maintable;
             b.abnameTW  = pabill.abnameTW;
             db.SubmitChanges();
             return(true);
         }
     }
     catch (Exception)
     { throw; }
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["user"] == null)
            {
                //Response.Redirect("~/presentationLayer/DangNhap.aspx");
                Response.Redirect("http://portal.footgear.com.vn");
            }
            string maphieu     = Session["maphieu"].ToString();
            string macongty    = Session["congty"].ToString();
            string manguoidung = Session["user"].ToString();

            //pdna phieu = pnaDAO.LayVanBanDaDichTheoNguoiDich(maphieu, macongty, manguoidung);
            db.Refresh(System.Data.Linq.RefreshMode.OverwriteCurrentValues, db.ExecuteQuery <pdna>("select * from pdna where pdno='" + maphieu + "'and GSBH='" + macongty + "' and IdnguoiDich='" + manguoidung + "'"));
            var list = db.ExecuteQuery <pdna>("select * from pdna where pdno='" + maphieu + "'and GSBH='" + macongty + "' and IdnguoiDich='" + manguoidung + "'");

            foreach (pdna phieu in list)
            {
                BDepartment bophan    = BDepartmentBUS.TimMaDonVi(phieu.pddepid, macongty);
                abill       loaiphieu = abillBUS.SearchAbillByID(phieu.Abtype);
                if (!IsPostBack)
                {
                    string tenloaiphieuVN = loaiphieu.abname;
                    string tenloaiphieuTW = loaiphieu.abnameTW;

                    lbLoaiPhieu.Text = tenloaiphieuVN + " " + tenloaiphieuTW;
                    lbBoPhan.Text    = bophan.DepName;
                    lbLoaiPhieu.Text = loaiphieu.abname;
                    //lbNgay.Text = ;
                    txtTieuDe.Text = phieu.pdnsubject;
                    lbNoiDung.Text = phieu.pdmemovn;
                    lbSoPhieu.Text = phieu.pdno;
                    string dinhdang = phieu.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 + "";
                    CKEditorControl1.Text     = phieu.NoiDungDich;
                    CKEditorControl1.ReadOnly = true;
                    CKEditorControl1.Enabled  = false;
                    btnLuu.Enabled            = false;
                }
            }
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            string maloaiphieu  = txtMaLoai.Text.Trim();
            string tentiengviet = txtTenLoaiVN.Text;
            string tentienghoa  = txtTenLoaiTW.Text;
            abill  loaiphieu    = new abill();

            if (txtMaLoai.Text.Trim() == "")
            {
            }
            else
            {
                loaiphieu.abtype   = maloaiphieu;
                loaiphieu.abname   = tentiengviet;
                loaiphieu.abnameTW = tentienghoa;
                abillDAO.UpdateAbill(loaiphieu);
                Response.Redirect("FDanhSachLoaiPhieu.aspx");
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (Session["user"] == null)
         {
             //Response.Redirect("~/presentationLayer/DangNhap.aspx");
             Response.Redirect("http://portal.footgear.com.vn");
         }
         string strNgonngu = (string)Session["languege"];
         if (strNgonngu != null)
         {
             LayngonNgu(2, strNgonngu);
         }
         else
         {
             Response.Redirect("http://portal.footgear.com.vn");
         }
         GanNgonNguVaoConTrol();
         string macongty = Session["congty"].ToString();
         string idphieu  = Session["maphieu"].ToString();
         //string bophan = Session["bophan"].ToString();
         string    manguoidung = Session["user"].ToString();
         DataTable dt          = dal.TimPhieuTheoMaNguoiTao(idphieu, macongty, manguoidung);
         if (dt.Rows.Count > 0)
         {
             string      madonvi        = dt.Rows[0]["pddepid"].ToString();
             string      maloaiphieu    = dt.Rows[0]["Abtype"].ToString();
             string      tentieude      = dt.Rows[0]["mytitle"].ToString();
             BDepartment timdonvi       = BDepartmentDAO.TimMaDonVi(madonvi, macongty);
             abill       loaiphieu      = abillBUS.SearchAbillByID(maloaiphieu);
             string      tenloaiphieuVN = loaiphieu.abname;
             string      tenloaiphieuTW = loaiphieu.abnameTW;
             txtTieuDe.Text        = tentieude;
             lbLoaiPhieu.Text      = tenloaiphieuVN + " " + tenloaiphieuTW;
             lbBoPhan.Text         = timdonvi.DepName;
             lbSoPhieu.Text        = idphieu;
             CKEditorControl1.Text = dt.Rows[0]["pdmemovn"].ToString();
         }
     }
 }
Exemple #24
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string strNgonngu = (string)Session["languege"];

            if (strNgonngu != null)
            {
                LayngonNgu(2, strNgonngu);
            }
            else
            {
                Response.Redirect("http://portal.footgear.com.vn");
            }
            GanNgonNguVaoConTrol();
            if (!IsPostBack)
            {
                if (Session["user"] == null)
                {
                    //Response.Redirect("~/presentationLayer/DangNhap.aspx");
                    Response.Redirect("http://portal.footgear.com.vn");
                }
                string macongty    = Session["congty"].ToString();
                string idphieu     = Session["maphieu"].ToString();
                string bophan      = Session["bophan"].ToString();
                string manguoidung = Session["user"].ToString();
                // pdna phieu = pdnaBUS.TimVanBanTheoMa(idphieu, macongty, true);
                db.Refresh(System.Data.Linq.RefreshMode.OverwriteCurrentValues, db.ExecuteQuery <pdna>("select * from pdna where pdno='" + idphieu + "'and GSBH='" + macongty + "' and CFMID0='" + manguoidung + "'"));
                var list = db.ExecuteQuery <pdna>("select * from pdna where pdno='" + idphieu + "'and GSBH='" + macongty + "' and CFMID0='" + manguoidung + "'");
                foreach (pdna phieu in list)
                {
                    abill  loaiphieu      = abillBUS.SearchAbillByID(phieu.Abtype);
                    string tenloaiphieuVN = loaiphieu.abname;
                    string tenloaiphieuTW = loaiphieu.abnameTW;

                    lbLoaiPhieu.Text      = tenloaiphieuVN + " " + tenloaiphieuTW;
                    lbBoPhan.Text         = bophan;
                    lbSoPhieu.Text        = idphieu;
                    CKEditorControl1.Text = phieu.pdmemovn;
                }
            }
        }
Exemple #25
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 + "";
            }
        }
        private void HienThiThongTin()
        {
            string maphieu     = Session["maphieu"].ToString();
            string macongty    = Session["congty"].ToString();
            string manguoidung = Session["user"].ToString();



            DataTable dt = dal.TimPhieuTheoMaNguoiTao(maphieu, macongty, manguoidung);

            if (dt.Rows.Count > 0)
            {
                // string ngaythang = DateTime.Parse(phieu.CFMDate0.ToString("dd/MM/yyyy"));
                string      madonvi        = dt.Rows[0]["pddepid"].ToString();
                string      maloaiphieu    = dt.Rows[0]["Abtype"].ToString();
                BDepartment bophan         = BDepartmentBUS.TimMaDonVi(madonvi, macongty);
                abill       loaiphieu      = abillBUS.SearchAbillByID(maloaiphieu);
                string      tenloaiphieuVN = loaiphieu.abname;
                string      tenloaiphieuTW = loaiphieu.abnameTW;
                txtTieuDe.Text   = dt.Rows[0]["mytitle"].ToString();
                lbLoaiPhieu.Text = tenloaiphieuVN + " " + tenloaiphieuTW;
                //lbNgay.Text = ;
                //CKEditorControl1.Text = phieu.pdmemovn;
                lbBoPhan.Text  = bophan.DepName;
                lbSoPhieu.Text = dt.Rows[0]["pdno"].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 + "";
                CKEditorControl1.Text = dt.Rows[0]["pdmemovn"].ToString();

                DropDownNguoiDich.Enabled = false;
                HienThiNguoiDich();
                btnLuu.Enabled = false;
                btnLuu.Attributes.CssStyle.Add("opacity", "0.3");
            }
            CKEditorControl1.Enabled = false;
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            string maloaiphieu  = txtMaLoai.Text.Trim();
            string tentiengviet = txtTenLoaiVN.Text;
            string tentienghoa  = txtTenLoaiTW.Text;
            abill  loaiphieu    = new abill();

            if (txtMaLoai.Text.Trim() == "")
            {
            }
            else
            {
                loaiphieu.abtype   = maloaiphieu;
                loaiphieu.abname   = tentiengviet;
                loaiphieu.abnameTW = tentienghoa;
                abillDAO.InsertAbill(loaiphieu);
                abill timmaloai = abillDAO.SearchAbillByID(maloaiphieu);
                if (timmaloai != null)
                {
                    HienThiDanhSach();
                }
            }
        }
        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;
                            }
                        }
                    }
                }
            }
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            string macongty = DropCty.SelectedValue.ToString();

            string madonvi = DropDownLDonVi.SelectedValue.ToString();

            string manguoiduyet = txtNguoiDuyet.Text;

            int buocduyet = int.Parse(txtBucoDuyet.Text);

            BDepartment              donvi     = BDepartmentDAO.TimMaDonVi(madonvi, macongty);
            AbDepartmentType         loaidonvi = LoaiDonViDAO.TimMaLoaiDonVi(int.Parse(donvi.DepartmentTypeID.ToString()), macongty);
            QuyTrinhXetDuyetCuaCanBo quytrinh  = new QuyTrinhXetDuyetCuaCanBo();

            //quytrinh.IDQuyTrinh = maquytrinh + (QuyTrinhXetDuyetDAO.DemQuyTrinhXetDuyet() + 1).ToString();
            quytrinh.BADEPID    = madonvi;
            quytrinh.tendonviTW = donvi.DepName;
            quytrinh.GSBH       = macongty;
            //quytrinh.BuocDuyet = buocduyet;

            quytrinh.IDLoaiDonVi          = loaidonvi.DepartmentTypeID;
            quytrinh.DepartmentTypeNameTW = loaidonvi.DepartmentTypeNameTW;

            if (DropDownLoaiPhieu.SelectedValue.ToString().Trim() == "")
            {
                quytrinh.abtype = "PDN1";
                abill timloai = abillBUS.SearchAbillByID(quytrinh.abtype);
                quytrinh.abtypenameTW = timloai.abnameTW;
            }
            else
            {
                quytrinh.abtype = DropDownLoaiPhieu.SelectedValue.ToString();
                abill timloai = abillBUS.SearchAbillByID(DropDownLoaiPhieu.SelectedValue.ToString());
                quytrinh.abtypenameTW = timloai.abnameTW;
            }


            if (CheckThongQuaDonVi.Checked == true)
            {
                quytrinh.DonViThongQua = DropDownDonViThongQua.SelectedValue.ToString();
                BDepartment donvithongqua = BDepartmentDAO.TimMaDonVi(DropDownDonViThongQua.SelectedValue.ToString(), macongty);
                quytrinh.tendonvithongqua = donvithongqua.DepName;
                Busers2 timnguoi = UserDAO.TimMaNhanVienTheoBoPhan(txtNguoiDuyet.Text, donvithongqua.ID, macongty);
                if (timnguoi == null)
                {
                    quytrinh.NguoiDuyet = null;
                }
                else
                {
                    quytrinh.NguoiDuyet = txtNguoiDuyet.Text;
                    quytrinh.USERNAME   = timnguoi.USERNAME;
                    ChucVu chuc = ChucVuDAO.TimMaChucVu(timnguoi.IDChucVu, macongty);
                    quytrinh.IDChucVu         = chuc.IDChucVu;
                    quytrinh.tendonvithongqua = chuc.TenChucVuTiengHoa;
                    quytrinh.IDCapDuyet       = timnguoi.IDCapDuyet;
                }
            }
            else
            {
                quytrinh.DonViThongQua = null;
                quytrinh.NguoiDuyet    = txtNguoiDuyet.Text;
                Busers2 nguoi = UserDAO.TimNhanVienTheoMa(manguoiduyet, macongty);
                quytrinh.USERNAME = nguoi.USERNAME;
                ChucVu chuc = ChucVuDAO.TimMaChucVu(nguoi.IDChucVu, macongty);
                quytrinh.IDChucVu         = chuc.IDChucVu;
                quytrinh.tendonvithongqua = chuc.TenChucVuTiengHoa;
                quytrinh.IDCapDuyet       = nguoi.IDCapDuyet;
            }

            #region ThemQuyTrinh
            List <QuyTrinhXetDuyetCuaCanBo> ListQT1 = QuyTrinhXetDuyetCuaCanBoDAO.LayDanhSachQuyTrinhTheoCapDuyet(quytrinh.BADEPID, quytrinh.GSBH, quytrinh.abtype);
            int max1 = (from ct1 in ListQT1
                        select int.Parse(ct1.BuocDuyet.ToString())).Max();
            quytrinh.BuocDuyet = max1 + 1;


            QuyTrinhXetDuyetCuaCanBo timquynguoi = QuyTrinhXetDuyetCuaCanBoDAO.TimNguoiTrongQuyTrinh(quytrinh.NguoiDuyet, quytrinh.abtype, quytrinh.BADEPID, quytrinh.GSBH);
            Busers2 timnguoiduyettrong           = UserDAO.TimNhanVienTheoMa(quytrinh.NguoiDuyet, quytrinh.GSBH);

            if (timquynguoi == null && quytrinh.NguoiDuyet != null)
            {
                QuyTrinhXetDuyetCuaCanBoDAO.ThemQuyTrinhXetDuyetCuaCanBo(quytrinh);// them quy trinh
                List <QuyTrinhXetDuyetCuaCanBo> ListQT = QuyTrinhXetDuyetCuaCanBoDAO.LayDanhSachQuyTrinhTheoCapDuyet(quytrinh.BADEPID, quytrinh.GSBH, quytrinh.abtype);
                int min = (from ct1 in ListQT
                           select int.Parse(ct1.BuocDuyet.ToString())).Min();
                int min1 = (from ct1 in ListQT
                            select int.Parse(ct1.IDCapDuyet.ToString())).Min();
                foreach (QuyTrinhXetDuyetCuaCanBo qt in ListQT)
                {
                    QuyTrinhXetDuyetCuaCanBo laynguoidautien = QuyTrinhXetDuyetCuaCanBoDAO.TimCapTiepTheoTrongQuyTrinh1(qt.BADEPID, qt.GSBH, qt.abtype, min1);
                    if (qt.NguoiDuyet == laynguoidautien.NguoiDuyet)
                    {
                        QuyTrinhXetDuyetCuaCanBo quy = new QuyTrinhXetDuyetCuaCanBo();
                        quy.BuocDuyet  = 1;
                        quy.IDQuyTrinh = qt.IDQuyTrinh;

                        buoc     = 1;
                        capduyet = int.Parse(qt.IDCapDuyet.ToString());
                        QuyTrinhXetDuyetCuaCanBoDAO.CapNhatQuyTrinh(quy);
                    }
                    else
                    {
                        //QuyTrinhXetDuyet laybuoc= QuyTrinhXetDuyetDAO.TimBuocTiepTheoTrongQuyTrinh1(qt.BADEPID, qt.GSBH, qt.abtype, int.Parse(qt.BuocDuyet.ToString()));
                        if (qt.DonViThongQua == null && capduyet == qt.IDCapDuyet)
                        {
                            QuyTrinhXetDuyetCuaCanBo quy = new QuyTrinhXetDuyetCuaCanBo();
                            quy.BuocDuyet  = buoc;
                            quy.IDQuyTrinh = qt.IDQuyTrinh;

                            buoc     = int.Parse(quy.BuocDuyet.ToString());
                            capduyet = int.Parse(qt.IDCapDuyet.ToString());
                            QuyTrinhXetDuyetCuaCanBoDAO.CapNhatQuyTrinh(quy);
                        }
                        else
                        {
                            QuyTrinhXetDuyetCuaCanBo quy = new QuyTrinhXetDuyetCuaCanBo();
                            quy.BuocDuyet  = buoc + 1;
                            quy.IDQuyTrinh = qt.IDQuyTrinh;

                            buoc     = int.Parse(quy.BuocDuyet.ToString());
                            capduyet = int.Parse(qt.IDCapDuyet.ToString());
                            QuyTrinhXetDuyetCuaCanBoDAO.CapNhatQuyTrinh(quy);
                        }
                    }
                }
            }
            #endregion
            ///////////////////////////////////// code by Mr Tuan
            QuyTrinhXetDuyetCuaCanBo timng = QuyTrinhXetDuyetCuaCanBoDAO.TimNguoiTrongQuyTrinh(manguoiduyet, quytrinh.abtype, madonvi, macongty);
            List <Abcon>             list  = AbconDAO.LayDanhSachPhieuTaiCapDuyetChuaDuyet(madonvi, quytrinh.abtype, macongty, int.Parse(timng.BuocDuyet.ToString()));
            foreach (Abcon l in list)
            {
                buocthemvao = l.abde;
                if (l.IDCapDuyet > timng.IDCapDuyet)
                {
                    List <Abcon> danh = AbconDAO.LayDanhSachPhieuTaiCapDuyetChuaDuyet1(l.from_depart, l.abtype, l.Gsbh, l.pdno, int.Parse(timng.BuocDuyet.ToString()));
                    foreach (Abcon aa in danh)
                    {
                        if (timng.BuocDuyet == aa.Abstep && timng.DonViThongQua == null && timng.IDCapDuyet == aa.IDCapDuyet)
                        {
                            Abcon aabcc = new Abcon();
                            aabcc.abtype = aa.abtype;
                            aabcc.pdno   = aa.pdno;
                            aabcc.Gsbh   = aa.Gsbh;
                            aabcc.IDCT   = aa.IDCT;
                            aabcc.Abstep = aa.Abstep;
                            aabcc.abde   = aa.abde + 1;
                            AbconDAO.CapNhatPhieuChuyen(aabcc);
                        }
                        else
                        {
                            Abcon aabcc = new Abcon();
                            aabcc.abtype = aa.abtype;
                            aabcc.pdno   = aa.pdno;
                            aabcc.Gsbh   = aa.Gsbh;
                            aabcc.IDCT   = aa.IDCT;
                            aabcc.Abstep = aa.Abstep + 1;
                            aabcc.abde   = aa.abde + 1;
                            AbconDAO.CapNhatPhieuChuyen(aabcc);
                        }
                    }
                }
                else
                {
                    if (l.IDCapDuyet == timng.IDCapDuyet && l.Abstep == timng.BuocDuyet)
                    {
                        List <Abcon> danh = AbconDAO.LayDanhSachPhieuTaiCapDuyetChuaDuyet1(l.from_depart, l.abtype, l.Gsbh, l.pdno, int.Parse(timng.BuocDuyet.ToString()));
                        foreach (Abcon aa in danh)
                        {
                            if (timng.BuocDuyet == aa.Abstep && timng.DonViThongQua == null && timng.IDCapDuyet == aa.IDCapDuyet)
                            {
                                Abcon aabcc = new Abcon();
                                aabcc.abtype = aa.abtype;
                                aabcc.pdno   = aa.pdno;
                                aabcc.Gsbh   = aa.Gsbh;
                                aabcc.IDCT   = aa.IDCT;
                                aabcc.Abstep = aa.Abstep;
                                aabcc.abde   = aa.abde + 1;
                                AbconDAO.CapNhatPhieuChuyen(aabcc);
                            }
                            else
                            {
                                Abcon aabcc = new Abcon();
                                aabcc.abtype = aa.abtype;
                                aabcc.pdno   = aa.pdno;
                                aabcc.Gsbh   = aa.Gsbh;
                                aabcc.IDCT   = aa.IDCT;
                                aabcc.Abstep = aa.Abstep + 1;
                                aabcc.abde   = aa.abde + 1;
                                AbconDAO.CapNhatPhieuChuyen(aabcc);
                            }
                        }
                    }
                    else
                    {
                        List <Abcon> danh = AbconDAO.LayDanhSachPhieuTaiCapDuyetChuaDuyet1(l.from_depart, l.abtype, l.Gsbh, l.pdno, int.Parse(timng.BuocDuyet.ToString()));
                        foreach (Abcon aa in danh)
                        {
                            if (timng.BuocDuyet == aa.Abstep && timng.DonViThongQua == null && timng.IDCapDuyet == aa.IDCapDuyet)
                            {
                                Abcon aabcc = new Abcon();
                                aabcc.abtype = aa.abtype;
                                aabcc.pdno   = aa.pdno;
                                aabcc.Gsbh   = aa.Gsbh;
                                aabcc.IDCT   = aa.IDCT;
                                aabcc.Abstep = aa.Abstep;
                                aabcc.abde   = aa.abde + 1;
                                AbconDAO.CapNhatPhieuChuyen(aabcc);
                            }
                            else
                            {
                                Abcon aabcc = new Abcon();
                                aabcc.abtype = aa.abtype;
                                aabcc.pdno   = aa.pdno;
                                aabcc.Gsbh   = aa.Gsbh;
                                aabcc.IDCT   = aa.IDCT;
                                aabcc.Abstep = aa.Abstep + 1;
                                aabcc.abde   = aa.abde + 1;
                                AbconDAO.CapNhatPhieuChuyen(aabcc);
                            }
                        }
                    }
                }
                //them phieu
                //kiemtamaphieu = l.pdno;
                Abcon abco = new Abcon();

                abco.ABC         = l.ABC;
                abco.abde        = buocthemvao;
                abco.ABJOB       = l.ABJOB;
                abco.abmomo      = l.abmomo;
                abco.Abstep      = int.Parse(timng.BuocDuyet.ToString());
                abco.abrult      = false;
                abco.abtype      = l.abtype;
                abco.Auditor     = timng.NguoiDuyet;
                abco.bixoa       = false;
                abco.boqua       = false;
                abco.cothutu     = true;
                abco.from_depart = l.from_depart;
                abco.from_user   = l.from_user;
                abco.Gsbh        = l.Gsbh;
                abco.Id_VB_CD    = l.Id_VB_CD;
                abco.IDCapDuyet  = timng.IDCapDuyet;
                abco.IDChiTiet   = l.IDChiTiet;

                abco.kytoanbo       = true;
                abco.lydokhongduyet = l.lydokhongduyet;
                abco.Maintitle      = l.Maintitle;
                abco.ncancel        = 0;
                abco.Nhom           = l.Nhom;
                abco.Password2      = null;
                abco.pdno           = l.pdno;
                abco.received       = l.received;
                abco.signatue       = null;
                abco.Userdate       = l.Userdate;
                abco.Yn             = 4;
                AbconBUS.ThemChiTiet(abco);
            }
            HienThiDanhSach();
        }
Exemple #30
0
 public static bool UpdateAbill(abill pabill)
 {
     return(abillDAO.UpdateAbill(pabill));
 }