Exemplo n.º 1
0
        public void ActionDetail(string endcode)
        {
            string layout = "";
            string ec     = endcode.ToLower();

            if (ec == "dang-nhap")
            {
                layout = "Login";
            }
            else if (ec == "dang-ky")
            {
                layout = "Register";
            }
            else if (ec == "quen-mat-khau")
            {
                layout = "ResetPass";
            }
            else if (ec == "thong-tin-ca-nhan")
            {
                layout = "Info";
            }
            else if (ec == "doi-mat-khau")
            {
                layout = "ChangePass";
            }
            else if (ec == "dang-xuat")
            {
                string currUrl = ViewPage.Request.RawUrl;
                CPLogin.Logout();
                ViewPage.Response.Redirect("/");
            }
            RenderView(layout);
        }
Exemplo n.º 2
0
        public void ActionLogout()
        {
            CPViewPage.SetLog("Thoát khỏi hệ thống.");

            CPLogin.Logout();

            CPViewPage.CPRedirect("Login.aspx");
        }
Exemplo n.º 3
0
        public void ActionDetail(string endCode)
        {
            string layout = "";
            string ec     = endCode.ToLower();

            if (ec == "them-ho-so-ung-cuu-su-co")
            {
                layout = "HoSoUCSC";
            }
            else if (ec == "sua-ho-so-ung-cuu-su-co")
            {
                layout = "HoSoUCSC";
            }
            else if (ec == "ho-so-ung-cuu-su-co")
            {
                layout = "Index";
            }
            else if (ec == "dang-xuat")
            {
                string currUrl = ViewPage.Request.RawUrl;
                CPLogin.Logout();
                ViewPage.Response.Redirect(currUrl);
            }
            if (!string.IsNullOrEmpty(layout))
            {
                RenderView(layout);
            }
            else
            {
                int userId = HL.Lib.Global.CPLogin.UserIDOnWeb;
                var entity = ModHSThanhVienUCSCService.Instance.CreateQuery()
                             //.Where(o => o.Activity == true)
                             .Where(userId > 0, o => o.UserID == userId)
                             .Where(o => o.Code == endCode)
                             //.WhereIn(MenuID > 0, o => o.MenuID, WebMenuService.Instance.GetChildIDForWeb_Cache("HSThanhVienUCSC", MenuID, ViewPage.CurrentLang.ID))
                             .ToSingle();

                if (entity != null)
                {
                    ViewBag.Other = ModHSThanhVienUCSCService.Instance.CreateQuery()
                                    .Where(o => o.Activity == true)
                                    .Where(o => o.Order < entity.Order)
                                    .WhereIn(MenuID > 0, o => o.MenuID, WebMenuService.Instance.GetChildIDForWeb_Cache("HSThanhVienUCSC", MenuID, ViewPage.CurrentLang.ID))
                                    .OrderByDesc(o => o.Order)
                                    .Take(PageSize)
                                    .ToList();

                    ViewBag.Data           = entity;
                    SetObject["view.Meta"] = entity;

                    ViewBag.HoSo = entity;
                    WebMenuEntity menu = WebMenuService.Instance.CreateQuery().Where(o => o.Activity == true && o.Type == "DauMoiUCSC" && o.Code == "Chinh").ToSingle();
                    var           dm   = ModDauMoiUCSCService.Instance.CreateQuery()
                                         .Where(o => o.Activity == true && o.HSThanhVienUCSCID == entity.ID && o.MenuID == menu.ID)
                                         .ToSingle();
                    ViewBag.DauMoi = dm;

                    WebMenuEntity menu1 = WebMenuService.Instance.CreateQuery().Where(o => o.Activity == true && o.Type == "DauMoiUCSC" && o.Code == "DuPhong").ToSingle();
                    if (menu1 != null)
                    {
                        var dmDuPhong = ModDauMoiUCSCService.Instance.CreateQuery()
                                        .Where(o => o.Activity == true && o.HSThanhVienUCSCID == entity.ID && o.MenuID == menu1.ID)
                                        .ToSingle();
                        ViewBag.DauMoiDuPhong = dmDuPhong;
                    }

                    ViewBag.HTTT = ModHeThongThongTinService.Instance.CreateQuery()
                                   .Where(o => o.Activity == true && o.DauMoiUCSCID == dm.ID)
                                   .ToList();
                    ViewBag.HTTT1 = ModHeThongThongTinService.Instance.CreateQuery()
                                    .Where(o => o.Activity == true && o.DonDangKyUCSCID == entity.ID)
                                    .ToList();
                    ViewBag.NhanLuc = ModNhanLucUCSCService.Instance.CreateQuery()
                                      .Where(o => o.Activity == true && o.HSThanhVienUCSCID == entity.ID)
                                      .ToList();
                    ViewBag.EndCode = endCode;

                    ViewBag.ListTongHopNhanLucLVDT     = ModTongHopNhanLucUCSCService.Instance.GetTongHopNhanLucByHSThanhVienID(entity.ID, "LinhVucDaoDao");
                    ViewBag.ListTongHopNhanLucTDDT     = ModTongHopNhanLucUCSCService.Instance.GetTongHopNhanLucByHSThanhVienID(entity.ID, "TrinhDoDaoTao");
                    ViewBag.ListTongHopNhanLucCC       = ModTongHopNhanLucUCSCService.Instance.GetTongHopNhanLucByHSThanhVienID(entity.ID, "ChungChi");
                    ViewBag.ListTongHopNhanLucNhomATTT = ModTongHopNhanLucUCSCService.Instance.GetTongHopNhanLucByHSThanhVienID(entity.ID, "QuanLyATTT");
                    ViewBag.ListTongHopNhanLucNhomKTPT = ModTongHopNhanLucUCSCService.Instance.GetTongHopNhanLucByHSThanhVienID(entity.ID, "KyThuatPhongThu");
                    ViewBag.ListTongHopNhanLucNhomKTBV = ModTongHopNhanLucUCSCService.Instance.GetTongHopNhanLucByHSThanhVienID(entity.ID, "KyThuatBaoVe");
                    ViewBag.ListTongHopNhanLucNhomKTKT = ModTongHopNhanLucUCSCService.Instance.GetTongHopNhanLucByHSThanhVienID(entity.ID, "KyThuatKiemTra");

                    RenderView("../MInfo/HoSoUCSC");
                }
                else
                {
                    ViewPage.Error404();
                }
            }
        }
