コード例 #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        var id   = Request["ID"];
        var khId = Request["KH_ID"];
        var list = new List <PhieuXuatNhapSanPhamChiTiet>();

        using (var con = DAL.con())
        {
            if (string.IsNullOrEmpty(id))
            {
                Item    = ChoThueVayDal.SelectDraff(con);
                Item.Ma = Item.Ma == 0 ? 1 : Item.Ma + 1;
                Item.ID = Guid.NewGuid();
                if (!string.IsNullOrEmpty(khId))
                {
                    var kh = KhachHangDal.SelectById(new Guid(khId), con);
                    Item.KH_ID  = kh.ID;
                    Item.KH_Ten = kh.Ten;
                }
            }
            else
            {
                Item = ChoThueVayDal.SelectById(con, new Guid(id));
                list = PhieuXuatNhapSanPhamChiTietDal.SelectByPxnSpId(con, id);
            }
            var logoStr = DanhMucDal.SelectByMa("BAOCAO-HEADER-THUCHI", con).Description;
            Add.LogoStr = logoStr;
            Add.List    = list;
            Add.Item    = Item;;
        }
    }
コード例 #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        var id           = Request["ID"];
        var listDuyetAnh = new List <DuyetAnh>();
        var listBaiHat   = new List <BaiHat>();

        using (var con = DAL.con())
        {
            if (string.IsNullOrEmpty(id))
            {
                Item    = PhieuDichVuDal.SelectDraff(con);
                Item.Ma = Item.Ma == 0 ? 1 : Item.Ma + 1;
                Item.ID = Guid.NewGuid();
            }
            else
            {
                Item         = PhieuDichVuDal.SelectById(con, new Guid(id));
                listDuyetAnh = DuyetAnhDal.SelectByPdvId(con, id);
                listBaiHat   = BaiHatDal.SelectByPdvId(con, id);
                var logoStr = DanhMucDal.SelectByMa("BAOCAO-HEADER-THUCHI", con).Description;
                Add.LogoStr = logoStr;
            }
            Add.ListDuyetAnh = listDuyetAnh;
            Add.ListBaiHat   = listBaiHat;
            Add.Item         = Item;;
        }
    }
コード例 #3
0
ファイル: Class1.cs プロジェクト: nhatkycon/AoCuoiHongNhung
        protected override void Render(HtmlTextWriter writer)
        {
            StringBuilder       sb       = new StringBuilder();
            bool                login_fe = Security.IsAuthenticated();
            string              subAct   = Request["subAct"];
            ClientScriptManager cs       = this.Page.ClientScript;

            if (subAct != "dangky_home" && subAct != "Ho_tro_khach_hang")
            {
                sb.AppendFormat("jQuery.getScript('{0}',"
                                , cs.GetWebResourceUrl(typeof(Class1), "docsoft.hethong.DangNhap.JScript1.js"));
                sb.Append("function(){");
            }

            string Ma = Request["Ma"];

            if (!Security.IsAuthenticated())
            {
                switch (subAct)
                {
                case "lite":
                    #region thu nhỏ
                    if (login_fe)
                    {
                        sb.AppendFormat("DangNhap.setup('{0}');", Security.Username);
                    }
                    else
                    {
                        sb.AppendFormat("DangNhap.login_fe('{0}');", Ma);
                    }
                    break;

                    #endregion
                case "dangky_home":
                {
                    sb.Append("(" + JavaScriptConvert.SerializeObject(DanhMucDal.SelectByMa(Ma)) + ")");
                    break;
                }

                default:
                    if (login_fe && !Security.IsAuthenticated())
                    {
                        sb.AppendFormat("DangNhap.setup('{0}');", Security.Username);
                    }
                    else
                    {
                        sb.AppendFormat("DangNhap.login_fe('{0}');", Ma);
                    }
                    break;
                }
            }
            if (subAct != "dangky_home" && subAct != "Ho_tro_khach_hang")
            {
                sb.Append("});");
            }

            writer.Write(sb.ToString());
            base.Render(writer);
        }
