Example #1
0
        public List <Contract> Search(int currentPage, ref decimal totalRecord, string keySearch = "")
        {
            List <Contract> lstContract = new List <Contract>();
            var             contractDa  = new ContractDA();

            try
            {
                string p_contract_code = "";
                string p_contract_date = "";
                string p_import_object = "";
                string p_status        = "";
                var    arrKeySearch    = keySearch.Split('|');
                if (arrKeySearch.Length >= 4)
                {
                    p_contract_code = arrKeySearch[0];
                    p_contract_date = arrKeySearch[1];
                    p_import_object = arrKeySearch[2];
                    p_status        = arrKeySearch[3];
                }
                string p_to   = Common.RecordOnpage.ToString();
                string p_from = CommonFuc.Get_From_To_Page(currentPage, ref p_to);

                var ds = contractDa.Search(p_contract_code, p_contract_date, p_import_object, p_status, p_from, p_to, ref totalRecord);
                lstContract = CBO <Contract> .FillCollectionFromDataSet(ds);
            }
            catch (Exception ex)
            {
                Common.log.Error(ex.ToString());
                lstContract = new List <Contract>();
            }
            return(lstContract);
        }
Example #2
0
        public ActionResult FindUser(string p_keysearch, int p_CurrentPage, string p_column, string p_type_sort, string p_type)
        {
            try
            {
                decimal _total_record = 0;

                string p_to   = "";
                string p_from = CommonFuc.Get_From_To_Page(p_CurrentPage, ref p_to);

                var             userBL     = new UserBL();
                List <UserInfo> _lst       = userBL.User_Search(p_keysearch, ref _total_record, p_from, p_to);
                string          htmlPaging = WebApps.CommonFunction.AppsCommon.Get_HtmlPaging <Timesheet_Info>((int)_total_record, p_CurrentPage, "khách hàng");

                ViewBag.Paging    = htmlPaging;
                ViewBag.Obj       = _lst;
                ViewBag.SumRecord = _total_record;

                return(PartialView("~/Areas/ModuleUsersAndRoles/Views/Customer/_PartialTableListCustomer.cshtml"));
            }
            catch (Exception ex)
            {
                Logger.LogException(ex);
                return(PartialView("~/Areas/ModuleUsersAndRoles/Views/Customer/_PartialTableListCustomer.cshtml"));
            }
        }
Example #3
0
        public ActionResult FindUser(string p_keysearch, int p_CurrentPage, string p_column, string p_type_sort, string p_type)
        {
            try
            {
                decimal _total_record = 0;

                string p_to   = "";
                string p_from = CommonFuc.Get_From_To_Page(p_CurrentPage, ref p_to);

                var             userBL = new UserBL();
                List <UserInfo> _lst   = userBL.User_Search_Admin(p_keysearch, ref _total_record, p_from, p_to);
                _lst = _lst.FindAll(m => m.Type != 2 || m.Type != 3).ToList();
                string htmlPaging = WebApps.CommonFunction.AppsCommon.Get_HtmlPaging <UserInfo>((int)_total_record, p_CurrentPage, "Người dùng");

                ViewBag.Paging    = htmlPaging;
                ViewBag.Obj       = _lst;
                ViewBag.SumRecord = _total_record;

                return(PartialView("~/Areas/ModuleUsersAndRoles/Views/User/_PartialTableListUsers.cshtml"));
            }
            catch (Exception ex)
            {
                Logger.LogException(ex);
                return(PartialView("~/Areas/Manager/Views/TimeSheet/_PartialTableTimeSheet.cshtml"));
            }
        }
Example #4
0
 public ActionResult User_Search(string p_keysearch, int p_CurrentPage)
 {
     try
     {
         decimal _total_record = 0;
         string  p_to          = "";
         string  p_from        = CommonFuc.Get_From_To_Page(p_CurrentPage, ref p_to);
         if (p_keysearch == "" || p_keysearch == null)
         {
             p_keysearch = "ALL";
         }
         UserBL          _bl        = new UserBL();
         List <UserInfo> _lst       = _bl.User_Search(p_keysearch, ref _total_record, p_from, p_to);
         string          htmlPaging = NaviCommon.CommonFuc.Get_HtmlPaging <UserInfo>((int)_total_record, p_CurrentPage, "thành viên");
         ViewBag.Paging    = htmlPaging;
         ViewBag.List      = _lst;
         ViewBag.SumRecord = _total_record;
         return(PartialView("/Views/User/_Partial_List_User.cshtml"));
     }
     catch (Exception ex)
     {
         NaviCommon.Common.log.Error(ex.ToString());
         return(PartialView("/Views/User/_Partial_List_User.cshtml"));
     }
 }
 public ActionResult DetailNewsArticles()
 {
     try
     {
         if (SessionData.CurrentUser == null)
         {
             return(Redirect("/"));
         }
         decimal pIDArticles = 0;
         int     Status      = 0;
         if (RouteData.Values.ContainsKey("id"))
         {
             pIDArticles = CommonFuc.ConvertToDecimal(RouteData.Values["id"]);
         }
         if (RouteData.Values.ContainsKey("id2"))
         {
             Status = CommonFuc.ConvertToInt(RouteData.Values["id2"]);
         }
         ViewBag.Status = Status;
         var objNewsBL = new NewsBL();
         ViewBag.lstCategory = WebApps.CommonFunction.AppsCommon.AllCode_GetBy_CdTypeCdName("ARTICLES", "CATEGORIES");
         string language   = AppsCommon.GetCurrentLang();
         var    objNewInfo = objNewsBL.ArticlesGetById(pIDArticles, language);
         return(View("~/Areas/Articles/Views/ArticlesNews/_PartialviewView.cshtml", objNewInfo));
     }
     catch (Exception ex)
     {
         Logger.LogException(ex);
         return(View());
     }
 }