Exemplo n.º 4
0
        public void ActionDetail(string endcode)
        {
            string layout = "";
            string ec     = endcode.ToLower();

            if (ec == "dang-nhap")
            {
                layout = "Login";
            }
            else if (ec == "dang-ky")
            {
                layout = "Register";
            }
            else if (ec == "quen-mat-khau")
            {
                layout = "ResetPass";
            }
            else if (ec == "thong-tin-ca-nhan")
            {
                layout = "Info";
            }
            else if (ec == "doi-mat-khau")
            {
                layout = "ChangePass";
            }
            else if (ec == "them-ho-so-ung-cuu-su-co")
            {
                layout = "HoSoUCSC";
            }
            else if (ec == "dang-ky-ung-cuu-su-co")
            {
                ViewBag.EndCode = endcode; layout = "DangKyUCSC";
            }
            else if (ec == "them-bc-ban-dau-su-co")
            {
                layout = "BCBanDauUCSC";
                DateTime dt = DateTime.Now;
                ViewBag.BaoCao = new ModBaoCaoBanDauSuCoEntity()
                {
                    ChiTiet_NgayGioPhatHien = dt,
                    ThoiGianThucHien        = dt
                };
            }
            else if (ec == "them-bc-ket-thuc-su-co")
            {
                layout = "BCKetThucUCSC";
                DateTime dt = DateTime.Now;
                ViewBag.BaoCao = new ModBaoCaoKetThucSuCoEntity()
                {
                    NgayBaoCao      = dt,
                    NgayGioPhatHien = dt
                };
            }
            else if (ec == "them-bc-tong-hop-su-co")
            {
                layout = "BCTongHopUCSC";
                DateTime dt = DateTime.Now;
                ViewBag.BaoCao = new ModBaoCaoTongHopEntity()
                {
                    TuNgay  = dt,
                    DenNgay = dt
                };
            }
            else if (ec == "dich-vu-canh-bao-su-co")
            {
                ViewBag.DichVu = new ModDichVuCanhBaoEntity()
                {
                    Name = "",
                    Time = DateTime.Now.TimeOfDay
                };

                ViewBag.IPs = new ModDichVuCanhBaoIPEntity()
                {
                    Name = ""
                };

                int userId = Lib.Global.CPLogin.UserID;
                var donDk  = ModDonDangKyUCSCService.Instance.CreateQuery().Where(o => o.UserID == userId).ToSingle();
                if (donDk != null)
                {
                    var dv = ModDichVuCanhBaoService.Instance.CreateQuery().Where(o => o.DonDangKyUCSCID == donDk.ID).ToSingle();
                    if (dv != null)
                    {
                        ViewBag.DichVu = dv;
                        ViewBag.Append = new MAppend()
                        {
                            ThoiGian = dv.Time.ToString(@"hh\:mm")
                        };
                        ViewBag.EndCode = dv.Name;
                        var ips = ModDichVuCanhBaoIPService.Instance.CreateQuery().Where(o => o.DichVuCanhBaoID == dv.ID).ToList();
                        if (ips != null && ips.Count > 0)
                        {
                            ViewBag.IPs = ips;
                        }
                    }
                }

                layout = "DVCanhBao";
            }
            else if (ec == "dang-xuat")
            {
                //string currUrl = ViewPage.Request.RawUrl;
                string currUrl = "/vn/Dashboard.aspx";
                CPLogin.Logout();
                ViewPage.Response.Redirect(currUrl);
            }
            RenderView(layout);
        }