コード例 #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        var id = Request["ID"];

        using (var con = DAL.con())
        {
            if (!string.IsNullOrEmpty(id))
            {
                Item            = ChoThueVayDal.SelectById(con, new Guid(id));
                ThanhLyIn.Item  = Item;;
                ThanhLyIn.Khach = KhachHangDal.SelectById(Item.KH_ID, con);
                var logoStr = DanhMucDal.SelectByMa("BAOCAO-HEADER-THUCHI", con).Description;
                ThanhLyIn.LogoStr = logoStr;
            }
        }
    }
コード例 #5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        var id = Request["ID"];

        using (var con = DAL.con())
        {
            Item = PhieuXuatNhapSanPhamDal.SelectById(con, new Guid(id));
            var phieuDichVuItem = PhieuDichVuDal.SelectById(con, Item.PDV_ID);
            var khachHangItem   = KhachHangDal.SelectById(phieuDichVuItem.KH_ID, con);

            Print.Item  = Item;
            Print.Khach = khachHangItem;

            var logoStr = DanhMucDal.SelectByMa("BAOCAO-HEADER-THUCHI", con).Description;
            Print.LogoStr = logoStr;
        }
    }
コード例 #6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        var id = Request["ID"];

        using (var con = DAL.con())
        {
            if (string.IsNullOrEmpty(id))
            {
                Item    = PhieuDichVuDal.SelectDraff(con);
                Item.Ma = Item.Ma == 0 ? 1 : Item.Ma + 1;
                Item.ID = Guid.NewGuid();
            }
            else
            {
                Item            = PhieuDichVuDal.SelectById(con, new Guid(id));
                Item._KhachHang = KhachHangDal.SelectById(Item.KH_ID, con);
            }
            var logoStr = DanhMucDal.SelectByMa("BAOCAO-HEADER-THUCHI", con).Description;
            Add.LogoStr = logoStr;
            Add.Item    = Item;;
        }
    }