Example #6
0
        public ActionResult Search(string p_keysearch, int p_CurrentPage)
        {
            try
            {
                decimal _total_record = 0;
                string  p_to          = "";
                string  p_from        = CommonFuc.Get_From_To_Page(p_CurrentPage, ref p_to);
                if (p_keysearch == "" || p_keysearch == null)
                {
                    p_keysearch = "ALL";
                }
                CarriersBL          _bl  = new CarriersBL();
                List <CarriersInfo> _lst = _bl.Search(p_keysearch, ref _total_record, p_from, p_to);
                string htmlPaging        = NaviCommon.CommonFuc.Get_HtmlPaging <CarriersInfo>((int)_total_record, p_CurrentPage, "nhà cung cấp");


                ViewBag.Paging    = htmlPaging;
                ViewBag.List      = _lst;
                ViewBag.SumRecord = _total_record;

                return(PartialView("~/Areas/ModuleBaseData/Views/Carriers/_Partial_List.cshtml"));
            }
            catch (Exception ex)
            {
                NaviCommon.Common.log.Error(ex.ToString());
                return(PartialView("~/Areas/ModuleBaseData/Views/Carriers/_Partial_List.cshtml"));
            }
        }
Example #7
0
        public ActionResult ViewDoc()
        {
            if (SessionData.CurrentUser == null)
            {
                return(Redirect("/account/dang-xuat"));
            }
            var          _WikiDoc_BL = new WikiDoc_BL();
            WikiDoc_Info _ObjInfo    = new WikiDoc_Info();
            decimal      _docid      = 0;

            if (RouteData.Values.ContainsKey("id"))
            {
                _docid = CommonFuc.ConvertToDecimal(RouteData.Values["id"]);
            }
            try
            {
                _ObjInfo = _WikiDoc_BL.WikiDoc_GetById(_docid);
            }
            catch (Exception ex)
            {
                Logger.LogException(ex);
            }

            int _crrstatus = 0;

            if (RouteData.Values.ContainsKey("id1"))
            {
                _crrstatus = CommonFuc.ConvertToInt(RouteData.Values["id1"]);
            }
            ViewBag.CurrStatus = _crrstatus;
            return(PartialView("~/Areas/Wiki/Views/WikiDoc/_PartialDocView.cshtml", _ObjInfo));
        }
Example #8
0
        public ActionResult Edit_Pages(Sys_Pages_Info p_Sys_Pages_Info)
        {
            try
            {
                if (p_Sys_Pages_Info == null)
                {
                    return(Json(new { status = -99 }));
                }

                string language     = AppsCommon.GetCurrentLang();
                var    ModifiedBy   = SessionData.CurrentUser.Username;
                var    ModifiedDate = CommonFuc.CurrentDate();
                if (p_Sys_Pages_Info.pfileLogo != null)
                {
                    p_Sys_Pages_Info.Imageheader = AppLoadHelpers.PushFileToServer(p_Sys_Pages_Info.pfileLogo, AppUpload.Logo);
                }
                p_Sys_Pages_Info.Modified_By = SessionData.CurrentUser.Username;
                var     objBL   = new Sys_Pages_BL();
                decimal preturn = objBL.Sys_Pages_Update(p_Sys_Pages_Info);
                if (preturn >= 0)
                {
                    MemoryData.Load_Sys_page();
                }
                return(Json(new { status = preturn }));
            }
            catch (Exception ex)
            {
                Logger.LogException(ex);
                return(View());
            }
        }