Exemplo n.º 5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Response.ContentType = "text/xml";
            string cmd = HL.Core.Web.HttpQueryString.GetValue("cmd").ToString();

            if (cmd == "GuiGopY")
            {
                var    dtid     = HL.Core.Web.HttpQueryString.GetValue("duthaoid");
                int    duthaoid = HL.Core.Global.Convert.ToInt(dtid, 0);
                string name     = HL.Core.Global.Convert.ToString(HL.Core.Web.HttpQueryString.GetValue("name")).Trim();
                string email    = HL.Core.Global.Convert.ToString(HL.Core.Web.HttpQueryString.GetValue("email")).Trim();
                //string phone = HL.Core.Global.Convert.ToString(HL.Core.Web.HttpQueryString.GetValue("phone")).Trim();
                string title = HL.Core.Global.Convert.ToString(HL.Core.Web.HttpQueryString.GetValue("title")).Trim();
                //string content = HL.Core.Global.Convert.ToString(HL.Core.Web.HttpQueryString.GetValue("content")).Trim();
                string content = HL.Core.Web.HttpQueryString.GetValue("content").ToString();
                string sFile   = HL.Core.Global.Convert.ToString(HL.Core.Web.HttpQueryString.GetValue("sFile")).Trim();

                if (!string.IsNullOrEmpty(name) && !string.IsNullOrEmpty(email) && !string.IsNullOrEmpty(title) && !string.IsNullOrEmpty(content))
                {
                    string filePath = "";
                    try
                    {
                        ModGopYEntity entity = new ModGopYEntity()
                        {
                            DuThaoID = duthaoid,
                            Name     = name,
                            Email    = email,
                            //Phone = phone,
                            //Mobile = phone,
                            Title     = title,
                            Content   = content,
                            IP        = System.Web.HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"],
                            Published = DateTime.Now
                        };
                        string[] fileTmp;
                        if (!string.IsNullOrEmpty(sFile))
                        {
                            fileTmp = sFile.Split('.');
                            int c = fileTmp.Length;
                            for (int i = 0; i < c; i++)
                            {
                                filePath = AppDomain.CurrentDomain.BaseDirectory + "/Data/upload/files/GopY/" + email.Replace("@", "_");
                                HL.Lib.Global.File.Base64ToFile(fileTmp[i], filePath, title + "_" + duthaoid);
                                entity.Files = filePath + title + "_" + duthaoid;
                            }
                        }
                        ModGopYService.Instance.Save(entity);
                        sHTML = "Bạn đã gửi góp ý thành công!<br />Góp ý của bạn sẽ phải được xem xét, kiểm duyệt trong thời gian sớm nhất.";
                    }
                    catch (Exception ex)
                    {
                        sHTML = "";
                        HL.Lib.Global.File.Delete(filePath + title + "_" + duthaoid);
                    }
                }
            }
            else if (cmd == "SearchVB")
            {
                string   SoKyHieu             = HL.Core.Global.Convert.ToString(HL.Core.Web.HttpQueryString.GetValue("SoKyHieu")).Trim();
                DateTime TuNgayNgayXuatBan    = HL.Core.Global.Convert.ToDateTime(HL.Core.Web.HttpQueryString.GetValue("TuNgayNgayXuatBan"));
                DateTime DenNgayNgayXuatBan   = HL.Core.Global.Convert.ToDateTime(HL.Core.Web.HttpQueryString.GetValue("DenNgayNgayXuatBan"));
                DateTime TuNgayNgayCoHieuLuc  = HL.Core.Global.Convert.ToDateTime(HL.Core.Web.HttpQueryString.GetValue("TuNgayNgayCoHieuLuc"));
                DateTime DenNgayNgayCoHieuLuc = HL.Core.Global.Convert.ToDateTime(HL.Core.Web.HttpQueryString.GetValue("DenNgayNgayCoHieuLuc"));
                int      CoQuan   = HL.Core.Global.Convert.ToInt(HL.Core.Web.HttpQueryString.GetValue("CoQuan"));
                int      HinhThuc = HL.Core.Global.Convert.ToInt(HL.Core.Web.HttpQueryString.GetValue("HinhThuc"));
                int      LinhVuc  = HL.Core.Global.Convert.ToInt(HL.Core.Web.HttpQueryString.GetValue("LinhVuc"));
                string   TrichYeu = HL.Core.Global.Convert.ToString(HL.Core.Web.HttpQueryString.GetValue("TrichYeu")).Trim();
                int      Lang     = HL.Core.Global.Convert.ToInt(HL.Core.Web.HttpQueryString.GetValue("Lang"));

                try
                {
                    var dbQuery = ModVanBanService.Instance.CreateQuery()
                                  .Where(o => o.Activity == true);

                    if (!string.IsNullOrEmpty(SoKyHieu))
                    {
                        dbQuery.Where(o => o.Name.Contains(SoKyHieu));
                    }

                    if (TuNgayNgayXuatBan != DateTime.MinValue && TuNgayNgayXuatBan != DateTime.MaxValue)
                    {
                        dbQuery.Where(o => o.NgayBanHanh >= TuNgayNgayXuatBan);
                    }

                    if (DenNgayNgayXuatBan != DateTime.MinValue && DenNgayNgayXuatBan != DateTime.MaxValue)
                    {
                        dbQuery.Where(o => o.NgayBanHanh <= DenNgayNgayXuatBan);
                    }

                    if (TuNgayNgayCoHieuLuc != DateTime.MinValue && TuNgayNgayCoHieuLuc != DateTime.MaxValue)
                    {
                        dbQuery.Where(o => o.NgayCoHieuLuc >= TuNgayNgayCoHieuLuc);
                    }

                    if (DenNgayNgayCoHieuLuc != DateTime.MinValue && DenNgayNgayCoHieuLuc != DateTime.MaxValue)
                    {
                        dbQuery.Where(o => o.NgayCoHieuLuc <= DenNgayNgayCoHieuLuc);
                    }

                    if (LinhVuc > 0)
                    {
                        dbQuery.Where(o => o.MenuIDs.Contains(LinhVuc.ToString()));
                    }

                    if (CoQuan > 0)
                    {
                        dbQuery.Where(o => o.MenuID1 == CoQuan);
                    }

                    if (HinhThuc > 0)
                    {
                        dbQuery.Where(o => o.MenuID2 == HinhThuc);
                    }

                    if (!string.IsNullOrEmpty(TrichYeu))
                    {
                        dbQuery.Where(o => o.Summary.Contains(TrichYeu));
                    }

                    dbQuery.OrderByDesc(o => o.Order);
                    dbQuery.Take(10).Skip(10 * 0);
                    var listItem = dbQuery.ToList();

                    int c = listItem != null ? listItem.Count : 0;
                    int i = 0;
                    for (i = 0; i < c; i++)
                    {
                        string url = new ViewPage().GetURL(listItem[i].MenuID1, listItem[i].Code);
                        if (Lang == 1)
                        {
                            url = "vn/" + url;
                        }
                        else if (Lang == 2)
                        {
                            url = "en/" + url;
                        }
                        string cls = "";
                        if (i % 2 != 0)
                        {
                            cls = "even";
                        }
                        sHTML += "<tr class=\"" + cls + "\">";
                        sHTML += "<td>" + listItem[i].Name + "</td>";
                        sHTML += "<td>" + HL.Lib.MVC.ViewControl.GetName(listItem[i].getMenu1()) + "</td>";
                        sHTML += "<td>" + HL.Lib.MVC.ViewControl.GetName(listItem[i].getMenu2()) + "</td>";
                        sHTML += "<td>" + Utils.ShowTextByType3("VBLinhVuc", 1, listItem[i].MenuIDs, "MenuIDs") + "</td>";
                        sHTML += "<td><a href='/" + url + ".aspx'>" + listItem[i].Summary + "</a></td>";
                        sHTML += "<td>" + string.Format("{0:dd/MM/yyyy}", listItem[i].NgayBanHanh) + "</td>";
                        sHTML += "</tr>";
                    }
                }
                catch (Exception ex)
                {
                }
            }
            else if (cmd == "refresh")
            {
                safeCode = HL.Lib.Global.Utils.GetRandString();
            }
            else if (cmd == "ressetPass")
            {
                int    iduser = HL.Core.Global.Convert.ToInt(HL.Core.Web.HttpQueryString.GetValue("iduser"), 0);
                string pass   = HL.Core.Global.Convert.ToString(HL.Core.Web.HttpQueryString.GetValue("pass"));

                var objUser = CPUserService.Instance.CreateQuery().Where(o => o.ID == iduser).ToSingle();
                if (objUser != null)
                {
                    objUser.Password = HL.Lib.Global.Security.GetPass(pass);
                    CPUserService.Instance.Save(objUser);
                }
            }
            else if (cmd == "checkdn")
            {
                string LoginName = HL.Core.Global.Convert.ToString(HL.Core.Web.HttpQueryString.GetValue("LoginName"));
                string pass      = HL.Core.Global.Convert.ToString(HL.Core.Web.HttpQueryString.GetValue("pass"));

                if (CPLogin.CheckLogin3(LoginName.Trim(), pass))
                {
                    //var user = CPUserService.Instance.GetLogin(LoginName.Trim(), pass);
                    ////user.State = 2554;
                    //user.NgayActive = user.NgayMoLock;
                    //user.SoNgayLock = 0;
                    //user.NgayLock = DateTime.MinValue;
                    //user.NgayMoLock = DateTime.MinValue;
                    //CPUserService.Instance.Save(user);
                    //string redirect = HL.Core.Web.HttpQueryString.GetValue("ReturnPath").ToString();
                    //ViewPage.Response.Redirect(string.IsNullOrEmpty(redirect) ? "/Dang-tin.aspx" : redirect);
                    sHTML = "1";
                }
                else
                {
                    sHTML = "0";
                }
            }
            else if (cmd == "dx")
            {
                if (HL.Lib.Global.CPLogin.IsLoginOnWeb())
                {
                    CPLogin.Logout();
                    sHTML = "1";
                }
                else
                {
                    sHTML = "0";
                }
            }
            else if (cmd == "checkdk")
            {
                //tentl, hoten, tinhthanh, email, namsinh, gioitinh, dienthoai, lydo, mk, golaimk, mabaove, chapnhannoiquy
                string tentl          = HL.Core.Global.Convert.ToString(HL.Core.Web.HttpQueryString.GetValue("tentl"));
                string hoten          = HL.Core.Global.Convert.ToString(HL.Core.Web.HttpQueryString.GetValue("hoten"));
                string tinhthanh      = HL.Core.Global.Convert.ToString(HL.Core.Web.HttpQueryString.GetValue("tinhthanh"));
                string email          = HL.Core.Global.Convert.ToString(HL.Core.Web.HttpQueryString.GetValue("email"));
                int    namsinh        = HL.Core.Global.Convert.ToInt(HL.Core.Web.HttpQueryString.GetValue("namsinh"), 0);
                string gioitinh       = HL.Core.Global.Convert.ToString(HL.Core.Web.HttpQueryString.GetValue("gioitinh"));
                string dienthoai      = HL.Core.Global.Convert.ToString(HL.Core.Web.HttpQueryString.GetValue("dienthoai"));
                string lydo           = HL.Core.Global.Convert.ToString(HL.Core.Web.HttpQueryString.GetValue("lydo"));
                string mk             = HL.Core.Global.Convert.ToString(HL.Core.Web.HttpQueryString.GetValue("mk"));
                string golaimk        = HL.Core.Global.Convert.ToString(HL.Core.Web.HttpQueryString.GetValue("golaimk"));
                string mabaove        = HL.Core.Global.Convert.ToString(HL.Core.Web.HttpQueryString.GetValue("mabaove"));
                string sVY            = HL.Core.Global.Convert.ToString(HL.Core.Web.HttpQueryString.GetValue("sVY"));
                string chapnhannoiquy =
                    HL.Core.Global.Convert.ToString(HL.Core.Web.HttpQueryString.GetValue("chapnhannoiquy"));
                //string sVY = HL.Core.Global.Convert.ToString(HL.Core.Web.HttpQueryString.GetValue("sVY"));
                //sVY = HL.Core.Global.CryptoString.Decrypt(sVY).Replace(HttpContext.Current.Request.UserHostAddress + "." + string.Format("yyyy.MM.dd.hh", DateTime.Now) + ".", string.Empty);

                if (string.IsNullOrEmpty(tentl))
                {
                    sHTML = "Bạn chưa nhập tên truy cập";
                }
                else if (CPUserService.Instance.exitsloginname(tentl))
                {
                    sHTML = "Tên truy cập đã có người sử dụng";
                }
                //else if (string.IsNullOrEmpty(hoten)) sHTML = "Bạn chưa nhập họ tên";
                else if (string.IsNullOrEmpty(mk))
                {
                    sHTML = "Bạn chưa nhập mật khẩu";
                }
                else if (string.IsNullOrEmpty(golaimk))
                {
                    sHTML = "Bạn chưa nhập lại mật khẩu";
                }
                else if (mk != golaimk)
                {
                    sHTML = "Mật khẩu nhắc lại không đúng";
                }
                else if (string.IsNullOrEmpty(email))
                {
                    sHTML = "Bạn chưa nhập địa chỉ Email";
                }
                else if (CPUserService.Instance.exits(email))
                {
                    sHTML = "Email đã có người sử dụng";
                }
                else if (string.IsNullOrEmpty(Utils.GetEmailAddress(email)))
                {
                    sHTML = "Địa chỉ Email không hợp lệ";
                }
                //else if (namsinh == 0) sHTML = "Bạn chưa chọn năm sinh";
                else if (!string.IsNullOrEmpty(dienthoai))
                {
                    string checkPhone = Utils.GetMobilePhone(dienthoai);
                    if (string.IsNullOrEmpty(checkPhone))
                    {
                        sHTML = "Số điện thoại không hợp lệ.";
                    }
                }
                //else if (string.IsNullOrEmpty(lydo)) sHTML = "Bạn chưa nhập lý do";
                else if (string.IsNullOrEmpty(mabaove.Trim()))
                {
                    sHTML = "Bạn chưa nhập mã bảo vệ";
                }
                else if (sVY.ToLower().Trim() != mabaove.ToLower().Trim())
                {
                    sHTML = "Mã bảo vệ không chính xác";
                }
                //else if (chapnhannoiquy == "0") sHTML = "Bạn chưa chấp nhận nội quy";
                else
                {
                    sHTML = "";
                }
            }
            else if (cmd == "checkaddtt")
            {
                string tentl     = HL.Core.Global.Convert.ToString(HL.Core.Web.HttpQueryString.GetValue("tentl"));
                string hoten     = HL.Core.Global.Convert.ToString(HL.Core.Web.HttpQueryString.GetValue("hoten"));
                string email     = HL.Core.Global.Convert.ToString(HL.Core.Web.HttpQueryString.GetValue("email"));
                string gioitinh  = HL.Core.Global.Convert.ToString(HL.Core.Web.HttpQueryString.GetValue("gioitinh"));
                string dienthoai = HL.Core.Global.Convert.ToString(HL.Core.Web.HttpQueryString.GetValue("dienthoai"));
                string lydo      = HL.Core.Global.Convert.ToString(HL.Core.Web.HttpQueryString.GetValue("lydo"));

                if (string.IsNullOrEmpty(hoten))
                {
                    sHTML = "Bạn chưa nhập họ tên";
                }
                //else if (string.IsNullOrEmpty(tentl)) sHTML = "Bạn chưa nhập tên thảo luận";
                else if (string.IsNullOrEmpty(email))
                {
                    sHTML = "Bạn chưa nhập địa chỉ Email";
                }
                else if (string.IsNullOrEmpty(Utils.GetEmailAddress(email)))
                {
                    sHTML = "Địa chỉ Email không hợp lệ";
                }
                //else if (ModCungCapTTService.Instance.exits(email)) sHTML = "Email đã có người sử dụng";
                else if (string.IsNullOrEmpty(dienthoai))
                {
                    sHTML = "Bạn chưa nhập số điện thoại";
                }
                else
                {
                    sHTML = "";
                }
            }
            else if (cmd == "getrss")
            {
                //if (!CPLogin.IsLoginOnWeb()) return;
                //int hour = DateTime.Now.Hour;
                //if (hour % 3 == 0)
                //{
                var list =
                    WebMenuService.Instance.CreateQuery()
                    .Where(o => o.Type == "Org" && o.Activity == true)
                    .ToList_Cache();
                for (int i = 0; list != null && i < list.Count; i++)
                {
                    var      gettagwithclass = list[i].Items.GetValue("GetTagWithClass").ToString();
                    var      gettagwithid    = list[i].Items.GetValue("GetTagWithID").ToString();
                    var      deltagwithclass = list[i].Items.GetValue("DelTagWithClass").ToString();
                    var      deltagwithid    = list[i].Items.GetValue("DelTagWithID").ToString();
                    string[] arr;
                    string   gettag = "", getclassorid = "", deltag = "", delclassorid = "";
                    if (!string.IsNullOrEmpty(gettagwithclass))
                    {
                        arr          = gettagwithclass.Split('|');
                        gettag       = arr[0];
                        getclassorid = "class='" + arr[1] + "'";
                    }
                    else if (!string.IsNullOrEmpty(gettagwithid))
                    {
                        arr          = gettagwithid.Split('|');
                        gettag       = arr[0];
                        getclassorid = "id='" + arr[1] + "'";
                    }
                    if (!string.IsNullOrEmpty(deltagwithclass))
                    {
                        arr          = deltagwithclass.Split('|');
                        deltag       = arr[0];
                        delclassorid = "class='" + arr[1] + "'";
                    }
                    else if (!string.IsNullOrEmpty(deltagwithid))
                    {
                        arr          = deltagwithid.Split('|');
                        deltag       = arr[0];
                        delclassorid = "id='" + arr[1] + "'";
                    }
                    Utils.GetContentFromRSS(list[i].Code, list[i].RSS, list[i].SourceID, gettag, getclassorid, deltag,
                                            delclassorid);
                    //}
                }
            }
            else if (cmd == "updatemenuid")
            {
                string type     = HL.Core.Global.Convert.ToString(HL.Core.Web.HttpQueryString.GetValue("type"));
                int    recordid = HL.Core.Global.Convert.ToInt(HL.Core.Web.HttpQueryString.GetValue("recordid"), 0);
                int    menuid   = HL.Core.Global.Convert.ToInt(HL.Core.Web.HttpQueryString.GetValue("menuidup"), 0);

                if (type == "RSS")
                {
                    var obj = ModRSSService.Instance.CreateQuery().Where(o => o.ID == recordid).ToSingle();
                    if (obj != null)
                    {
                        obj.MenuID = menuid;
                        ModRSSService.Instance.Save(obj);
                    }
                }
                else if (type == "News")
                {
                    var obj = ModNewsService.Instance.CreateQuery().Where(o => o.ID == recordid).ToSingle();
                    if (obj != null)
                    {
                        obj.MenuID = menuid;
                        ModNewsService.Instance.Save(obj);
                    }
                }
            }
        }