コード例 #7
0
        public override void KhoiTao(SqlConnection con)
        {
            var sb = new StringBuilder();

            #region header
            sb.AppendFormat(@"
<div class=""{0}"">
    <div class=""box-header"">
        <a href=""{2}"" class=""box-header-label"">{1}</a>
    </div>
        <div class=""box-body"">", Css, Ten, Header_Url);
            #endregion
            var itemDm = DanhMucDal.SelectByMa(Ma, con);
            sb.Append(itemDm.Description);
            #region footer
            sb.AppendFormat(@"
        </div>
</div>");
            #endregion
            Html = sb.ToString();
            base.KhoiTao(con);
        }
コード例 #8
0
        public override void KhoiTao(SqlConnection con)
        {
            var sb     = new StringBuilder();
            var listDm = GetTree(DanhMucDal.SelectByLDMMa(con, "MENU"));
            var list1  = from p in listDm
                         where p.Level == 1
                         orderby p.ThuTu ascending
                         select p;

            sb.AppendFormat(@"
<div class=""bodyGlobal footer"">
    <div class=""boxGlobal"">
        <div class=""box1Global"">");
            var itemDm = DanhMucDal.SelectByMa("HETHONG-FOOTER", con);

            sb.Append(itemDm.Description);

            sb.AppendFormat(@"</div>                
    </div>
</div>");
            Html = sb.ToString();
            base.KhoiTao(con);
        }
コード例 #9
0
        protected override void Render(HtmlTextWriter writer)
        {
            var sb = new StringBuilder();
            var cs = this.Page.ClientScript;

            #region Tham số

            HttpContext c         = HttpContext.Current;
            var         TuNgay    = c.Request["TuNgay"];
            var         DenNgay   = c.Request["DenNgay"];
            var         dNow      = DateTime.Now;
            var         dauThang  = new DateTime(dNow.Year, 1, 1).ToString("yyyy-MM-dd");
            var         cuoiThang = new DateTime(dNow.Year, dNow.Month, 1).AddMonths(1).AddDays(-1).ToString("yyyy-MM-dd");

            TuNgay  = string.IsNullOrEmpty(TuNgay) ? dauThang : Convert.ToDateTime(TuNgay, new CultureInfo("vi-Vn")).ToString("yyyy-MM-dd");
            DenNgay = string.IsNullOrEmpty(DenNgay) ? cuoiThang : Convert.ToDateTime(DenNgay, new CultureInfo("vi-Vn")).ToString("yyyy-MM-dd");


            var             _q               = c.Request["q"];
            List <jgridRow> ListRow          = new List <jgridRow>();
            var             danhMucKyHieuChi = DanhMucDal.SelectByMa("TC-CHI");
            var             danhMucKyHieuThu = DanhMucDal.SelectByMa("TC-THU");
            #endregion
            switch (subAct)
            {
            case "get":
                #region lấy dữ liệu cho grid

                var pagerGet    = ThuChiReportDal.SelectTuNgayDenNgay(TuNgay, DenNgay);
                var prefixMaChi = danhMucKyHieuChi.KyHieu;
                var prefixMaThu = danhMucKyHieuThu.KyHieu;
                foreach (var item in pagerGet)
                {
                    ListRow.Add(new jgridRow(item.ma.ToString(), new string[]
                    {
                        item.ma.ToString()
                        ,
                        item.sophieu == "0" ? "" : string.Format("{0}{1}",
                                                                 (item.isthu
                                                                                                ? prefixMaThu
                                                                                                : prefixMaChi),
                                                                 item.sophieu)
                        , item.diengiai
                        , Lib.TienVietNam(item.thu_tk)
                        , Lib.TienVietNam(item.thu_tm)
                        , Lib.TienVietNam(item.thu_t)
                        , Lib.TienVietNam(item.chi_tk)
                        , Lib.TienVietNam(item.chi_tm)
                        , Lib.TienVietNam(item.chi_t)
                        , Lib.TienVietNam(item.tt_tk)
                        , Lib.TienVietNam(item.tt_tm)
                        , Lib.TienVietNam(item.tt_t)
                        , Lib.TienVietNam(item.sodu_tk)
                        , Lib.TienVietNam(item.sodu_tm)
                        , Lib.TienVietNam(item.sodu_t)
                        , item.loaiquy.ToString()
                        , item.isthu.ToString()
                        , item.isCandoi.ToString()
                        , item.ngay
                        , item.NguoiTao
                    }));
                }
                jgrid gridSPAdm = new jgrid(string.IsNullOrEmpty(jgrpage) ? "1" : jgrpage
                                            , "1"
                                            , pagerGet.Count.ToString()
                                            , ListRow);
                sb.Append(JavaScriptConvert.SerializeObject(gridSPAdm));
                break;

                #endregion
            case "scpt":
                #region Nạp js
                sb.AppendFormat(@"{0}"
                                , cs.GetWebResourceUrl(typeof(Class1), "appStore.commonStore.thuChiMgr.baoCaoThuChi.JScript1.js"));
                //sb.AppendFormat(@"{0}"
                //    , cs.GetWebResourceUrl(typeof(Class1), "appStore.commonStore.thuChiMgr.baoCaoThuChi.Publish.js"));
                break;

                #endregion
            default:
                #region nạp
                var listFn = FunctionDal.SelectByUserAndFNID(Security.Username, fnId);
                sb.Append(Lib.GetResource(Assembly.GetExecutingAssembly(), "baoCaoThuChi.mdl.htm"));
                sb.AppendFormat(@"<script>$.getScript('{0}',function(){1});</script>"
                                , cs.GetWebResourceUrl(typeof(Class1), "appStore.commonStore.thuChiMgr.baoCaoThuChi.JScript1.js")
                                , "{baoCaoThuChiFn.loadgrid();}");
                sb.AppendFormat("<script>adm.validFn('{0}');</script>", JavaScriptConvert.SerializeObject(listFn));
                break;
                #endregion
            }
            writer.Write(sb.ToString());
            base.Render(writer);
        }
コード例 #10
0
ファイル: Class1.cs プロジェクト: nhatkycon/AoCuoiHongNhung
        protected override void Render(HtmlTextWriter writer)
        {
            var sb = new StringBuilder();
            var cs = this.Page.ClientScript;

            #region Tham số

            HttpContext     c                   = HttpContext.Current;
            var             ID                  = c.Request["ID"];
            var             NDTC_ID             = c.Request["NDTC_ID"];
            var             SoPhieu             = c.Request["SoPhieu"];
            var             SoTien              = c.Request["SoTien"];
            var             Mota                = c.Request["Mota"];
            var             NgayTao             = c.Request["NgayTao"];
            var             NguoiTao            = c.Request["NguoiTao"];
            var             NgaySua             = c.Request["NgaySua"];
            var             NguoiSua            = c.Request["NguoiSua"];
            var             LoaiQuy             = c.Request["LoaiQuy"];
            var             LoaiCandoi          = c.Request["LoaiCandoi"];
            var             isCandoi            = c.Request["isCandoi"];
            var             Thu                 = c.Request["Thu"];
            var             XN_ID               = c.Request["XN_ID"];
            var             P_ID                = c.Request["P_ID"];
            var             DV_ID               = c.Request["DV_ID"];
            var             TuNgay              = c.Request["TuNgay"];
            var             DenNgay             = c.Request["DenNgay"];
            var             _q                  = c.Request["q"];
            List <jgridRow> ListRow             = new List <jgridRow>();
            var             danhMucKyHieu       = DanhMucDal.SelectByMa("TC-THU");
            var             danhMucReportHeader = DanhMucDal.SelectByMa("BAOCAO-HEADER-THUCHI");
            var             danhMucReportFooter = DanhMucDal.SelectByMa("BAOCAO-FOOTER-THUCHI");
            var             draff               = Request["draff"];
            var             isThu               = true;
            #endregion
            switch (subAct)
            {
            case "get":
                #region lấy dữ liệu cho grid

                var pagerGet = ThuChiDal.pagerTuNgayDenNgay(jgrsidx + " " + jgrsord, _q, Convert.ToInt32(jgRows),
                                                            isThu, TuNgay, DenNgay, NDTC_ID, null, true);
                string prefixMas = danhMucKyHieu.KyHieu;
                foreach (var item in pagerGet.List)
                {
                    ListRow.Add(new jgridRow(item.ID.ToString(), new string[] {
                        item.ID.ToString()
                        , item.NDTC_Ten
                        , prefixMas + item.SoPhieu
                        , item.P_Ten
                        , item.Mota
                        , item.NgayTao.ToString("dd-MM-yyyy")
                        , Lib.TienVietNam(item.SoTien)
                        , item.NguoiTao_Ten
                        , (item.NguoiTao == Security.Username).ToString()
                        , (item.XN_ID != Guid.Empty).ToString()
                        , (item.DV_ID != Guid.Empty).ToString()
                    }));
                }
                jgrid gridSPAdm = new jgrid(string.IsNullOrEmpty(jgrpage) ? "1" : jgrpage
                                            , pagerGet.TotalPages.ToString()
                                            , pagerGet.Total.ToString()
                                            , ListRow);
                sb.Append(JavaScriptConvert.SerializeObject(gridSPAdm));
                break;

                #endregion
            case "del":
                #region xóa
                if (!string.IsNullOrEmpty(ID))
                {
                    ThuChiDal.DeleteById(new Guid(ID));
                }
                break;

                #endregion
            case "edit":
                #region chỉnh sửa
                if (!string.IsNullOrEmpty(ID))
                {
                    var    item     = ThuChiDal.SelectById(new Guid(ID));
                    string prefixMa = danhMucKyHieu.KyHieu;
                    item.SoPhieu = prefixMa + item.SoPhieu;
                    sb.AppendFormat("({0})", JavaScriptConvert.SerializeObject(item));
                }
                break;

                #endregion
            case "draff":
                #region draff
                if (Security.IsAuthenticated())
                {
                    var    item     = ThuChiDal.SelectByDraff(isThu);
                    string prefixMa = danhMucKyHieu.KyHieu;
                    item.SoPhieu = prefixMa + item.SoPhieu;
                    sb.AppendFormat("({0})", JavaScriptConvert.SerializeObject(item));
                }
                break;

                #endregion
            case "save":
                #region save
                if (Security.IsAuthenticated())
                {
                    var item     = draff == "1" ? new ThuChi() : ThuChiDal.SelectById(new Guid(ID));
                    var prefixMa = danhMucKyHieu.KyHieu;
                    SoPhieu      = SoPhieu.Replace(prefixMa, "");
                    item.SoPhieu = SoPhieu;
                    if (!string.IsNullOrEmpty(DV_ID))
                    {
                        item.DV_ID = new Guid(DV_ID);
                    }
                    item.LoaiCandoi = Convert.ToInt32(LoaiCandoi);
                    item.LoaiQuy    = Convert.ToInt32(LoaiQuy);
                    item.Mota       = Mota;
                    if (!string.IsNullOrEmpty(NDTC_ID))
                    {
                        item.NDTC_ID = new Guid(NDTC_ID);
                    }
                    item.NgaySua  = DateTime.Now;
                    item.NguoiSua = Security.Username;
                    if (!string.IsNullOrEmpty(P_ID))
                    {
                        item.P_ID = new Guid(P_ID);
                    }
                    item.SoTien = Convert.ToDouble(SoTien);
                    item.Thu    = isThu;
                    if (!string.IsNullOrEmpty(XN_ID))
                    {
                        item.XN_ID = new Guid(XN_ID);
                    }
                    item.isCandoi = true;
                    item.NgayTao  = Convert.ToDateTime(NgayTao, new CultureInfo("vi-Vn"));

                    if (draff == "1")
                    {
                        item.ID       = new Guid(ID);
                        item.NguoiTao = NguoiTao;
                        item          = ThuChiDal.Insert(item);
                    }
                    else
                    {
                        item = ThuChiDal.Update(item);
                    }
                    // TODO: Tiếp tục phần thu chi
                    sb.Append("1");
                }
                break;

                #endregion
            case "reports":
                #region bao cao
                if (!string.IsNullOrEmpty(ID))
                {
                    var itemIn = Lib.GetResource(Assembly.GetExecutingAssembly(), "quanLyThuDauKy.in-natural.htm");
                    var item   = ThuChiDal.SelectById(new Guid(ID));
                    sb.AppendFormat(itemIn
                                    , string.Format("Ng&agrave;y {4}{0} th&aacute;ng {3}{1} năm {2}", item.NgayTao.Day, item.NgayTao.Month, item.NgayTao.Year, item.NgayTao.Month < 10 ? "0" : "", item.NgayTao.Day < 10 ? "0" : "")
                                    , item.NDTC_Ten
                                    , string.Format("{0}{1}", danhMucKyHieu.KyHieu, item.SoPhieu)
                                    , (item.LoaiQuy == 1 ? "Tài khoản" : "Tiền mặt")
                                    , Lib.TienVietNam(item.SoTien)
                                    , Lib.So_chu(item.SoTien)
                                    , item.P_Ten
                                    , item.NguoiTao_Ten
                                    , item.Mota
                                    , domain
                                    , danhMucReportHeader.Description
                                    , danhMucReportFooter.Description);
                }

                break;

                #endregion
            case "scpt":
                #region Nạp js
                sb.AppendFormat(@"{0}"
                                , cs.GetWebResourceUrl(typeof(Class1), "appStore.commonStore.thuChiMgr.quanLyThuDauKy.JScript1.js"));
                //sb.AppendFormat(@"{0}"
                //    , cs.GetWebResourceUrl(typeof(Class1), "appStore.commonStore.thuChiMgr.quanLyThuDauKy.Publish.js"));
                break;

                #endregion
            default:
                #region nạp
                var listFn = FunctionDal.SelectByUserAndFNID(Security.Username, fnId);
                sb.Append(Lib.GetResource(Assembly.GetExecutingAssembly(), "quanLyThuDauKy.mdl.htm"));
                sb.AppendFormat(@"<script>$.getScript('{0}',function(){1});</script>"
                                , cs.GetWebResourceUrl(typeof(Class1), "appStore.commonStore.thuChiMgr.quanLyThuDauKy.JScript1.js")
                                , "{quanLyThuDauKyDauKyFn.loadgrid();}");
                sb.AppendFormat("<script>adm.validFn('{0}');</script>", JavaScriptConvert.SerializeObject(listFn));
                break;
                #endregion
            }
            writer.Write(sb.ToString());
            base.Render(writer);
        }
コード例 #11
0
    protected void Page_Load(object sender, EventArgs e)
    {
        var id    = Request["ID"];
        var khId  = Request["KH_ID"];
        var pdvId = Request["PDV_ID"];
        var ctvId = Request["CTV_ID"];
        var pgvId = Request["PGV_ID"];
        var pbhId = Request["PBH_ID"];

        using (var con = DAL.con())
        {
            if (string.IsNullOrEmpty(id))
            {
                Item = ThuChiDal.SelectByDraff(con, true);
                if (khId != null && khId.Length >= 36)
                {
                    khId = khId.Substring(khId.LastIndexOf(',') + 1);
                    var kh = KhachHangDal.SelectById(new Guid(khId), con);
                    Item.P_Ten = kh.Ten;
                    Item.P_ID  = kh.ID;
                }


                if (pdvId != null && pdvId.Length >= 36)
                {
                    pdvId = pdvId.Substring(pdvId.LastIndexOf(',') + 1);
                    var pdv = PhieuDichVuDal.SelectById(con, new Guid(pdvId));
                    Item.PDV_ID = pdv.ID;
                    Item.PDV_Ma = pdv.Ma;
                    var kh = KhachHangDal.SelectById(pdv.KH_ID, con);
                    Item.P_Ten = kh.Ten;
                    Item.P_ID  = kh.ID;
                }

                if (ctvId != null && ctvId.Length >= 36)
                {
                    ctvId = ctvId.Substring(ctvId.LastIndexOf(',') + 1);
                    var ctv = ChoThueVayDal.SelectById(con, new Guid(ctvId));
                    Item.CTV_ID = ctv.ID;
                    Item.CTV_Ma = ctv.Ma;
                    var kh = KhachHangDal.SelectById(ctv.KH_ID, con);
                    Item.P_Ten = kh.Ten;
                    Item.P_ID  = kh.ID;
                }

                if (pgvId != null && pgvId.Length >= 36)
                {
                    pgvId = pgvId.Substring(pgvId.LastIndexOf(',') + 1);
                    var pgv = PhieuGiatVayDal.SelectById(con, new Guid(pgvId));
                    Item.PGV_ID = pgv.ID;
                    Item.PGV_Ma = pgv.Ma;
                }
                if (pbhId != null && pbhId.Length >= 36)
                {
                    pbhId = pbhId.Substring(pgvId.LastIndexOf(',') + 1);
                    var pbh = PhieuBaoHongDal.SelectById(con, new Guid(pbhId));
                    Item.PBH_ID = pbh.ID;
                    Item.PBH_Ma = pbh.Ma;
                }
            }
            else
            {
                Item = ThuChiDal.SelectById(con, new Guid(id));
            }
            var logoStr = DanhMucDal.SelectByMa("BAOCAO-HEADER-THUCHI", con).Description;
            InPhieuChi.LogoStr = logoStr;
            var listLoai = DanhMucDal.SelectByLDMMa(con, "NDTC-CHI");
            InPhieuChi.ListLoai = listLoai;
            InPhieuChi.Item     = Item;
        }
    }
コード例 #12
0
ファイル: Class1.cs プロジェクト: nhatkycon/AoCuoiHongNhung
        protected override void Render(HtmlTextWriter writer)
        {
            var sb = new StringBuilder();
            var cs = this.Page.ClientScript;

            #region Tham số

            var _ID = Request["ID"];
            if (string.IsNullOrEmpty(_ID))
            {
                _ID = Guid.Empty.ToString();
            }
            var         No      = Request["No"];
            HttpContext c       = HttpContext.Current;
            var         listRow = new List <jgridRow>();
            #endregion
            switch (subAct)
            {
            case "get":
                #region lấy dữ liệu cho grid

                foreach (var item in KhachHangDal.SelectCongNo(No))
                {
                    listRow.Add(new jgridRow(item.ID.ToString(), new string[]
                    {
                        item.ID.ToString()
                        , item.Ten
                        , Lib.TienVietNam(item.CongNoDauKy)
                        , Lib.TienVietNam(item.TongNhap)
                        , Lib.TienVietNam(item.TongXuat)
                        , Lib.TienVietNam(item.TongThu)
                        , Lib.TienVietNam(item.TongChi)
                        , Lib.TienVietNam(item.TongDichVu)
                        , Lib.TienVietNam(item.CongNo)
                    }));
                }
                var gridSpAdm = new jgrid(string.IsNullOrEmpty(jgrpage) ? "1" : jgrpage
                                          , "1"
                                          , "1000"
                                          , listRow);
                sb.Append(JavaScriptConvert.SerializeObject(gridSpAdm));
                break;

                #endregion
            case "getSubXuat":
                #region getSubXuat
                if (!string.IsNullOrEmpty(_ID))
                {
                    var danhMucLoaiXuatNhap = DanhMucDal.SelectByMa("LXN-X");
                    var pagerGet            = XuatNhapDal.pagerXuatNhap(true.ToString(), false.ToString(), false.ToString(), false.ToString(), _ID,
                                                                        jgrsidx + " " + jgrsord, string.Empty,
                                                                        Convert.ToInt32(jgRows));
                    string prefixMas = danhMucLoaiXuatNhap.KyHieu;
                    foreach (var item in pagerGet.List)
                    {
                        listRow.Add(new jgridRow(item.ID.ToString(), new string[] {
                            item.ID.ToString()
                            , item.LOAI_Ten
                            , prefixMas + item.Ma
                            , item.KH_Ten
                            , item.NgayHoaDon.ToString("dd-MM-yyyy")
                            , Lib.TienVietNam(item.CongTienHang)
                            , Lib.TienVietNam(item.VAT)
                            , Lib.TienVietNam(item.ChietKhau)
                            , Lib.TienVietNam(item.CongTienHang + item.VAT - item.ChietKhau)
                            , Lib.TienVietNam(item.ThanhToan)
                            , Lib.TienVietNam(item.ConNo)
                            , string.Format("{0:dd/MM/yy}", item.NgayCapNhat)
                        }));
                    }
                    jgrid gridSPAdm = new jgrid(string.IsNullOrEmpty(jgrpage) ? "1" : jgrpage
                                                , pagerGet.TotalPages.ToString()
                                                , pagerGet.Total.ToString()
                                                , listRow);
                    sb.Append(JavaScriptConvert.SerializeObject(gridSPAdm));
                }
                break;

                #endregion
            case "getSubNhap":
                #region getSubNhap
                if (!string.IsNullOrEmpty(_ID))
                {
                    var danhMucLoaiXuatNhap = DanhMucDal.SelectByMa("LXN-N");
                    var pagerGet            = XuatNhapDal.pagerXuatNhap(false.ToString(), false.ToString(), false.ToString(), false.ToString(), _ID,
                                                                        jgrsidx + " " + jgrsord, string.Empty,
                                                                        Convert.ToInt32(jgRows));
                    string prefixMas = danhMucLoaiXuatNhap.KyHieu;
                    foreach (var item in pagerGet.List)
                    {
                        listRow.Add(new jgridRow(item.ID.ToString(), new string[] {
                            item.ID.ToString()
                            , item.LOAI_Ten
                            , prefixMas + item.Ma
                            , item.KH_Ten
                            , item.NgayHoaDon.ToString("dd-MM-yyyy")
                            , Lib.TienVietNam(item.CongTienHang)
                            , Lib.TienVietNam(item.VAT)
                            , Lib.TienVietNam(item.ChietKhau)
                            , Lib.TienVietNam(item.CongTienHang + item.VAT - item.ChietKhau)
                            , Lib.TienVietNam(item.ThanhToan)
                            , Lib.TienVietNam(item.ConNo)
                            , string.Format("{0:dd/MM/yy}", item.NgayCapNhat)
                        }));
                    }
                    jgrid gridSPAdm = new jgrid(string.IsNullOrEmpty(jgrpage) ? "1" : jgrpage
                                                , pagerGet.TotalPages.ToString()
                                                , pagerGet.Total.ToString()
                                                , listRow);
                    sb.Append(JavaScriptConvert.SerializeObject(gridSPAdm));
                }
                break;

                #endregion
            case "getSubThu":
                #region getSubThu
                if (!string.IsNullOrEmpty(_ID))
                {
                    var pagerGet = ThuChiDal.pagerTuNgayDenNgay(jgrsidx + " " + jgrsord, null,
                                                                Convert.ToInt32(jgRows),
                                                                true, null, null, null, _ID);
                    var    danhMucKyHieu = DanhMucDal.SelectByMa("TC-THU");
                    string prefixMas     = danhMucKyHieu.KyHieu;
                    foreach (var item in pagerGet.List)
                    {
                        listRow.Add(new jgridRow(item.ID.ToString(), new string[] {
                            item.ID.ToString()
                            , item.NDTC_Ten
                            , prefixMas + item.SoPhieu
                            , item.P_Ten
                            , item.Mota
                            , item.NgayTao.ToString("dd-MM-yyyy")
                            , Lib.TienVietNam(item.SoTien)
                            , item.NguoiTao_Ten
                            , (item.NguoiTao == Security.Username).ToString()
                            , (item.XN_ID != Guid.Empty).ToString()
                            , (item.DV_ID != Guid.Empty).ToString()
                        }));
                    }
                    jgrid gridSPAdm = new jgrid(string.IsNullOrEmpty(jgrpage) ? "1" : jgrpage
                                                , pagerGet.TotalPages.ToString()
                                                , pagerGet.Total.ToString()
                                                , listRow);
                    sb.Append(JavaScriptConvert.SerializeObject(gridSPAdm));
                }

                break;

                #endregion
            case "getSubChi":
                #region lấy dữ liệu cho getSubThu
                if (!string.IsNullOrEmpty(_ID))
                {
                    var pagerGet = ThuChiDal.pagerTuNgayDenNgay(jgrsidx + " " + jgrsord, null,
                                                                Convert.ToInt32(jgRows),
                                                                false, null, null, null, _ID);
                    var    danhMucKyHieu = DanhMucDal.SelectByMa("TC-CHI");
                    string prefixMas     = danhMucKyHieu.KyHieu;
                    foreach (var item in pagerGet.List)
                    {
                        listRow.Add(new jgridRow(item.ID.ToString(), new string[] {
                            item.ID.ToString()
                            , item.NDTC_Ten
                            , prefixMas + item.SoPhieu
                            , item.P_Ten
                            , item.Mota
                            , item.NgayTao.ToString("dd-MM-yyyy")
                            , Lib.TienVietNam(item.SoTien)
                            , item.NguoiTao_Ten
                            , (item.NguoiTao == Security.Username).ToString()
                            , (item.XN_ID != Guid.Empty).ToString()
                            , (item.DV_ID != Guid.Empty).ToString()
                        }));
                    }
                    jgrid gridSPAdm = new jgrid(string.IsNullOrEmpty(jgrpage) ? "1" : jgrpage
                                                , pagerGet.TotalPages.ToString()
                                                , pagerGet.Total.ToString()
                                                , listRow);
                    sb.Append(JavaScriptConvert.SerializeObject(gridSPAdm));
                }

                break;

                #endregion
            case "scpt":
                #region Nạp js
                sb.AppendFormat(@"{0}"
                                , cs.GetWebResourceUrl(typeof(Class1), "appStore.commonStore.thuChiMgr.baoCaoNo.JScript1.js"));
                //sb.AppendFormat(@"{0}"
                //    , cs.GetWebResourceUrl(typeof(Class1), "appStore.commonStore.thuChiMgr.baoCaoNo.Publish.js"));
                break;

                #endregion
            default:
                #region nạp
                var listFn = FunctionDal.SelectByUserAndFNID(Security.Username, fnId);
                sb.Append(Lib.GetResource(Assembly.GetExecutingAssembly(), "baoCaoNo.mdl.htm"));
                sb.AppendFormat(@"<script>$.getScript('{0}',function(){1});</script>"
                                , cs.GetWebResourceUrl(typeof(Class1), "appStore.commonStore.thuChiMgr.baoCaoNo.JScript1.js")
                                , "{baoCaoNoFn.loadgrid();}");
                sb.AppendFormat("<script>adm.validFn('{0}');</script>", JavaScriptConvert.SerializeObject(listFn));
                break;
                #endregion
            }
            writer.Write(sb.ToString());
            base.Render(writer);
        }