Example #9
0
        public ActionResult FindUpdateNews(string keysSearch, string _sortype, int _reconpage, int p_CurrentPage)
        {
            decimal _total_record = 0;
            string  p_to          = "";
            string  p_from        = CommonFuc.Get_From_To_Page(p_CurrentPage, ref p_to, _reconpage);

            _sortype = " ORDER BY " + _sortype;
            if (string.IsNullOrEmpty(_sortype) || _sortype.Trim() == "ORDER BY")
            {
                _sortype = "ALL";
            }
            string htmlPaging = "";

            try
            {
                NewsBL _obj_bl = new NewsBL();
                // keysSearch = "7|" + "1|" + SessionData.CurrentUser.Language;
                keysSearch = "7|" + "ALL|" + SessionData.CurrentUser.Language + "|TIN_TUC";

                List <NewsInfo> _lst = _obj_bl.ArticleHomeSearch(keysSearch, ref _total_record, p_from, p_to, _sortype);
                htmlPaging        = WebApps.CommonFunction.AppsCommon.Get_HtmlPaging <B_Remind_Info>((int)_total_record, p_CurrentPage, "Tin", _reconpage, "UpdatenewsjsPaging");
                ViewBag.Paging    = htmlPaging;
                ViewBag.Obj       = _lst;
                ViewBag.SumRecord = _total_record;
                return(PartialView("~/Areas/Home/Views/Shared/_UpdatenewsData.cshtml"));
            }
            catch (Exception ex)
            {
                Logger.LogException(ex);
            }
            return(null);
        }
Example #10
0
        public void ValidateReCaptcha(string reCaptchaResponse)
        {
            try
            {
                string _RecaptchaSecretKey = CommonFuc.GetConfig("RecaptchaSecretKey");
                if (string.IsNullOrEmpty(reCaptchaResponse) || string.IsNullOrWhiteSpace(reCaptchaResponse))
                {
                    return;
                }

                // Request to Google Server
                var req = (HttpWebRequest)WebRequest.Create("https://www.google.com/recaptcha/api/siteverify?secret=" + _RecaptchaSecretKey + "&response=" + reCaptchaResponse.Trim('"'));

                // Google recaptcha Response
                using (var wResponse = req.GetResponse())
                {
                    var responseStream = wResponse.GetResponseStream();
                    if (responseStream == null)
                    {
                        return;
                    }
                    using (var readStream = new StreamReader(responseStream))
                    {
                        var jsonResponse = readStream.ReadToEnd();
                        var js           = new JavaScriptSerializer();
                        var data         = js.Deserialize <GoogleResponse>(jsonResponse); // Deserialize Json
                        this.IsReCaptchaValid = Convert.ToBoolean(data.Success);
                    }
                }
            }
            catch (Exception)
            {
                // Ignored
            }
        }
Example #11
0
        public ActionResult FindUser(string p_keysearch, string p_language, string p_status, int p_CurrentPage)
        {
            try
            {
                decimal _total_record = 0;

                string p_to   = "";
                string p_from = CommonFuc.Get_From_To_Page(p_CurrentPage, ref p_to);

                var contact_bl                = new Contact_BL();
                List <ContactInfo> _lst       = contact_bl.Contact_Search(p_keysearch, p_language, p_status, ref _total_record, p_from, p_to);
                string             htmlPaging = WebApps.CommonFunction.AppsCommon.Get_HtmlPaging <Contact_BL>((int)_total_record, p_CurrentPage, "Luật sư");

                ViewBag.Paging    = htmlPaging;
                ViewBag.Obj       = _lst;
                ViewBag.SumRecord = _total_record;

                return(PartialView("~/Areas/Contact/Views/Contact/_Partial_List_Contact.cshtml"));
            }
            catch (Exception ex)
            {
                Logger.LogException(ex);
                return(PartialView("~/Areas/Contact/Views/Contact/_Partial_List_Contact.cshtml"));
            }
        }
Example #12
0
 public ActionResult SearchDDSHCN(string p_keysearch, int p_CurrentPage, string p_column, string p_type_sort)
 {
     try
     {
         string pTenDaidien = "";
         string pPhone      = "";
         if (p_keysearch.Contains("|"))
         {
             var array = p_keysearch.Split('|');
             pTenDaidien = array[0];
             pPhone      = array[1];
         }
         decimal              _total_record = 0;
         string               p_to          = "";
         string               p_from        = CommonFuc.Get_From_To_Page(p_CurrentPage, ref p_to);
         AppDDSHCN_BL         _obj_bl       = new AppDDSHCN_BL();
         List <AppDDSHCNInfo> _lst          = _obj_bl.AppDDSHCNGetAll(pTenDaidien, pPhone, 0, 0, ref _total_record);
         string               htmlPaging    = WebApps.CommonFunction.AppsCommon.Get_HtmlPaging <Timesheet_Info>((int)_total_record, 1, "Record");
         ViewBag.Paging    = htmlPaging;
         ViewBag.Obj       = _lst;
         ViewBag.SumRecord = _total_record;
         return(PartialView("~/Areas/DaiDienSHCN/Views/DDSHCN/_PartialTableDDSHCN.cshtml"));
     }
     catch (Exception ex)
     {
         Logger.LogException(ex);
         return(PartialView("~/Areas/DaiDienSHCN/Views/DDSHCN/_PartialTableDDSHCN.cshtml"));
     }
 }