Exemplo n.º 6
0
        public void ActionDetail(string endCode)
        {
            string layout = "";
            string ec     = endCode.ToLower();

            if (ec == "them-ho-so-ung-cuu-su-co")
            {
                layout = "HoSoUCSC";
            }
            else if (ec == "sua-ho-so-ung-cuu-su-co")
            {
                layout = "HoSoUCSC";
            }
            else if (ec == "ho-so-ung-cuu-su-co")
            {
                layout = "Index";
            }
            else if (ec == "dang-xuat")
            {
                string currUrl = ViewPage.Request.RawUrl;
                CPLogin.Logout();
                ViewPage.Response.Redirect(currUrl);
            }
            if (!string.IsNullOrEmpty(layout))
            {
                RenderView(layout);
            }
            else
            {
                int userId = HL.Lib.Global.CPLogin.UserID;
                var entity = ModHSThanhVienUCSCService.Instance.CreateQuery()
                             //.Where(o => o.Activity == true)
                             .Where(userId > 0, o => o.UserID == userId)
                             .Where(o => o.Code == endCode)
                             //.WhereIn(MenuID > 0, o => o.MenuID, WebMenuService.Instance.GetChildIDForWeb_Cache("HSThanhVienUCSC", MenuID, ViewPage.CurrentLang.ID))
                             .ToSingle();

                if (entity != null)
                {
                    ViewBag.Other = ModHSThanhVienUCSCService.Instance.CreateQuery()
                                    .Where(o => o.Activity == true)
                                    .Where(o => o.Order < entity.Order)
                                    .WhereIn(MenuID > 0, o => o.MenuID, WebMenuService.Instance.GetChildIDForWeb_Cache("HSThanhVienUCSC", MenuID, ViewPage.CurrentLang.ID))
                                    .OrderByDesc(o => o.Order)
                                    .Take(PageSize)
                                    .ToList();

                    ViewBag.Data           = entity;
                    SetObject["view.Meta"] = entity;

                    ViewBag.HoSo = entity;
                    var dm = ModDauMoiUCSCService.Instance.CreateQuery()
                             .Where(o => o.Activity == true && o.HSThanhVienUCSCID == entity.ID)
                             .ToSingle();
                    ViewBag.DauMoi = dm;
                    ViewBag.HTTT   = ModHeThongThongTinService.Instance.CreateQuery()
                                     .Where(o => o.Activity == true && o.DauMoiUCSCID == dm.ID)
                                     .ToList();
                    ViewBag.HTTT1 = ModHeThongThongTinService.Instance.CreateQuery()
                                    .Where(o => o.Activity == true && o.DonDangKyUCSCID == entity.ID)
                                    .ToList();
                    ViewBag.EndCode = endCode;
                    RenderView("../MInfo/HoSoUCSC");
                }
                else
                {
                    ViewPage.Error404();
                }
            }
        }
