public static String get_objChiTietVatTu(String ParentID, String iDM_MaNhomPhu, String iDM_MaChiTietVatTu)
        {
            String strChiTietVatTu = String.Empty;
            String DK = String.Empty;
            String tg = "0";
            DataTable dt = null;
            SqlCommand cmd;
            if (iDM_MaNhomPhu == "") iDM_MaNhomPhu = "dddddddd-dddd-dddd-dddd-dddddddddddd";

            if (!string.IsNullOrEmpty(iDM_MaNhomPhu) && iDM_MaNhomPhu != "dddddddd-dddd-dddd-dddd-dddddddddddd")
            {
                DK = " AND iID_MaDanhMucCha = '" + iDM_MaNhomPhu + "'";
                if (iDM_MaNhomPhu == "null")
                    tg = "1";
            }
            else
                iDM_MaChiTietVatTu = "";

            if (tg == "0")
            {
                if (iDM_MaNhomPhu == "dddddddd-dddd-dddd-dddd-dddddddddddd")
                {
                    dt = new DataTable();
                    dt.Columns.Add("iID_MaDanhMuc");
                    dt.Columns.Add("sTenKhoa");
                    DataRow R = dt.NewRow();
                    R["iID_MaDanhMuc"] = "dddddddd-dddd-dddd-dddd-dddddddddddd";
                    R["sTenKhoa"] = "-- Chi tiết vật tư --";
                    dt.Rows.InsertAt(R, 0);
                }
                else
                {
                    cmd = new SqlCommand("SELECT iID_MaDanhMuc, sTenKhoa FROM DC_DanhMuc " +
                    "WHERE bHoatDong = 1" + DK + " AND iID_MaLoaiDanhMuc = (SELECT iID_MaLoaiDanhMuc " +
                                                                "FROM DC_LoaiDanhMuc " +
                                                                "WHERE sTenBang = 'ChiTietVatTu') ORDER BY sTenKhoa");
                    dt = Connection.GetDataTable(cmd);
                    DataRow R = dt.NewRow();
                    R["iID_MaDanhMuc"] = "dddddddd-dddd-dddd-dddd-dddddddddddd";
                    R["sTenKhoa"] = "-- Chi tiết vật tư --";
                    dt.Rows.InsertAt(R, 0);
                    cmd.Dispose();
                }
            }
            else
            {
                dt = new DataTable();
                dt.Columns.Add("iID_MaDanhMuc");
                dt.Columns.Add("sTenKhoa");
                DataRow R = dt.NewRow();
                R["iID_MaDanhMuc"] = "dddddddd-dddd-dddd-dddd-dddddddddddd";
                R["sTenKhoa"] = "-- Chi tiết vật tư --";
                dt.Rows.InsertAt(R, 0);
            }
            SelectOptionList slChiTietVatTu = new SelectOptionList(dt, "iID_MaDanhMuc", "sTenKhoa");
            strChiTietVatTu = MyHtmlHelper.DropDownList(ParentID, slChiTietVatTu, iDM_MaChiTietVatTu, "iDM_MaChiTietVatTu", "", "style=\"width: 100%;\"");

            return strChiTietVatTu;
        }
Beispiel #2
0
        public async Task <IActionResult> ManageRoles([FromBody] SelectOptionList roleList)
        {
            if (!roleList.SelectOptionViewModels.Any())
            {
                return(BadRequest());
            }
            await _accountRepository.ManageRoles(roleList);

            return(Ok());
        }
        public async Task ManageRoles(SelectOptionList roles)
        {
            var roleList = await GetUserRoles();

            //when add new role value and label will be the same
            var roleToAdd    = roles.SelectOptionViewModels.Where(x => x.Label == x.Value).ToList();
            var roleToRemove = roleList.Where(existingRole => roles.SelectOptionViewModels
                                              .All(item => item.Value != existingRole.Id && existingRole.Name != "Administrator")).ToList();

            using (var transaction = new TransactionScope(TransactionScopeAsyncFlowOption.Enabled))
            {
                try
                {
                    if (roleToRemove.Any())
                    {
                        var roleName = roleToRemove.Select(x => x.Name).ToArray();
                        foreach (var roleRemove in roleToRemove)
                        {
                            var userInRole = await _userService.GetListRoleOfUser(roleRemove.Name);

                            if (!userInRole.Any())
                            {
                                continue;
                            }
                            foreach (var user in userInRole)
                            {
                                await _userService.RemoveFromRolesAsync(user, roleName);
                            }

                            var role = await _unitOfWork.Repository <IdentityRole>().FindAsync(x =>
                                                                                               x.Name.Equals(roleRemove.Name, StringComparison.OrdinalIgnoreCase));

                            await _unitOfWork.Repository <IdentityRole>().DeleteAsync(role);
                        }
                    }

                    if (roleToAdd.Any())
                    {
                        var roleName = roleToAdd.Select(x => x.Label).ToArray();
                        await _userService.AddUserRoles(roleName);
                    }

                    transaction.Complete();
                }
                catch (Exception)
                {
                    _unitOfWork.Rollback();
                }
            }
        }
        public static String get_objMucLucNganSach(String ParentID, String sLNS)
        {
            String strDanhMucDuAn = string.Empty;
            DataTable dt = DanhMucModels.NS_LoaiNganSach_Ma_Con(sLNS);
            if (dt.Rows.Count == 0)
            {
                DataRow R = dt.NewRow();
                R["iID_MaMucLucNganSach"] = "00000000-0000-0000-0000-000000000000";
                R["TenHT"] = "--- Danh sách mục lục ngân sách ---";
                dt.Rows.InsertAt(R, 0);
            }

            SelectOptionList slDanhMucDuan = new SelectOptionList(dt, "iID_MaMucLucNganSach", "TenHT");
            strDanhMucDuAn = MyHtmlHelper.DropDownList(ParentID, slDanhMucDuan, "", "iID_MaMucLucNganSach", null, "SIZE=\"30\" class=\"input1_2\"");

            return "<div>" + strDanhMucDuAn + "</div>";
        }
        public String get_sNgayThang(String ParentID, String MaND, String iThang, String iNgay)
        {
            String iNamLamViec = DateTime.Now.ToString();
            DataTable dtCauHinh = NguoiDungCauHinhModels.LayCauHinh(MaND);

            iNamLamViec = dtCauHinh.Rows[0]["iNamLamViec"].ToString();
            if (iThang == "-1")
            {
                iThang = dtCauHinh.Rows[0]["iThangLamViec"].ToString();
            }

            dtCauHinh.Dispose();
            DataTable dtNgay = DanhMucModels.DT_Ngay(Convert.ToInt16(iThang), Convert.ToInt16(iNamLamViec), true);
            SelectOptionList slNgay = new SelectOptionList(dtNgay, "MaNgay", "TenNgay");
            String S = MyHtmlHelper.DropDownList(ParentID, slNgay, iNgay, "iNgay", "", "style=\"width:55px;padding:2px;border:1px solid #dedede;\"");
            dtNgay.Dispose();

            return S;
        }