Example #13
0
        public List <ToDoInfo> Search(int currentPage, ref decimal totalRecord, string keySearch = "")
        {
            List <ToDoInfo> lstToDo = new List <ToDoInfo>();
            var             todoDa  = new ToDoDA();

            try
            {
                string p_name       = "";
                string p_status     = "";
                string p_type       = "";
                var    arrKeySearch = keySearch.Split('|');
                if (arrKeySearch.Length >= 3)
                {
                    p_name   = arrKeySearch[0];
                    p_status = arrKeySearch[1];
                    p_type   = arrKeySearch[2];
                }
                string p_to   = Common.RecordOnpage.ToString();
                string p_from = CommonFuc.Get_From_To_Page(currentPage, ref p_to);

                var ds = todoDa.Search(p_name, p_status, p_type, p_from, p_to, ref totalRecord);
                lstToDo = CBO <ToDoInfo> .FillCollectionFromDataSet(ds);
            }
            catch (Exception ex)
            {
                Common.log.Error(ex.ToString());
            }
            return(lstToDo);
        }
Example #14
0
        public List <Shipment> Search(int currentPage, ref decimal totalRecord, string keySearch = "")
        {
            List <Shipment> lstShipment = new List <Shipment>();
            var             shipmentDa = new ShipmentDA();
            string          _shipmentCode = ""; string _contractCode = ""; string _productCode = "";
            string          _billing_number = ""; string _requestObject = ""; string _importObject = ""; string _status = "";

            try
            {
                var arrKeySearch = keySearch.Split('|');
                if (arrKeySearch.Length >= 7)
                {
                    _shipmentCode   = arrKeySearch[0];
                    _contractCode   = arrKeySearch[1];
                    _productCode    = arrKeySearch[2];
                    _billing_number = arrKeySearch[3];
                    _requestObject  = arrKeySearch[4];
                    _importObject   = arrKeySearch[5];
                    _status         = arrKeySearch[6];
                }
                string p_to   = Common.RecordOnpage.ToString();
                string p_from = CommonFuc.Get_From_To_Page(currentPage, ref p_to);

                var ds = shipmentDa.Search(_shipmentCode, _contractCode, _productCode, _billing_number, _requestObject, _importObject, _status, p_from, p_to, ref totalRecord);
                lstShipment = CBO <Shipment> .FillCollectionFromDataSet(ds);
            }
            catch (Exception ex)
            {
                Common.log.Error(ex.ToString());
            }
            return(lstShipment);
        }
Example #15
0
        public ActionResult WikihomefindObjects(string keysSearch, string _sortype, int _reconpage, int p_CurrentPage)
        {
            decimal _total_record = 0;
            string  p_to          = "";
            string  p_from        = CommonFuc.Get_From_To_Page(p_CurrentPage, ref p_to, _reconpage);

            _sortype = " ORDER BY " + _sortype;
            if (string.IsNullOrEmpty(_sortype) || _sortype.Trim() == "ORDER BY")
            {
                _sortype = "ALL";
            }
            string htmlPaging = "";

            try
            {
                var _WikiDoc_BL = new WikiDoc_BL();
                keysSearch = "3|" + "ALL|ALL|" + SessionData.CurrentUser.Language;
                List <WikiDoc_Info> _lst = _WikiDoc_BL.HomeWikiDoc_Search(keysSearch, ref _total_record, p_from, p_to, _sortype);
                ViewBag.Paging    = _WikiDoc_BL.GetPagingHtml();
                htmlPaging        = WebApps.CommonFunction.AppsCommon.Get_HtmlPaging <WikiDoc_Info>((int)_total_record, p_CurrentPage, "Bài viết", _reconpage, "WikihomejsPaging");
                ViewBag.Paging    = htmlPaging;
                ViewBag.Obj       = _lst;
                ViewBag.SumRecord = _total_record;
                return(PartialView("~/Areas/Home/Views/Shared/_WikiHomeData.cshtml"));
            }
            catch (Exception ex)
            {
                Logger.LogException(ex);
            }
            return(null);
        }
        public ActionResult ExecuteNewsArticles(NewsInfo pNewsInfo)
        {
            try
            {
                if (SessionData.CurrentUser == null)
                {
                    return(Redirect("/"));
                }

                decimal preturn = 0;
                if (pNewsInfo == null)
                {
                    return(Json(new { status = -99 }));
                }
                string language     = AppsCommon.GetCurrentLang();
                var    ModifiedBy   = SessionData.CurrentUser == null ? "" : SessionData.CurrentUser.Username;
                var    ModifiedDate = CommonFuc.CurrentDate();
                if (pNewsInfo.pfileLogo != null)
                {
                    pNewsInfo.Imageheader = AppLoadHelpers.PushFileToServer(pNewsInfo.pfileLogo, AppUpload.Logo);
                }
                pNewsInfo.Languagecode = language;
                pNewsInfo.Modifiedby   = ModifiedBy;
                pNewsInfo.Modifieddate = ModifiedDate;
                var objNewsBL = new NewsBL();
                preturn = objNewsBL.ArticlesUpdate(pNewsInfo);

                return(Json(new { status = preturn }));
            }
            catch (Exception ex)
            {
                Logger.LogException(ex);
                return(View());
            }
        }