Exemplo n.º 7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Response.ContentType = "text/xml";
            string cmd = HL.Core.Web.HttpQueryString.GetValue("cmd").ToString();

            if (cmd == "sendContact")
            {
                string name    = HL.Core.Global.Convert.ToString(HL.Core.Web.HttpQueryString.GetValue("name")).Trim();
                string email   = HL.Core.Global.Convert.ToString(HL.Core.Web.HttpQueryString.GetValue("email")).Trim();
                string phone   = HL.Core.Global.Convert.ToString(HL.Core.Web.HttpQueryString.GetValue("phone")).Trim();
                string title   = HL.Core.Global.Convert.ToString(HL.Core.Web.HttpQueryString.GetValue("title")).Trim();
                string content = HL.Core.Global.Convert.ToString(HL.Core.Web.HttpQueryString.GetValue("content")).Trim();

                if (!string.IsNullOrEmpty(name) && !string.IsNullOrEmpty(email) && !string.IsNullOrEmpty(phone) && !string.IsNullOrEmpty(title) && !string.IsNullOrEmpty(content))
                {
                    try
                    {
                        ModFeedbackEntity entity = new ModFeedbackEntity()
                        {
                            Name    = name,
                            Email   = email,
                            Phone   = phone,
                            Mobile  = phone,
                            Title   = title,
                            Content = content,
                            IP      = System.Web.HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"],
                            Created = DateTime.Now
                        };
                        ModFeedbackService.Instance.Save(entity);
                        sHTML = "Gửi liên hệ thành công! Cám ơn bạn rất nhiều.<br />Chúng tôi sẽ liên lạc với bạn trong thời gian sớm nhất!";
                    }
                    catch (Exception ex)
                    {
                        sHTML = "";
                    }
                }
            }
            else if (cmd == "refresh")
            {
                safeCode = HL.Lib.Global.Utils.GetRandString();
            }
            else if (cmd == "ressetPass")
            {
                int    iduser = HL.Core.Global.Convert.ToInt(HL.Core.Web.HttpQueryString.GetValue("iduser"), 0);
                string pass   = HL.Core.Global.Convert.ToString(HL.Core.Web.HttpQueryString.GetValue("pass"));

                var objUser = CPUserService.Instance.CreateQuery().Where(o => o.ID == iduser).ToSingle();
                if (objUser != null)
                {
                    objUser.Password = HL.Lib.Global.Security.GetPass(pass);
                    CPUserService.Instance.Save(objUser);
                }
            }
            else if (cmd == "checkdn")
            {
                string LoginName = HL.Core.Global.Convert.ToString(HL.Core.Web.HttpQueryString.GetValue("LoginName"));
                string pass      = HL.Core.Global.Convert.ToString(HL.Core.Web.HttpQueryString.GetValue("pass"));

                if (CPLogin.CheckLogin3(LoginName.Trim(), pass))
                {
                    sHTML = "1";
                }
                else
                {
                    sHTML = "0";
                }
            }
            else if (cmd == "dx")
            {
                if (HL.Lib.Global.CPLogin.IsLogin())
                {
                    CPLogin.Logout();
                    sHTML = "1";
                }
                else
                {
                    sHTML = "0";
                }
            }
            else if (cmd == "checkdk")
            {
                //tentl, hoten, tinhthanh, email, namsinh, gioitinh, dienthoai, lydo, mk, golaimk, mabaove, chapnhannoiquy
                string tentl          = HL.Core.Global.Convert.ToString(HL.Core.Web.HttpQueryString.GetValue("tentl"));
                string hoten          = HL.Core.Global.Convert.ToString(HL.Core.Web.HttpQueryString.GetValue("hoten"));
                string tinhthanh      = HL.Core.Global.Convert.ToString(HL.Core.Web.HttpQueryString.GetValue("tinhthanh"));
                string email          = HL.Core.Global.Convert.ToString(HL.Core.Web.HttpQueryString.GetValue("email"));
                int    namsinh        = HL.Core.Global.Convert.ToInt(HL.Core.Web.HttpQueryString.GetValue("namsinh"), 0);
                string gioitinh       = HL.Core.Global.Convert.ToString(HL.Core.Web.HttpQueryString.GetValue("gioitinh"));
                string dienthoai      = HL.Core.Global.Convert.ToString(HL.Core.Web.HttpQueryString.GetValue("dienthoai"));
                string lydo           = HL.Core.Global.Convert.ToString(HL.Core.Web.HttpQueryString.GetValue("lydo"));
                string mk             = HL.Core.Global.Convert.ToString(HL.Core.Web.HttpQueryString.GetValue("mk"));
                string golaimk        = HL.Core.Global.Convert.ToString(HL.Core.Web.HttpQueryString.GetValue("golaimk"));
                string mabaove        = HL.Core.Global.Convert.ToString(HL.Core.Web.HttpQueryString.GetValue("mabaove"));
                string sVY            = HL.Core.Global.Convert.ToString(HL.Core.Web.HttpQueryString.GetValue("sVY"));
                string chapnhannoiquy =
                    HL.Core.Global.Convert.ToString(HL.Core.Web.HttpQueryString.GetValue("chapnhannoiquy"));
                //string sVY = HL.Core.Global.Convert.ToString(HL.Core.Web.HttpQueryString.GetValue("sVY"));
                //sVY = HL.Core.Global.CryptoString.Decrypt(sVY).Replace(HttpContext.Current.Request.UserHostAddress + "." + string.Format("yyyy.MM.dd.hh", DateTime.Now) + ".", string.Empty);

                if (string.IsNullOrEmpty(tentl))
                {
                    sHTML = "Bạn chưa nhập tên truy cập";
                }
                else if (CPUserService.Instance.exitsloginname(tentl))
                {
                    sHTML = "Tên truy cập đã có người sử dụng";
                }
                //else if (string.IsNullOrEmpty(hoten)) sHTML = "Bạn chưa nhập họ tên";
                else if (string.IsNullOrEmpty(mk))
                {
                    sHTML = "Bạn chưa nhập mật khẩu";
                }
                else if (string.IsNullOrEmpty(golaimk))
                {
                    sHTML = "Bạn chưa nhập lại mật khẩu";
                }
                else if (mk != golaimk)
                {
                    sHTML = "Mật khẩu nhắc lại không đúng";
                }
                else if (string.IsNullOrEmpty(email))
                {
                    sHTML = "Bạn chưa nhập địa chỉ Email";
                }
                else if (CPUserService.Instance.exits(email))
                {
                    sHTML = "Email đã có người sử dụng";
                }
                //else if (namsinh == 0) sHTML = "Bạn chưa chọn năm sinh";
                else if (string.IsNullOrEmpty(dienthoai))
                {
                    sHTML = "Bạn chưa nhập số điện thoại";
                }
                //else if (string.IsNullOrEmpty(lydo)) sHTML = "Bạn chưa nhập lý do";
                else if (string.IsNullOrEmpty(mabaove.Trim()))
                {
                    sHTML = "Bạn chưa nhập mã bảo vệ";
                }
                else if (sVY.ToLower().Trim() != mabaove.ToLower().Trim())
                {
                    sHTML = "Mã bảo vệ không chính xác";
                }
                //else if (chapnhannoiquy == "0") sHTML = "Bạn chưa chấp nhận nội quy";
                else
                {
                    sHTML = "";
                }
            }
            else if (cmd == "checkaddtt")
            {
                string tentl     = HL.Core.Global.Convert.ToString(HL.Core.Web.HttpQueryString.GetValue("tentl"));
                string hoten     = HL.Core.Global.Convert.ToString(HL.Core.Web.HttpQueryString.GetValue("hoten"));
                string email     = HL.Core.Global.Convert.ToString(HL.Core.Web.HttpQueryString.GetValue("email"));
                string gioitinh  = HL.Core.Global.Convert.ToString(HL.Core.Web.HttpQueryString.GetValue("gioitinh"));
                string dienthoai = HL.Core.Global.Convert.ToString(HL.Core.Web.HttpQueryString.GetValue("dienthoai"));
                string lydo      = HL.Core.Global.Convert.ToString(HL.Core.Web.HttpQueryString.GetValue("lydo"));

                if (string.IsNullOrEmpty(hoten))
                {
                    sHTML = "Bạn chưa nhập họ tên";
                }
                //else if (string.IsNullOrEmpty(tentl)) sHTML = "Bạn chưa nhập tên thảo luận";
                else if (string.IsNullOrEmpty(email))
                {
                    sHTML = "Bạn chưa nhập địa chỉ Email";
                }
                else if (string.IsNullOrEmpty(Utils.GetEmailAddress(email)))
                {
                    sHTML = "Địa chỉ Email không hợp lệ";
                }
                //else if (ModCungCapTTService.Instance.exits(email)) sHTML = "Email đã có người sử dụng";
                else if (string.IsNullOrEmpty(dienthoai))
                {
                    sHTML = "Bạn chưa nhập số điện thoại";
                }
                else
                {
                    sHTML = "";
                }
            }
        }