Beispiel #6
0
 public ActionResult Create()
 {
     if (HamChung.CoQuyenXemTheoMenu(Request.Url.AbsolutePath, User.Identity.Name))
     {
         Dictionary<string, object> dicData = bang.LayGoiDuLieu(null, true);
         String SQL = "SELECT iID_MaLuat, sTen FROM PQ_Luat ORDER BY sTen";
         DataTable dt = Connection.GetDataTable(SQL);
         DataRow R = dt.NewRow();
         dt.Rows.InsertAt(R, 0);
         //R["iID_MaLuat"] = "-1";
         R["sTen"] = "Tạo mới";
         dicData["slLuat"] = new SelectOptionList(dt, "iID_MaLuat", "sTen");
         NameValueCollection data = (NameValueCollection) dicData["data"];
         dicData["DuLieuMoi"] = "1";
         ViewData[bang.TenBang + "_dicData"] = dicData;
         return View(sViewPath + "Edit.aspx");
     }
     else
     {
         return RedirectToAction("Index", "PermitionMessage");
     }
 }
        public static String get_objDonVi_PhongBan(String ParentID, String MaND, String iID_MaDonVi, String iNamLamViec)
        {
            String strDanhMucDuAn = string.Empty;
            String iID_MaPhongBan = NguoiDung_PhongBanModels.getMaPhongBan_NguoiDung(MaND);
            if (string.IsNullOrEmpty(MaND) == false)
            {
                String strSQL = String.Format(@"SELECT iID_MaDonVi,sTen FROM NS_DonVi WHERE iNamLamViec_DonVi=@iNamLamViec_DonVi AND iID_MaPhongBan = @iID_MaPhongBan AND iTrangThai = 1 AND iID_MaDonVi IN (SELECT iID_MaDonVi FROM NS_NguoiDung_DonVi WHERE iTrangThai=1 AND iNamLamViec=@iNamLamViec_DonVi AND  sMaNguoiDung = @sMaNguoiDung) ORDER BY iID_MaDonVi");
                SqlCommand cmd = new SqlCommand();
                cmd.CommandText = strSQL;
                cmd.Parameters.AddWithValue("@iNamLamViec_DonVi", iNamLamViec);
                cmd.Parameters.AddWithValue("@iID_MaPhongBan", iID_MaPhongBan);
                cmd.Parameters.AddWithValue("@sMaNguoiDung", MaND);
               // DataTable dt = Connection.GetDataTable(cmd);
                DataTable dt = NganSach_HamChungModels.DSDonViCuaNguoiDung(MaND);
                DataRow R = dt.NewRow();
                R["iID_MaDonVi"] = "";
                R["sTen"] = "--- Danh sách đơn vị ---";
                dt.Rows.InsertAt(R, 0);

                SelectOptionList slDanhMucDuan = new SelectOptionList(dt, "iID_MaDonVi", "sTen");
                strDanhMucDuAn = MyHtmlHelper.DropDownList(ParentID, slDanhMucDuan, iID_MaDonVi, "iID_MaDonVi", null, "class=\"input1_2\"");
            }
            return strDanhMucDuAn;
        }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="ParentID"></param>
 /// <param name="iThang">Tháng</param>
 /// <param name="iNam">Năm</param>
 /// <param name="iMaDV">Mã đơn vị</param>
 /// <returns></returns>
 public String obj_DSDonvi(String ParentID, String iThang, String iID_MaTrangThaiDuyet, String iMaDV,String MaND)
 {
     String dsDV = "";
     DataTable dtDonvi = GetDonvi(iThang, iID_MaTrangThaiDuyet,MaND);
     SelectOptionList slDonvi = new SelectOptionList(dtDonvi, "iID_MaDonVi", "sTen");
     dsDV = MyHtmlHelper.DropDownList(ParentID, slDonvi, iMaDV, "iID_MaDonVi", "", "class=\"input1_2\" style=\"width: 140px; padding:2px;\"");
     return dsDV;
 }
 public String obj_DSDonVi(String ParentID, String MaND, String iID_MaDonVi,String iID_MaTrangThaiDuyet)
 {
     String dsDonVi = "";
     DataTable dtDonVi = DanhSachDonVi(MaND,iID_MaTrangThaiDuyet);
     SelectOptionList slDonVi = new SelectOptionList(dtDonVi, "iID_MaDonVi", "sTen");
     dsDonVi = MyHtmlHelper.DropDownList(ParentID, slDonVi, iID_MaDonVi, "iID_MaDonVi", "", "class=\"input1_2\" style=\"width: 100%\"");
     return dsDonVi;
 }
 public Object obj_DSDonVi(String ParentID, String iID_MaPhongBan, String iID_MaTrangThaiDuyet, String sLNS, String Thang_Quy, String LoaiThang_Quy, String iID_MaDonVi, String TruongTien, String MaND)
 {
     String dsDonVi = "", dsLNS = "";
     DataTable dtLNS = NS_LoaiNganSachNghiepVuKhac_PhongBan(iID_MaPhongBan);
     SelectOptionList slLNS = new SelectOptionList(dtLNS, "sLNS", "TenHT");
     dsLNS = MyHtmlHelper.DropDownList(ParentID, slLNS, sLNS, "sLNS", "", "class=\"input1_2\" style=\"width: 99%\" onchange=\"ChonLNS();\"");
     DataTable dtDonVi = LayDSDonVi(iID_MaPhongBan, iID_MaTrangThaiDuyet, sLNS, Thang_Quy, LoaiThang_Quy, TruongTien, MaND);
     SelectOptionList slDonVi = new SelectOptionList(dtDonVi, "iID_MaDonVi", "sTen");
     dsDonVi = MyHtmlHelper.DropDownList(ParentID, slDonVi, iID_MaDonVi, "iID_MaDonVi", "", "class=\"input1_2\" style=\"width: 99%\" onchange=\"ChonDV();\" ");
     String sSoQT = SoQuyetToan(iID_MaPhongBan, iID_MaTrangThaiDuyet, Thang_Quy, iID_MaDonVi, LoaiThang_Quy, sLNS, TruongTien, MaND);
     String sTongQT = TongQuyetToan(iID_MaPhongBan, iID_MaTrangThaiDuyet, Thang_Quy, iID_MaDonVi, LoaiThang_Quy, sLNS, TruongTien, MaND);
     item = new
     {
         dsDonVi = dsDonVi,
         dsLNS = dsLNS,
         sSoQT = sSoQT,
         sTongQT = sTongQT
     };
     return item;
 }
 public String obj_QLDA(String ParentID, String iID_MaDotCapPhat, String MaND, String MaTien)
 {
     String dNgayLap = "01/01/2000";
     DataTable dtDotCapPhat = QLDA_ReportModel.dt_DotCapPhat(MaND);
     for (int i = 0; i < dtDotCapPhat.Rows.Count; i++)
     {
         if (iID_MaDotCapPhat == dtDotCapPhat.Rows[i]["iID_MaDotCapPhat"].ToString())
         {
             dNgayLap = dtDotCapPhat.Rows[i]["dNgayCapPhat"].ToString();
             break;
         }
     }
     dtDotCapPhat.Dispose();
     DataTable dtNgoaiTe = QLDA_ReportModel.dt_LoaiTien_CP_03(dNgayLap, MaND);
     SelectOptionList slNgoaiTe = new SelectOptionList(dtNgoaiTe, "iID_MaNgoaiTe", "sTenNgoaiTe");
     String NgoaiTe = MyHtmlHelper.DropDownList(ParentID, slNgoaiTe, MaTien, "MaTien", "", "class=\"input1_2\" style=\"width: 80%\"");
     dtNgoaiTe.Dispose();
     return NgoaiTe;
 }
 public String obj_To(String ParentID, String iID_MaTrangThaiDuyet, String Thang_Quy, String RutGon, String MaND, String KhoGiay, String ToSo, String sLNS, String TruongTien)
 {
     DataTable dtToSo = dtTo(iID_MaTrangThaiDuyet, Thang_Quy, RutGon, MaND, KhoGiay, sLNS, TruongTien);
     SelectOptionList slToSo = new SelectOptionList(dtToSo, "MaTo", "TenTo");
     String s = MyHtmlHelper.DropDownList(ParentID, slToSo, ToSo, "ToSo", "", "class=\"input1_2\" style=\"width: 50%\"");
     return s;
 }
        public Data obj_DonViTheoLNS(String ParentID, String MaND, String ThangQuy, String LoaiThang_Quy, String iID_MaDonVi, String iID_MaNhomDonVi, String iID_MaTrangThaiDuyet)
        {
            Data _data = new Data();

            DataTable dtDonvi = HienThiDonViTheoNam(MaND, ThangQuy, LoaiThang_Quy, iID_MaTrangThaiDuyet);
            SelectOptionList sldonvi = new SelectOptionList(dtDonvi, "iID_MaDonVi", "sTen");
            _data.DV = MyHtmlHelper.DropDownList(ParentID, sldonvi, iID_MaDonVi, "iID_MaDonVi", "", "class=\"input1_2\" style=\"width: 120px;\"");

            DataTable dtNhomDV = DS_NhomDonVi(MaND, ThangQuy, LoaiThang_Quy, iID_MaTrangThaiDuyet);
            SelectOptionList sliID_MaNhomDonVi = new SelectOptionList(dtNhomDV, "iID_MaNhomDonVi", "TenNhom");
            _data.NDV = MyHtmlHelper.DropDownList(ParentID, sliID_MaNhomDonVi, iID_MaNhomDonVi, "iID_MaNhomDonVi", "", "class=\"input1_2\" style=\"width: 120px; padding:2px;\"");
            return _data;
        }
        public LCPData obj_NgayCapPhat(String ParentID, String iID_MaTrangThaiDuyet, String iID_MaDonVi, String dNgayCapPhat, String iDM_MaLoaiCapPhat, String LuyKe,String MaND)
        {
            LCPData _LCPData = new LCPData();
            DataTable dtNgayCapPhat = DanhSach_Ngay_CapPhat(iDM_MaLoaiCapPhat, iID_MaTrangThaiDuyet,MaND);
            SelectOptionList slNgayCapPhat = new SelectOptionList(dtNgayCapPhat, "dNgayCapPhat", "dNgayCapPhat");
            _LCPData.NgayCapPhat = MyHtmlHelper.DropDownList(ParentID, slNgayCapPhat, dNgayCapPhat, "dNgayCapPhat", "", "class=\"input1_2\" style=\"width: 100%\" onchange=\"ChonNCP()\" ");

            if (dNgayCapPhat.StartsWith("--"))
            {
                dNgayCapPhat = "01/01/2000";
            }

            DataTable dtDonVi = DanhSach_DonVi(iID_MaTrangThaiDuyet, dNgayCapPhat, LuyKe, iDM_MaLoaiCapPhat,MaND);
            SelectOptionList slDonVi = new SelectOptionList(dtDonVi, "iID_MaDonVi", "sTen");
            _LCPData.DonVi = MyHtmlHelper.DropDownList(ParentID, slDonVi, iID_MaDonVi, "iID_MaDonVi","", "class=\"input1_2\" style=\"width: 100%\"");
            return _LCPData;
        }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="ParentID"></param>
 /// <param name="iLoaiThang_Quy">1: Quý | 0: Tháng</param>
 /// <param name="iThangQuy">Quý</param>
 /// <param name="iThang">Tháng</param>
 /// <returns></returns>
 public String obj_DSThangQuy(String ParentID, String iLoaiThang_Quy, String iThangQuy, String UserID)
 {
     String dsThangQuy = "";
     DataTable dtThangQuy = new DataTable();
     SelectOptionList slThangQuy;
     switch (iLoaiThang_Quy)
     {
         case "1":
             dtThangQuy = DanhMucModels.DT_Quy(false);
             if (String.IsNullOrEmpty(iThangQuy))
             {
                 iThangQuy = "1";
             }
             slThangQuy = new SelectOptionList(dtThangQuy, "MaQuy", "TenQuy");
             dsThangQuy = MyHtmlHelper.DropDownList(ParentID, slThangQuy, iThangQuy, "iThangQuy", "", "class=\"input1_2\" style=\"width: 55px; padding:2px; border-radius:2px; -webkit-border-radius:2px;border-color:#cecece; margin-right:0px; \" ");
             break;
         case "0":
             dtThangQuy = DanhMucModels.DT_Thang(false);
             if (String.IsNullOrEmpty(iThangQuy))
                 iThangQuy = DanhMucModels.ThangLamViec(UserID).ToString();
             slThangQuy = new SelectOptionList(dtThangQuy, "MaThang", "TenThang");
             dsThangQuy = MyHtmlHelper.DropDownList(ParentID, slThangQuy, iThangQuy, "iThangQuy", "", "class=\"input1_2\" style=\"width: 55px; padding:2px; border-radius:2px; -webkit-border-radius:2px;border-color:#cecece;margin-right:0px; \" ");
             break;
     }
     return dsThangQuy;
 }
 /// <summary>
 /// DropDownList danh sách nguồn ngân sách
 /// </summary>
 /// <param name="ParentID"></param>
 /// <param name="MaND">Người dùng</param>
 /// <param name="iTrangThai">Trạng thái duyệt</param>
 /// <param name="iNguonNS">Giá trị nguồn ngân sách</param>
 /// <returns></returns>
 public String obj_DSNguonNS(String ParentID, String MaND, String iTrangThai, String iNguonNS)
 {
     String dsNguon = "";
     DataTable dtNguonNS = GetNguonNS(MaND, iTrangThai);
     SelectOptionList slNguon = new SelectOptionList(dtNguonNS, "iID_MaNguonNganSach", "sTen");
     dsNguon = MyHtmlHelper.DropDownList(ParentID, slNguon, iNguonNS, "iNguonNS", "", "class=\"input1_2\" style=\"width:185px; padding:2px;\"");
     return dsNguon;
 }
        public String obj_DSDotPhanBo(string ParentID, String MaND, String iID_MaTrangThaiDuyet, String iID_MaDotPhanBo)
        {
            String sdsDotPhanBo = "";
            DataTable dtDotPhanBo = LayDSDotPhanBo2(MaND, iID_MaTrangThaiDuyet);
            SelectOptionList slTenDotPhanBo = new SelectOptionList(dtDotPhanBo, "iID_MaDotPhanBo", "dNgayDotPhanBo");
            sdsDotPhanBo = MyHtmlHelper.DropDownList(ParentID, slTenDotPhanBo, iID_MaDotPhanBo, "iID_MaDotPhanBo", "", "class=\"input1_2\" style=\"width: 100%\"");

            return sdsDotPhanBo;
        }
        public String obj_DonViTheoNam(String ParentID, String MaND, String LoaiThangQuy, String Thang_Quy, String sLNS, String iID_MaDonVi, String iID_MaTrangThaiDuyet)
        {
            //String input = "";
               DataTable dt = DSDonVi(MaND, LoaiThangQuy, Thang_Quy, sLNS, iID_MaTrangThaiDuyet);

               DataTable dtDonvi = DSDonVi(MaND, LoaiThangQuy, Thang_Quy, sLNS, iID_MaTrangThaiDuyet);
               SelectOptionList sldonvi = new SelectOptionList(dtDonvi, "iID_MaDonVi", "sTen");
               String strDonVi = MyHtmlHelper.DropDownList(ParentID, sldonvi, iID_MaDonVi, "iID_MaDonVi", "", "class=\"input1_2\" style=\"width: 90%\"");
               return strDonVi;
               //StringBuilder stbDonVi = new StringBuilder();
               //stbDonVi.Append("<div style=\"width: 250px; height: 70px; overflow: scroll; border:1px solid #006666;\">");
               //stbDonVi.Append("<table class=\"mGrid\">");
               //stbDonVi.Append("<tr>");
               //stbDonVi.Append("<td><input type=\"checkbox\" id=\"checkAll\" onclick=\"Chonall(this.checked)\"></td><td> Chọn tất cả đơn vị </td>");

               //String TenDonVi = "", MaDonVi = "";
               //String[] arrDonVi = iID_MaDonVi.Split(',');
               //String _Checked = "checked=\"checked\"";
               //for (int i = 1; i <= dt.Rows.Count; i++)
               //{
               //    MaDonVi = Convert.ToString(dt.Rows[i - 1]["iID_MaDonVi"]);
               //    TenDonVi = Convert.ToString(dt.Rows[i - 1]["sTen"]);
               //    _Checked = "";
               //    for (int j = 1; j <= arrDonVi.Length; j++)
               //    {
               //        if (MaDonVi == arrDonVi[j - 1])
               //        {
               //            _Checked = "checked=\"checked\"";
               //            break;
               //        }
               //    }

               //    input = String.Format("<input type=\"checkbox\" value=\"{0}\" {1} check-group=\"MaDonVi\" id=\"iID_MaDonVi\" name=\"iID_MaDonVi\" />", MaDonVi, _Checked);
               //    stbDonVi.Append("<tr>");
               //    stbDonVi.Append("<td style=\"width: 15%;\">");
               //    stbDonVi.Append(input);
               //    stbDonVi.Append("</td>");
               //    stbDonVi.Append("<td>" + TenDonVi + "</td>");

               //    stbDonVi.Append("</tr>");
               //}
               //stbDonVi.Append("</table>");
               //stbDonVi.Append("</div>");
               //dt.Dispose();
               //String DonVi = stbDonVi.ToString();
               //return DonVi;
        }
 public string get_sNgayThang(String ParentID, String TenTruong, String Ngay, String Thang, String iNam)
 {
     DataTable dtNgay = DanhMucModels.DT_Ngay(Convert.ToInt16(Thang), Convert.ToInt16(iNam), false);
     SelectOptionList slNgay = new SelectOptionList(dtNgay, "MaNgay", "TenNgay");
     int SoNgayTrongThang = DateTime.DaysInMonth(Convert.ToInt16(iNam), Convert.ToInt16(Thang));
     if (String.IsNullOrEmpty(Ngay) == false)
     {
         if (Convert.ToInt16(Ngay) > SoNgayTrongThang)
             Ngay = "1";
     }
     return MyHtmlHelper.DropDownList(ParentID, slNgay, Ngay, TenTruong, "", "style=\"width:60px\"");
 }
        public QLDA_DTQuy obj_QLDA(String ParentID, String sDeAn, String NgoaiTe)
        {
            QLDA_DTQuy data = new QLDA_DTQuy();

            #region đề án
            String input = "";
            DataTable dtDeAn = QLDA_ReportModel.dt_DeAn_all();
            StringBuilder stbDeAn = new StringBuilder();
            stbDeAn.Append("<fieldset>");
            stbDeAn.Append("<legend><b>Đề án</b></legend>");
            stbDeAn.Append("<div style=\"width: 99%; height: 150px; overflow: scroll; border:1px solid black;\">");
            stbDeAn.Append("<table class=\"mGrid\">");
            stbDeAn.Append("<tr>");
            stbDeAn.Append("<td><input type=\"checkbox\" id=\"checkAll\" onclick=\"Chonall(this.checked)\"></td><td> Chọn tất cả đề án </td>");
            stbDeAn.Append("</fieldset>");
            String TenDeAn = "", MaDeAn = "";
            String[] arrDeAn = sDeAn.Split(',');
            String _Checked = "checked=\"checked\"";
            for (int i = 1; i <= dtDeAn.Rows.Count; i++)
            {
                MaDeAn = Convert.ToString(dtDeAn.Rows[i - 1]["sDeAn"]);
                TenDeAn = Convert.ToString(dtDeAn.Rows[i - 1]["sTenDuAn"]);
                _Checked = "";
                for (int j = 1; j <= arrDeAn.Length; j++)
                {
                    if (MaDeAn == arrDeAn[j - 1])
                    {
                        _Checked = "checked=\"checked\"";
                        break;
                    }
                }

                input = String.Format("<input type=\"checkbox\" value=\"{0}\" {1} check-group=\"MaDeAn\" id=\"sDeAn\" name=\"sDeAn\"  />", MaDeAn, _Checked);
                stbDeAn.Append("<tr>");
                stbDeAn.Append("<td style=\"width: 15%;\">");
                stbDeAn.Append(input);
                stbDeAn.Append("</td>");
                stbDeAn.Append("<td>" + TenDeAn + "</td>");

                stbDeAn.Append("</tr>");
            }
            stbDeAn.Append("</table>");
            stbDeAn.Append("</div>");
            dtDeAn.Dispose();
            String DeAn = stbDeAn.ToString();
            data.DeAn = DeAn;
            #endregion
            #region ngoại tệ
            DataTable dtNgoaiTe = QLDA_ReportModel.getdtTien();
            SelectOptionList slNgoaiTe = new SelectOptionList(dtNgoaiTe, "iID_MaNgoaiTe", "sTen");
            String sNgoaiTe = MyHtmlHelper.DropDownList(ParentID, slNgoaiTe, NgoaiTe, "NgoaiTe", "", "class=\"input1_2\" style=\"width: 80%\"");
            dtNgoaiTe.Dispose();
            data.NgoaiTe = sNgoaiTe;
            #endregion
            return data;
        }
 public String obj_DSDotPhanBo(String ParentID, String MaND, String sLNS,String iID_MaDotPhanBo, String iID_MaTrangThaiDuyet)
 {
     //String input = "";
     DataTable dt = dtDotPhanBo(MaND, sLNS, iID_MaTrangThaiDuyet);
     SelectOptionList slDotPhanBo = new SelectOptionList(dt, "iID_MaDotPhanBo", "dNgayDotPhanBo");
     String strDonVi = MyHtmlHelper.DropDownList(ParentID, slDotPhanBo, iID_MaDotPhanBo, "iID_MaDotPhanBo", "", "class=\"input1_2\" style=\"width: 100%\"");
     return strDonVi;
 }
 /// <summary>
 /// Lấy ngày theo tháng năm
 /// </summary>
 /// <param name="ParentID"></param>
 /// <param name="iThang">Tháng</param>
 /// <param name="iNam">Năm</param>
 /// <param name="iNgay">Ngày</param>
 /// <returns></returns>
 public String obj_DSNgay(String ParentID, String iThang, String iNam, String iNgay,String FromOrTo)
 {
     String dsNgay = "";
     DataTable dtNgay = DanhMucModels.DT_Ngay(int.Parse(iThang), int.Parse(iNam));
     dtNgay.Rows.RemoveAt(0);
     SelectOptionList slNgay = new SelectOptionList(dtNgay, "MaNgay", "TenNgay");
     dsNgay = MyHtmlHelper.DropDownList(ParentID, slNgay, iNgay, FromOrTo, "", "class=\"input1_2\" style=\"width: 46px; padding:2px;\"");
     return dsNgay;
 }
        public static String get_objMucLucDuan(String ParentID, String iID_MaHopDong, String iID_MaDanhMucDuAn)
        {
            String strDanhMucDuAn = string.Empty;
            if (string.IsNullOrEmpty(iID_MaHopDong) == false)
            {
                String strSQL = String.Format("SELECT iID_MaDanhMucDuAn,sTenDuAn FROM QLDA_HopDongChiTiet WHERE iID_MaHopDong = @iID_MaHopDong AND iTrangThai = 1 ORDER BY sXauNoiMa_DuAn");
                SqlCommand cmd = new SqlCommand();
                cmd.CommandText = strSQL;
                cmd.Parameters.AddWithValue("@iID_MaHopDong", iID_MaHopDong);
                DataTable dt = Connection.GetDataTable(cmd);

                if (dt != null)
                {
                    DataRow R = dt.NewRow();
                    R["iID_MaDanhMucDuAn"] = Guid.Empty;
                    R["sTenDuAn"] = "--- Danh sách công trình dự án ---";
                    dt.Rows.InsertAt(R, 0);

                    SelectOptionList slDanhMucDuan = new SelectOptionList(dt, "iID_MaDanhMucDuAn", "sTenDuAn");
                    strDanhMucDuAn = MyHtmlHelper.DropDownList(ParentID, slDanhMucDuan, iID_MaDanhMucDuAn, "iID_MaDanhMucDuAn", null, "class=\"textbox_uploadbox\" onchange=\"ddlHangMucDuan_SelectedValueChanged(this)\"");
                }
            }
            return "<div>" + strDanhMucDuAn + "</div>";
        }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="ParentID"></param>
 /// <param name="iTuNgay">Từ ngày</param>
 /// <param name="iDenNgay">Đến ngày</param>
 /// <param name="iTuThang">Từ tháng</param>
 /// <param name="iDenThang">Đến tháng</param>
 /// <param name="iNam">Năm</param>
 /// <param name="iSoTo">Số tờ</param>
 /// <returns></returns>
 public String obj_DSSoTo(String ParentID, String iTuNgay, String iDenNgay, String iTuThang, String iDenThang, String iNam, String iSoTo, String attr, String UserID, String iID_MaTrangThaiDuyet)
 {
     String dsSoTo = "";
     DataTable dtSoTo = GetSoTo(iTuNgay, iDenNgay, iTuThang, iDenThang, iNam,UserID,iID_MaTrangThaiDuyet);
     SelectOptionList slSoTo = new SelectOptionList(dtSoTo, "MaTo", "TenTo");
     dsSoTo = MyHtmlHelper.DropDownList(ParentID, slSoTo, iSoTo, "iSoTo", "", "class=\"input1_2\" style=\"width: 66px; padding:2px;\" "+attr+" ");
     return dsSoTo;
 }
 /// <summary>
 /// Hiện thị danh sách lên View
 /// </summary>
 /// <param name="ParentID"></param>
 /// <param name="Quy">Quý</param>
 /// <param name="Nam">Năm</param>
 /// <param name="All">Tất cả doanh nghiệp trong năm</param>
 /// <param name="iMaDN">Mã doanh nghiệp</param>
 /// <returns></returns>
 public String obj_DSDoanhNghiep(String ParentID, String Quy,String Nam, String iMaDN)
 {
     String dsDN = "";
     DataTable dtDoanhNghiep = GetDoanhNghiep(Quy, Nam);
     SelectOptionList slDoanhNghiep = new SelectOptionList(dtDoanhNghiep, "iID_MaDoanhNghiep", "sTenDoanhNghiep");
     dsDN = MyHtmlHelper.DropDownList(ParentID, slDoanhNghiep, iMaDN, "iMaDN", "", "class=\"input1_2\" style=\"width: 140px; padding:2px;\"");
     return dsDN;
 }
 public String obj_DonViTheoNam(String ParentID, String MaND, String iID_MaDonVi,String iID_MaTrangThaiDuyet)
 {
     DataTable dtDonvi = HienThiDonViTheoNam(MaND,iID_MaTrangThaiDuyet);
     SelectOptionList sldonvi = new SelectOptionList(dtDonvi, "iID_MaDonVi", "sTen");
     String strLNS = MyHtmlHelper.DropDownList(ParentID, sldonvi, iID_MaDonVi, "iID_MaDonVi", "", "class=\"input1_2\" style=\"width: 100%\"");
     return strLNS;
 }
 public String obj_DotPhanBo(String ParentID,String NamLamViec, String ThangLamViec, String TrangThai,String iID_MaDonVi)
 {
     DataTable dtDonVi = DanhSachDonVi(NamLamViec,ThangLamViec,TrangThai);
     SelectOptionList slDonVi = new SelectOptionList(dtDonVi, "iID_MaDonVi_No", "sTenDonVi_No");
     String s = MyHtmlHelper.DropDownList(ParentID, slDonVi, iID_MaDonVi, "iID_MaDonVi", "", "class=\"input1_2\" style=\"width: 100%\"");
     return s;
 }
 public NLVData obj_NgayCapPhat(String ParentID, String iID_MaTrangThaiDuyet, String dNgayCapPhat, String iID_MaDonVi, String MaND,String LuyKe)
 {
     NLVData _data = new NLVData();
     DataTable dtNgayCapPhat = DanhSach_Ngay_CapPhat(iID_MaTrangThaiDuyet,MaND);
     if (dNgayCapPhat.StartsWith("--") || String.Equals(dNgayCapPhat, "2000/01/01"))
     {
         dNgayCapPhat = "01/01/2000";
     }
     SelectOptionList slNgayCapPhat = new SelectOptionList(dtNgayCapPhat, "dNgayCapPhat", "dNgayCapPhat");
     _data.NgayCapPhat = MyHtmlHelper.DropDownList(ParentID, slNgayCapPhat, dNgayCapPhat, "dNgayCapPhat", "", "class=\"input1_2\" style=\"width: 100%\" onchange=\"ChonNCP()\"");
     DataTable dtDonVi = DanhSach_DonVi(iID_MaTrangThaiDuyet, dNgayCapPhat,MaND,LuyKe);
     SelectOptionList slDonvi = new SelectOptionList(dtDonVi, "iID_MaDonVi", "sTen");
     _data.iID_MaDonVi = MyHtmlHelper.DropDownList(ParentID, slDonvi, iID_MaDonVi, "iID_MaDonVi", "", "class=\"input1_2\" style=\"width: 100%\"");
     dtNgayCapPhat.Dispose();
     dtDonVi.Dispose();
     return _data;
 }
 public LNSdata obj_DonVi(String ParentID, String MaND, String iID_MaDonVi, String iID_MaDanhMuc,String sLNS, String iID_MaTrangThaiDuyet)
 {
     LNSdata _LNSdata = new LNSdata();
     #region Nhóm đơn vị
     DataTable dtNhomDonVi = DS_NhomDonVi(MaND,sLNS,iID_MaTrangThaiDuyet);
     SelectOptionList slNhomDonVi = new SelectOptionList(dtNhomDonVi, "iID_MaDanhMuc", "TenDM");
     _LNSdata.iID_MaDanhMuc = MyHtmlHelper.DropDownList(ParentID, slNhomDonVi, iID_MaDanhMuc, "iID_MaDanhMuc", "", "class=\"input1_2\" style=\"width: 85%\" onchange=\"ChonDV()\"");
     dtNhomDonVi.Dispose();
     #endregion
     #region Đơn vị
     DataTable dtDonVi = DanhSachDonVi(MaND,iID_MaDanhMuc,sLNS,iID_MaTrangThaiDuyet);
     SelectOptionList slDonVi = new SelectOptionList(dtDonVi, "iID_MaDonVi", "TenDV");
     _LNSdata.iID_MaDonVi = MyHtmlHelper.DropDownList(ParentID, slDonVi, iID_MaDonVi, "iID_MaDonVi", "", "class=\"input1_2\" style=\"width: 85%\"");
     dtDonVi.Dispose();
     #endregion
     return _LNSdata;
 }
 public Data obj_DSDotPhanBo(string ParentID, String MaND, String iID_MaTrangThaiDuyet, String iID_MaDotPhanBo, String iID_MaDonVi)
 {
     Data _data = new Data();
     DataTable dtDotPhanBo = PhanBo_ReportModels.LayDSDotPhanBo2(MaND, iID_MaTrangThaiDuyet);
     SelectOptionList slTenDotPhanBo = new SelectOptionList(dtDotPhanBo, "iID_MaDotPhanBo", "dNgayDotPhanBo");
     _data.iID_MaDotPhanBo = MyHtmlHelper.DropDownList(ParentID, slTenDotPhanBo, iID_MaDotPhanBo, "iID_MaDotPhanBo", "", "class=\"input1_2\" style=\"width: 100%\" onchange=\"ChonDPB()\"");
     DataTable dtDonVi = PhanBo_ReportModels.DanhSachDonVi2(MaND, iID_MaTrangThaiDuyet, iID_MaDotPhanBo, true);
     SelectOptionList slDonVi = new SelectOptionList(dtDonVi, "iID_MaDonVi", "TenHT");
     _data.iID_MaDonVi = MyHtmlHelper.DropDownList(ParentID, slDonVi, iID_MaDonVi, "iID_MaDonVi", "","class=\"input1_2\" style=\"width: 100%\"");
     dtDotPhanBo.Dispose();
     dtDonVi.Dispose();
     return _data;
 }
 public LNSdata obj_DotPhanBo(String ParentID, String MaND, String sLNS, String iID_MaDotPhanBo, String iID_MaTrangThaiDuyet, String TruongTien, String KhoGiay, String LuyKe, String ToSo)
 {
     LNSdata _LNSdata = new LNSdata();
     #region Đợt phân bổ
     DataTable dtDotPhanBo = PhanBo_ReportModels.LayDSDotPhanBoTong(MaND, iID_MaTrangThaiDuyet, sLNS, TruongTien);
     SelectOptionList slPhanBo = new SelectOptionList(dtDotPhanBo, "iID_MaDotPhanBo", "dNgayDotPhanBo");
     _LNSdata.iID_MaDotPhanBo = MyHtmlHelper.DropDownList(ParentID, slPhanBo, iID_MaDotPhanBo, "iID_MaDotPhanBo", "", "class=\"input1_2\" style=\"width: 80%\"onchange=\"Chon()\"");
     dtDotPhanBo.Dispose();
     #endregion
     #region Tờ Số
     DataTable dtToSo = dtTo(MaND, sLNS, iID_MaDotPhanBo, iID_MaTrangThaiDuyet, TruongTien, KhoGiay, LuyKe);
     SelectOptionList slToSo = new SelectOptionList(dtToSo, "MaTo", "TenTo");
     _LNSdata.ToSo = MyHtmlHelper.DropDownList(ParentID, slToSo, ToSo, "ToSo", "", "class=\"input1_2\" style=\"width: 80%\"");
     dtToSo.Dispose();
     #endregion
     return _LNSdata;
 }
 public String obj_DonVi(String ParentID, String sLNS, String iID_MaDonVi, String iID_MaTrangThaiDuyet, String UserName)
 {
     DataTable dtDonvi = dtDanhsach_DonVi(sLNS, iID_MaTrangThaiDuyet, UserName);
     SelectOptionList sldonvi = new SelectOptionList(dtDonvi, "iID_MaDonVi", "sTen");
     String strDonVi = MyHtmlHelper.DropDownList(ParentID, sldonvi, iID_MaDonVi, "iID_MaDonVi", "", "class=\"input1_2\" style=\"width: 100%\"");
     return strDonVi;
 }