Example #17
0
        public ActionResult FindReminds(string keysSearch, string _sortype, int _reconpage, int p_CurrentPage)
        {
            decimal _total_record = 0;
            string  p_to          = "";
            string  p_from        = CommonFuc.Get_From_To_Page(p_CurrentPage, ref p_to, _reconpage);

            _sortype = " ORDER BY " + _sortype;
            if (string.IsNullOrEmpty(_sortype) || _sortype.Trim() == "ORDER BY")
            {
                _sortype = "ALL";
            }
            string htmlPaging = "";

            try
            {
                string     language = WebApps.CommonFunction.AppsCommon.GetCurrentLang();
                B_Todos_BL _obj_bl  = new B_Todos_BL();
                keysSearch = SessionData.CurrentUser.Username;
                List <B_Remind_Info> _lst = _obj_bl.B_Remind_Search(keysSearch, ref _total_record, p_from, p_to, _sortype);
                htmlPaging        = WebApps.CommonFunction.AppsCommon.Get_HtmlPaging <B_Remind_Info>((int)_total_record, p_CurrentPage, language.Contains("VN") ? "nội dung" : "content", _reconpage, "RemindjsPaging");
                ViewBag.Paging    = htmlPaging;
                ViewBag.Obj       = _lst;
                ViewBag.SumRecord = _total_record;

                var RemindData = AppsCommon.RenderRazorViewToString(this.ControllerContext, "~/Areas/Home/Views/Shared/_RemindData.cshtml");
                return(Json(new { RemindData, Total = _total_record }));
            }
            catch (Exception ex)
            {
                Logger.LogException(ex);
            }
            return(null);
        }
Example #18
0
        public ActionResult Search(string p_keysearch, int p_CurrentPage)
        {
            try
            {
                decimal _total_record = 0;
                string  p_to          = "";
                string  p_from        = CommonFuc.Get_From_To_Page(p_CurrentPage, ref p_to);
                if (p_keysearch == "" || p_keysearch == null)
                {
                    p_keysearch = "ALL";
                }
                Au_GroupBL          _bl  = new Au_GroupBL();
                List <Au_GroupInfo> _lst = _bl.Search(p_keysearch, ref _total_record, p_from, p_to);
                string htmlPaging        = NaviCommon.CommonFuc.Get_HtmlPaging <Au_GroupInfo>((int)_total_record, p_CurrentPage, "bản ghi");


                ViewBag.Paging    = htmlPaging;
                ViewBag.List      = _lst;
                ViewBag.SumRecord = _total_record;
                return(PartialView("~/Areas/UserAndRole/Views/AuGroup/_Partial_List.cshtml"));
            }
            catch (Exception ex)
            {
                NaviCommon.Common.log.Error(ex.ToString());
                return(PartialView("~/Areas/UserAndRole/Views/AuGroup/_Partial_List.cshtml"));
            }
        }
Example #19
0
        public ActionResult Login(string userName, string password, string returnUrl = "")
        {
            if (SessionData.CurrentUser != null)
            {
                return(Json(new { redirectTo = SessionData.CurrentUser.DefaultHomePage }));
            }
            string language = AppsCommon.GetCurrentLang();
            var    result   = new ActionBusinessResult();

            try
            {
                var userBL = new UserBL();
                result = userBL.DoLoginAccount(userName, password, language);
                if (result.IsActionSuccess)
                {
                    var ipAddress = HttpHelper.GetClientIPAddress(System.Web.HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"]);
                    FileHelper.WriteFileLogin(CommonVariables.KnFileLogin, userName, ipAddress);
                    userBL.CurrentUserInfo.Language         = language;
                    SessionData.CurrentUser                 = userBL.CurrentUserInfo;
                    SessionData.CurrentUser.DefaultHomePage = IdentityRequest.GetDefaultPageForAccountLogged();
                    SessionData.CurrentUser.CurrentDate     = CommonFuc.TruncDate();

                    var urlContinue = SessionData.CurrentUser.DefaultHomePage;
                    if (!string.IsNullOrEmpty(returnUrl))
                    {
                        urlContinue = returnUrl;
                    }
                    if (userBL.CurrentUserInfo.loginfirst == 0 && userName != "SuperAdmin")
                    {
                        if (WebApps.Session.SessionData.CurrentUser.Type == (int)CommonEnums.UserType.Customer)
                        {
                            urlContinue = "/customer/quan-ly-customer/get-view-to-edit-customer/" + userBL.CurrentUserInfo.Id.ToString();
                        }
                        else if (WebApps.Session.SessionData.CurrentUser.Type == (int)CommonEnums.UserType.Lawer)
                        {
                            urlContinue = "/luat-su/quan-ly-luat-su/get-view-to-edit-lawer/" + userBL.CurrentUserInfo.Id.ToString();
                        }
                        else
                        {
                            urlContinue = "/quan-tri-he-thong/quan-ly-nguoi-dung/get-view-to-edit-user/" + userBL.CurrentUserInfo.Id.ToString();
                        }
                    }

                    if (language != "VI_VN")
                    {
                        result.MessageCode = KnMessageCode.LoginSuccess_En;
                    }

                    return(Json(new { result = result.ToJson(), urlContinue }));
                }
            }
            catch (Exception ex)
            {
                Logger.LogException(ex);
            }

            return(Json(new { result = result.ToJson() }));
        }
Example #20
0
        internal void LoadWebAppDataWhenResetPool()
        {
            try
            {
                log4net.Config.XmlConfigurator.Configure();
                Configuration.GetConfigAppSetting();
                EmailHelper.EmailOriginal = new EmailInfo()
                {
                    Host        = CommonFuc.GetConfig("EMailHost"),
                    Port        = Convert.ToInt32(CommonFuc.GetConfig("EmailPost")),
                    EMailFrom   = CommonFuc.GetConfig("EMailFrom"),
                    PassWord    = Configuration.EMailPass,
                    DisplayName = CommonFuc.GetConfig("DisplayName"),
                    IsSsl       = CommonFuc.GetConfig("SSL") == "Y",
                    EmailCC     = CommonFuc.GetConfig("EmailCC"),

                    EMailFrom_Business   = CommonFuc.GetConfig("EMailFrom_Business"),
                    PassWord_Business    = Configuration.EMailPass_Business,
                    DisplayName_Business = CommonFuc.GetConfig("DisplayName_Business")
                };

                CommonVariables.AssemblyVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
                CommonVariables.KnFileLogin     = HttpContext.Current.Server.MapPath(@"~/log/LogInApp" + DateTime.Now.ToString("MMyyyy") + ".log");
                MemoryData.LoadAllMemoryData();

                // lấy thông tin fee
                List <AllCodeInfo> _lstTax = WebApps.CommonFunction.AppsCommon.AllCode_GetBy_CdTypeCdName("BILLING", "TAX");
                if (_lstTax.Count > 0)
                {
                    Common.Tax = Convert.ToDecimal(_lstTax[0].CdVal);
                }

                // thread chuyên load dữ liệu tĩnh khi có sự thay đổi
                Thread _th1 = new Thread(ThreadReloadWhenChangeData);
                _th1.IsBackground = true;
                _th1.Start();

                // tự động change trạng thái của remind
                Thread _th2 = new Thread(ThreadReadTodo4SendEmail);
                _th2.IsBackground = true;
                _th2.Start();

                Thread _th3 = new Thread(ThreadSendEmail);
                _th3.IsBackground = true;
                _th3.Start();

                Logger.Log().Info("Start Application_Start");
            }
            catch (Exception ex)
            {
                Logger.LogException(ex);
            }
        }
Example #21
0
        public ActionResult Notify_Billing(string p_keysearch, int p_CurrentPage, string p_column, string p_type_sort)
        {
            try
            {
                decimal    _total_record = 0;
                string     p_to          = "";
                string     p_from        = CommonFuc.Get_From_To_Page(p_CurrentPage, ref p_to);
                B_Todos_BL _obj_bl       = new B_Todos_BL();

                string htmlPaging = "";
                if (p_keysearch.Contains("REMIND"))
                {
                    List <B_Remind_Info> _lst1 = _obj_bl.Notify_R_Search(p_keysearch, SessionData.CurrentUser.Username, ref _total_record, p_from, p_to);
                    ViewBag.Obj = _lst1;
                    htmlPaging  = WebApps.CommonFunction.AppsCommon.Get_HtmlPaging <B_Remind_Info>((int)_total_record, p_CurrentPage, "Nội dung");
                }
                else
                {
                    List <B_Todos_Info> _lst = _obj_bl.Notify_Search(p_keysearch, SessionData.CurrentUser.Username, ref _total_record, p_from, p_to);
                    htmlPaging  = WebApps.CommonFunction.AppsCommon.Get_HtmlPaging <B_Todos_Info>((int)_total_record, p_CurrentPage, "Nội dung");
                    ViewBag.Obj = _lst;
                }

                ViewBag.Paging    = htmlPaging;
                ViewBag.SumRecord = _total_record;
            }
            catch (Exception ex)
            {
                Logger.LogException(ex);
            }

            string[] _arr = p_keysearch.Split('|');
            if (_arr.Length > 0)
            {
                if (_arr[0] == "TODO")
                {
                    return(PartialView("~/Areas/Home/Views/Shared/_TodoData.cshtml"));
                }
                else if (_arr[0] == "ORDER")
                {
                    return(PartialView("~/Areas/Home/Views/Shared/_OrderData.cshtml"));
                }
                else if (_arr[0] == "REMIND")
                {
                    return(PartialView("~/Areas/Home/Views/Shared/_RemindData.cshtml"));
                }
            }
            return(PartialView("~/Areas/Home/Views/Shared/_TodoData.cshtml"));
        }
Example #22
0
        public ActionResult ViewEdit()
        {
            if (SessionData.CurrentUser == null)
            {
                return(Redirect("/account/dang-xuat"));
            }
            var          _WikiDoc_BL = new WikiDoc_BL();
            WikiDoc_Info _ObjInfo    = new WikiDoc_Info();

            decimal _docid = 0;

            if (RouteData.Values.ContainsKey("id"))
            {
                _docid = CommonFuc.ConvertToDecimal(RouteData.Values["id"]);
            }
            int _crrstatus = 0;

            if (RouteData.Values.ContainsKey("id1"))
            {
                _crrstatus = CommonFuc.ConvertToInt(RouteData.Values["id1"]);
            }
            try
            {
                _ObjInfo = _WikiDoc_BL.WikiDoc_GetById(_docid);
                var _WikiCataBL = new WikiCatalogue_BL();
                List <WikiCatalogues_Info> lstOjects = _WikiCataBL.WikiCatalogueGetAll();
                ViewBag.ListCata = lstOjects;

                // bỏ hết hashtag nvshashtag đi
                _ObjInfo.CONTENT = _ObjInfo.CONTENT.Replace("<nvshashtag>", "").Replace("</nvshashtag>", "");

                var _ObjectInfo       = new WikiCatalogues_Info();
                var _WikiCatalogue_BL = new WikiCatalogue_BL();
                _ObjectInfo      = _WikiCatalogue_BL.WikiCatalogue_GetByID(_ObjInfo.CATA_ID);
                ViewBag.CataInfo = _ObjectInfo;
            }
            catch (Exception ex)
            {
                Logger.LogException(ex);
            }
            ViewBag.CurrStatus = _crrstatus;
            return(PartialView("~/Areas/Wiki/Views/WikiDoc/_PartialDocEdit.cshtml", _ObjInfo));
        }
        public ActionResult NewsDetailmembership()
        {
            try
            {
                string _code = "";
                if (RouteData.Values.ContainsKey("id"))
                {
                    _code = CommonFuc.ConvertToString(RouteData.Values["id"]);
                }
                var            objBL     = new Sys_Pages_BL();
                string         language  = AppsCommon.GetCurrentLang();
                Sys_Pages_Info _pageInfo = objBL.Sys_Pages_GetBy_Code(_code);
                ViewBag.objNewInfo = _pageInfo;
                return(View("~/Areas/Sys_Pages/Views/SysPages/NewsDetail_By_Home.cshtml"));

                //string pCategory = "";
                //if (RouteData.Values.ContainsKey("id"))
                //{
                //    pCategory = CommonFuc.ConvertToString(RouteData.Values["id"]);
                //}
                //var objNewsBL = new NewsBL();
                //string language = AppsCommon.GetCurrentLang();
                //List<NewsInfo> lstNews = objNewsBL.NewsStatic(language);
                //ViewBag.objNewInfo = new NewsInfo();
                //if (lstNews.Count > 0)
                //{
                //    foreach (var item in lstNews)
                //    {
                //        if (item.Categories_Id.ToUpper() == pCategory.ToUpper())
                //        {
                //            ViewBag.objNewInfo = item;
                //            return View("~/Areas/Articles/Views/ArticlesNews/NewsDetailByCategory.cshtml");
                //        }
                //    }
                //}
                //return View("~/Areas/Articles/Views/ArticlesNews/NewsDetailByCategory.cshtml");
            }
            catch (Exception ex)
            {
                Logger.LogException(ex);
                return(View());
            }
        }
        public ActionResult EditNewsArticles()
        {
            try
            {
                if (SessionData.CurrentUser == null)
                {
                    return(Redirect("/"));
                }
                decimal pIDArticles = 0;
                int     Status      = 0;
                if (RouteData.Values.ContainsKey("id"))
                {
                    pIDArticles = CommonFuc.ConvertToDecimal(RouteData.Values["id"]);
                }
                if (RouteData.Values.ContainsKey("id2"))
                {
                    Status = CommonFuc.ConvertToInt(RouteData.Values["id2"]);
                }
                ViewBag.Status = Status;
                var objNewsBL = new NewsBL();
                ViewBag.lstCategory = WebApps.CommonFunction.AppsCommon.AllCode_GetBy_CdTypeCdName("ARTICLES", "CATEGORIES");
                string language   = AppsCommon.GetCurrentLang();
                var    objNewInfo = objNewsBL.ArticlesGetById(pIDArticles, language);

                if (SessionData.CurrentUser != null && SessionData.CurrentUser.Type != (decimal)CommonEnums.UserType.Customer)
                {
                    B_Todos_BL   _B_Todos_BL   = new B_Todos_BL();
                    B_Todos_Info _B_Todos_Info = _B_Todos_BL.Todo_GetByCaseCode(objNewInfo.Case_Code, SessionData.CurrentUser.Username);
                    if (_B_Todos_Info != null)
                    {
                        ViewBag.B_Todos_Info = _B_Todos_Info;
                    }
                }

                return(View("~/Areas/Articles/Views/ArticlesNews/_PartialviewEdit.cshtml", objNewInfo));
            }
            catch (Exception ex)
            {
                Logger.LogException(ex);
                return(View());
            }
        }
Example #25
0
        public ActionResult ToDo_Display()
        {
            var             todoBl  = new ToDoBL();
            List <ToDoInfo> lstToDo = new List <ToDoInfo>();

            try
            {
                decimal totalRecord = 0;
                lstToDo = todoBl.Search(1, ref totalRecord);
                string htmlPaging = CommonFuc.Get_HtmlPaging <ToDoInfo>((int)totalRecord, 1, "công việc");
                ViewBag.Paging    = htmlPaging;
                ViewBag.ListToDo  = lstToDo;
                ViewBag.SumRecord = totalRecord;
            }
            catch (Exception ex)
            {
                NaviCommon.Common.log.Error(ex.ToString());
            }
            return(View("~/Areas/ToDo/Views/ToDo/ToDo_Display.cshtml"));
        }
Example #26
0
        public ActionResult ToDo_Search(string keySearch, int currentPage)
        {
            var             todoBl  = new ToDoBL();
            List <ToDoInfo> lstToDo = new List <ToDoInfo>();

            try
            {
                decimal totalRecord = 0;
                lstToDo = todoBl.Search(currentPage, ref totalRecord, keySearch);
                string htmlPaging = CommonFuc.Get_HtmlPaging <ToDoInfo>((int)totalRecord, 1, "công việc");
                ViewBag.Paging    = htmlPaging;
                ViewBag.ListToDo  = lstToDo;
                ViewBag.SumRecord = totalRecord;
            }
            catch (Exception ex)
            {
                NaviCommon.Common.log.Error(ex.ToString());
            }
            return(PartialView("~/Areas/ToDo/Views/ToDo/_Partial_ToDo_List.cshtml"));
        }
Example #27
0
        public ActionResult Contract_Display()
        {
            var             contractBl  = new ContractBL();
            List <Contract> lstContract = new List <Contract>();

            try
            {
                decimal totalRecord = 0;
                lstContract = contractBl.Search(1, ref totalRecord);
                string htmlPaging = CommonFuc.Get_HtmlPaging <Contract>((int)totalRecord, 1, "hợp đồng");
                ViewBag.Paging       = htmlPaging;
                ViewBag.ListContract = lstContract;
                ViewBag.SumRecord    = totalRecord;
            }
            catch (Exception ex)
            {
                NaviCommon.Common.log.Error(ex.ToString());
            }
            return(View("~/Areas/Import/Views/Contract/Contract_Display.cshtml"));
        }
Example #28
0
        public ActionResult Contract_Search(int currentPage, string keySearch)
        {
            var             contractBl  = new ContractBL();
            List <Contract> lstContract = new List <Contract>();

            try
            {
                decimal totalRecord = 0;
                lstContract = contractBl.Search(currentPage, ref totalRecord, keySearch);
                string htmlPaging = CommonFuc.Get_HtmlPaging <Contract>((int)totalRecord, currentPage, "hợp đồng");
                ViewBag.Paging       = htmlPaging;
                ViewBag.ListContract = lstContract;
                ViewBag.SumRecord    = totalRecord;
            }
            catch (Exception ex)
            {
                NaviCommon.Common.log.Error(ex.ToString());
            }
            return(PartialView("~/Areas/Import/Views/Contract/_Partial_Contract_List.cshtml"));
        }
Example #29
0
 public ActionResult NewsDetail_Page()
 {
     try
     {
         string _code = "";
         if (RouteData.Values.ContainsKey("id"))
         {
             _code = CommonFuc.ConvertToString(RouteData.Values["id"]);
         }
         var            objBL     = new Sys_Pages_BL();
         string         language  = AppsCommon.GetCurrentLang();
         Sys_Pages_Info _pageInfo = objBL.Sys_Pages_GetBy_Code(_code);
         ViewBag.objNewInfo = _pageInfo;
         return(View("~/Areas/Sys_Pages/Views/SysPages/NewsDetail_By_Home.cshtml"));
     }
     catch (Exception ex)
     {
         Logger.LogException(ex);
         return(View());
     }
 }
Example #30
0
        public ActionResult Search_Email(string p_keysearch, int p_CurrentPage, string p_column, string p_type_sort)
        {
            try
            {
                decimal           _total_record = 0;
                string            p_to          = "";
                string            p_from        = CommonFuc.Get_From_To_Page(p_CurrentPage, ref p_to);
                Email_BL          _obj_bl       = new Email_BL();
                List <Email_Info> _lst          = _obj_bl.Email_Search(SessionData.CurrentUser.Username, p_keysearch + "|" + SessionData.CurrentUser.Type, ref _total_record, p_from, p_to);
                string            htmlPaging    = WebApps.CommonFunction.AppsCommon.Get_HtmlPaging <Email_Info>((int)_total_record, p_CurrentPage, "Email");

                ViewBag.Paging    = htmlPaging;
                ViewBag.Obj       = _lst;
                ViewBag.SumRecord = _total_record;
                return(PartialView("~/Areas/Manager/Views/Email/_PartialTableEmail.cshtml"));
            }
            catch (Exception ex)
            {
                Logger.LogException(ex);
                return(PartialView("~/Areas/Manager/Views/Email/_PartialTableEmail.cshtml"));
            }
        }