예제 #1
0
        public ActionResult ExportData_IU(ApplicationHeaderInfo pInfo, App_Detail_PLD01_HDCN_Info pDetail,
                                          List <AppDocumentInfo> pAppDocumentInfo, List <AppFeeFixInfo> pFeeFixInfo)
        {
            try
            {
                string language = AppsCommon.GetCurrentLang();

                // Fill export_header
                string fileName_docx = System.Web.HttpContext.Current.Server.MapPath("/Content/Export/" + "D01_VI_" + TradeMarkAppCode.AppCode_TM_4C2_PLD_01_HDCN + ".docx");

                AppsCommon.Prepare_Data_Export_D01(ref pDetail, pInfo, pAppDocumentInfo, pFeeFixInfo);

                List <App_Detail_PLD01_HDCN_Info> _lst = new List <App_Detail_PLD01_HDCN_Info>();
                _lst.Add(pDetail);

                DataSet _ds_all = ConvertData.ConvertToDataSet <App_Detail_PLD01_HDCN_Info>(_lst, false);
                _ds_all.Tables[0].TableName = "Table_4c2";

                CrystalDecisions.CrystalReports.Engine.ReportDocument oRpt = new CrystalDecisions.CrystalReports.Engine.ReportDocument();

                string _tempfile    = "TM_PLD01_HDCN.rpt";
                string _datetimenow = DateTime.Now.ToString("ddMMyyyyHHmm");
                string fileName_pdf = System.Web.HttpContext.Current.Server.MapPath("/Content/Export/" + "D01_VN_" + _datetimenow + ".pdf");
                if (language == Language.LangVI)
                {
                    fileName_pdf = System.Web.HttpContext.Current.Server.MapPath("/Content/Export/" + "D01_VN_" + _datetimenow + ".pdf");
                    SessionData.CurrentUser.FilePreview = "/Content/Export/" + "D01_VN_" + _datetimenow + ".pdf";
                }
                else
                {
                    _tempfile    = "TM_PLD01_HDCN_EN.rpt"; // tiếng anh
                    fileName_pdf = System.Web.HttpContext.Current.Server.MapPath("/Content/Export/" + "D01_EN_" + _datetimenow + ".pdf");
                    SessionData.CurrentUser.FilePreview = "/Content/Export/" + "D01_EN_" + _datetimenow + ".pdf";
                }
                oRpt.Load(Path.Combine(Server.MapPath("~/Report/"), _tempfile));
                //oRpt.Load(Path.Combine(Server.MapPath("~/Report/"), "TM_PLD01_HDCN.rpt"));

                if (_ds_all != null)
                {
                    oRpt.SetDataSource(_ds_all);
                }
                oRpt.Refresh();

                Response.Buffer = false;
                Response.ClearContent();
                Response.ClearHeaders();

                System.IO.Stream oStream   = oRpt.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
                byte[]           byteArray = new byte[oStream.Length];
                oStream.Read(byteArray, 0, Convert.ToInt32(oStream.Length - 1));
                System.IO.File.WriteAllBytes(fileName_pdf, byteArray.ToArray()); // Requires System.Linq

                return(Json(new { success = 0 }));
            }
            catch (Exception ex)
            {
                Logger.LogException(ex);
                return(Json(new { success = 0 }));
            }
        }
예제 #2
0
        public string GetContentMail(string link)
        {
            string title    = EmailHelper.EmailOriginal.DisplayName;
            string language = AppsCommon.GetCurrentLang();
            string content  = "";

            if (language != "VI_VN")
            {
                content = "Hi, To reset your password, you need to click on the link below. This will help you change your password.";
                return("<div>" +
                       "<div>" + title + "</div>" +
                       "<div>" + content + "</div>" +
                       "<div>" + link + "</div>" +
                       "<div>Thanks.</div>" +
                       "</div>");
            }
            else
            {
                content = "Chào bạn, Để đặt lại mật khẩu, bạn cần bấm vào link liên kết bên dưới. Thao tác này sẽ giúp bạn thay đổi mật khẩu.";
                return("<div>" +
                       "<div>" + title + "</div>" +
                       "<div>" + content + "</div>" +
                       "<div>" + link + "</div>" +
                       "<div>Cảm ơn.</div>" +
                       "</div>");
            }
        }
예제 #3
0
        public ActionResult DoEdit(Docking_Info p_Docking_Info)
        {
            try
            {
                Docking_BL _obj_bl = new Docking_BL();
                p_Docking_Info.Modify_By     = SessionData.CurrentUser.Username;
                p_Docking_Info.Modify_Date   = DateTime.Now;
                p_Docking_Info.Language_Code = AppsCommon.GetCurrentLang();
                p_Docking_Info.Document_Name = p_Docking_Info.Document_Name_Type + p_Docking_Info.Document_Name_Other;

                if (p_Docking_Info.File_Upload != null)
                {
                    var url_File_Upload = AppLoadHelpers.PushFileToServer(p_Docking_Info.File_Upload, AppUpload.Document);
                    p_Docking_Info.FileName = p_Docking_Info.File_Upload.FileName;
                    p_Docking_Info.Url      = url_File_Upload;
                }
                else
                {
                    p_Docking_Info.FileName = "NA";
                    p_Docking_Info.Url      = "NA";
                }

                decimal _ck = _obj_bl.Docking_Update(p_Docking_Info);
                return(Json(new { success = _ck }));
            }
            catch (Exception ex)
            {
                Logger.LogException(ex);
                return(Json(new { success = "-1" }));
            }
        }
예제 #4
0
        public ActionResult KnHome()
        {
            if (SessionData.CurrentUser == null)
            {
                return(this.Redirect("/"));
            }
            var    userBL          = new UserBL(SessionData.CurrentUser);
            string language        = AppsCommon.GetCurrentLang();
            string sessionLanguage = SessionData.CurrentUser.Language;

            if (language != sessionLanguage)
            {
                SessionData.CurrentUser.Language = language;
                SessionData.CurrentUser.HtmlMenu = userBL.GetUserHtmlMenu(language);
            }
            ViewBag.LanguageCode = language;

            B_Todos_BL        _obj_bl      = new B_Todos_BL();
            B_TodoNotify_Info p_todonotify = new B_TodoNotify_Info();

            p_todonotify       = _obj_bl.GET_NOTIFY(SessionData.CurrentUser.Username);
            ViewBag.NotifyInfo = p_todonotify;

            return(View("~/Areas/Home/Views/Home/LegalHome.cshtml"));
        }
예제 #5
0
        public ActionResult Index()
        {
            try
            {
                if (SessionData.CurrentUser == null)
                    return Redirect("/");

                SessionData.CurrentUser.chashFile.Clear();
                string AppCode = "";
                if (RouteData.Values.ContainsKey("id"))
                {
                    AppCode = RouteData.Values["id"].ToString().ToUpper();
                }
                ViewBag.AppCode = AppCode.ToUpper();

                AppDetail06DKQT_BL _AppDetail06DKQT_BL = new AppDetail06DKQT_BL();
                List<App_Detail_TM06DKQT_Info> _listTM06 = new List<App_Detail_TM06DKQT_Info>();
                // truyền vào trạng thái nào? để tạm thời = 7 là đã gửi lên cục
                _listTM06 = _AppDetail06DKQT_BL.AppTM06SearchByStatus(7, AppsCommon.GetCurrentLang());
                ViewBag.ListTM06nhdetail = _listTM06;
                ViewBag.Isdisable = 0;
                return PartialView("~/Areas/DKQT/Views/C07/_Partial_C07.cshtml");
            }
            catch (Exception ex)
            {
                Logger.LogException(ex);
                return PartialView("~/Areas/DKQT/Views/C07/_Partial_C07.cshtml");
            }
        }
예제 #6
0
        public ActionResult SearchArticles(string pCategory, string pTitile, int pPage, string pStatus)
        {
            try
            {
                ViewBag.Status = pStatus;

                //Nếu bài chờ xử lý thì lấy danh sách các bài đã gửi
                //if (pStatus == Status.ChoXuly.ToString())
                //{
                //    pStatus = Status.VietBai.ToString();
                //}

                int             from          = (pPage - 1) * (Common.Common.RecordOnpage);
                int             to            = (pPage) * (Common.Common.RecordOnpage);
                decimal         _total_record = 0;
                NewsBL          objBL         = new NewsBL();
                string          language      = AppsCommon.GetCurrentLang();
                string          _keySearch    = pStatus.ToString() + "|ALL|" + language + "|" + pCategory + "|" + (pTitile == "" ? "ALL" : pTitile) + "|" + SessionData.CurrentUser.Username;
                List <NewsInfo> _lst          = objBL.ArticleHomeSearch(_keySearch, ref _total_record, from.ToString(), to.ToString());
                string          htmlPaging    = WebApps.CommonFunction.AppsCommon.Get_HtmlPaging <NewsInfo>((int)_total_record, pPage, "Tin");
                ViewBag.listArticles = _lst;
                ViewBag.Paging       = htmlPaging;
                ViewBag.SumRecord    = _total_record;
                ViewBag.lstCategory  = WebApps.CommonFunction.AppsCommon.AllCode_GetBy_CdTypeCdName("ARTICLES", "CATEGORIES");

                return(View("~/Areas/Articles/Views/ArticlesNews/_PartialViewTable.cshtml"));
            }
            catch (Exception ex)
            {
                Logger.LogException(ex);
                return(View());
            }
        }
예제 #7
0
        public ActionResult GetNextPage(string pCategory, int pPage)
        {
            try
            {
                ViewBag.Status = Status.XuatBan;
                int     from          = (pPage - 1) * (Common.Common.RecordOnpage);
                int     to            = (pPage) * (Common.Common.RecordOnpage);
                decimal _total_record = 0;
                NewsBL  objBL         = new NewsBL();
                string  language      = AppsCommon.GetCurrentLang();

                string          _title     = "ALL";
                string          _keySearch = Status.XuatBan.ToString() + "|ALL|" + language + "|" + pCategory + "|" + _title + "|" + SessionData.CurrentUser.Username;
                List <NewsInfo> _lst       = objBL.ArticleHomeSearch(_keySearch, ref _total_record, from.ToString(), to.ToString());
                string          htmlPaging = WebApps.CommonFunction.AppsCommon.Get_HtmlPaging <NewsInfo>((int)_total_record, pPage, "Tin");
                ViewBag.listArticles = _lst;
                ViewBag.Paging       = htmlPaging;
                ViewBag.SumRecord    = _total_record;
                //ViewBag.lstCategory = WebApps.CommonFunction.AppsCommon.AllCode_GetBy_CdTypeCdName("ARTICLES", "CATEGORIES");
                return(View("~/Areas/Articles/Views/ArticlesNews/_HomePartialViewNews.cshtml"));
            }
            catch (Exception ex)
            {
                Logger.LogException(ex);
                return(View());
            }
        }
 public ActionResult TM06NHGetInfo(string pAppHeaderId, string p_idchudon,
                                   string p_iddaidienchudon, string p_idappclass)
 {
     try
     {
         var    objBL    = new C07_BL();
         string language = AppsCommon.GetCurrentLang();
         List <AppClassDetailInfo> _listClass = new List <AppClassDetailInfo>();
         App_Detail_TM06DKQT_Info  _TM06Info  = objBL.AppTM06DKQTGetByID(pAppHeaderId, language, 0, ref _listClass);// tạm thời truyền vào trạng thái = 0 và k wherre trong db
         ViewBag.lstClassDetailInfo = _listClass;
         ViewBag.objAppHeaderInfo   = _TM06Info;
         string _viewChuDon        = "";
         string _viewDaiDienChuDon = "";
         string _viewAppClass      = "";
         //ViewBag.Isdisable = 1;
         _viewChuDon        = RenderPartialToString("~/Areas/TradeMark/Views/Shared/_PartialThongTinChuDon.cshtml", p_idchudon);
         _viewDaiDienChuDon = RenderPartialToString("~/Areas/TradeMark/Views/Shared/_PartialThongTinDaiDienChuDon.cshtml", p_iddaidienchudon);
         _viewAppClass      = RenderPartialToString("~/Areas/TradeMark/Views/Shared/_PartialTMAddAppClass.cshtml", null);
         return(Json(new
         {
             success = 0,
             NgayNopDon = _TM06Info.NGAYNOPDON.ToDateStringN0(),
             LogoURL = _TM06Info.LOGOURL,
             ViewChuDon = _viewChuDon,
             ViewDaiDienChuDon = _viewDaiDienChuDon,
             ViewAppClass = _viewAppClass
         }));
     }
     catch (Exception ex)
     {
         Logger.LogException(ex);
         return(Json(new { success = -1 }));
     }
 }
예제 #9
0
        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());
            }
        }
예제 #10
0
        public ActionResult GetNewsHomePage()
        {
            try
            {
                decimal pStatus       = Status.XuatBan;
                decimal _total_record = 0;
                NewsBL  objBL         = new NewsBL();
                //string _status = "ALL";
                string language  = AppsCommon.GetCurrentLang();
                string _category = "ALL";
                string _title    = "ALL";
                //string _username = SessionData.CurrentUser == null ? "" : SessionData.CurrentUser.Username;
                string _username = "";

                string          _keySearch = pStatus.ToString() + "|ALL|" + language + "|" + _category + "|" + _title + "|" + _username;
                List <NewsInfo> _lst       = objBL.ArticleHomeSearch(_keySearch, ref _total_record, "1", "10");
                string          htmlPaging = WebApps.CommonFunction.AppsCommon.Get_HtmlPaging <NewsInfo>((int)_total_record, 1, "Tin");
                ViewBag.listArticles = _lst;
                ViewBag.Paging       = htmlPaging;
                ViewBag.SumRecord    = _total_record;
                return(View("~/Areas/Articles/Views/ArticlesNews/_HomeArticles.cshtml"));
            }
            catch (Exception ex)
            {
                Logger.LogException(ex);
                return(View());
            }
        }
예제 #11
0
        public ActionResult DelNewsArticles(decimal pIDArticles)
        {
            try
            {
                decimal preturn = 0;
                if (SessionData.CurrentUser == null)
                {
                    return(Redirect("/"));
                }
                var objNewsBL = new NewsBL();
                ViewBag.lstCategory = WebApps.CommonFunction.AppsCommon.AllCode_GetBy_CdTypeCdName("ARTICLES", "CATEGORIES");
                string   language     = AppsCommon.GetCurrentLang();
                NewsInfo pNewsInfo    = new NewsInfo();
                var      ModifiedBy   = SessionData.CurrentUser.Username;
                var      ModifiedDate = SessionData.CurrentUser.CurrentDate;
                pNewsInfo.Id           = pIDArticles;
                pNewsInfo.Languagecode = language;
                pNewsInfo.Modifiedby   = ModifiedBy;
                pNewsInfo.Modifieddate = ModifiedDate;

                preturn = objNewsBL.ArticlesDeleted(pNewsInfo);
                return(Json(new { status = preturn }));
            }
            catch (Exception ex)
            {
                Logger.LogException(ex);
                return(View());
            }
        }
예제 #12
0
 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());
     }
 }
예제 #13
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());
            }
        }
예제 #14
0
        public ActionResult DoAddDoc(WikiDoc_Info _objectInfo, List <AppDocumentInfo> pAppDocumentInfo)
        {
            string  strListHashtag = "";
            decimal pReturn        = 0;

            try
            {
                var _WikiDoc_BL = new WikiDoc_BL();
                _objectInfo.CREATED_BY    = SessionData.CurrentUser.Username;
                _objectInfo.CREATED_DATE  = DateTime.Now;
                _objectInfo.LANGUAGE_CODE = AppsCommon.GetCurrentLang();
                _objectInfo.CONTENT       = SetHashtagStyle(_objectInfo.CONTENT, ref strListHashtag);
                if (pAppDocumentInfo != null)
                {
                    if (pAppDocumentInfo.Count > 0)
                    {
                        foreach (var info in pAppDocumentInfo)
                        {
                            if (SessionData.CurrentUser.chashFile.ContainsKey(info.keyFileUpload))
                            {
                                string   _url      = (string)SessionData.CurrentUser.chashFile[info.keyFileUpload];
                                string[] _arr      = _url.Split('/');
                                string   _filename = WebApps.Resources.Resource.FileDinhKem;
                                if (_arr.Length > 0)
                                {
                                    _filename = _arr[_arr.Length - 1];
                                }

                                info.Filename     = _filename;
                                info.Url_Hardcopy = _url;

                                if (info.keyFileUpload == "WIKIADD_FILE_01")
                                {
                                    _objectInfo.FILE_URL01 = info.Url_Hardcopy;
                                }
                                if (info.keyFileUpload == "WIKIADD_FILE_02")
                                {
                                    _objectInfo.FILE_URL02 = info.Url_Hardcopy;
                                }
                                if (info.keyFileUpload == "WIKIADD_FILE_03")
                                {
                                    _objectInfo.FILE_URL03 = info.Url_Hardcopy;
                                }
                                // lấy xong thì xóa
                                SessionData.CurrentUser.chashFile.Remove(info.keyFileUpload);
                            }
                        }
                    }
                }
                pReturn = _WikiDoc_BL.WikiDoc_Insert(_objectInfo);
            }
            catch (Exception ex)
            {
                Logger.LogException(ex);
            }

            return(Json(new { status = pReturn, HashTag = strListHashtag.Trim() }));
        }
예제 #15
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() }));
        }
예제 #16
0
        public ActionResult ContactDisplay()
        {
            var            objBL     = new Sys_Pages_BL();
            string         language  = AppsCommon.GetCurrentLang();
            Sys_Pages_Info _pageInfo = objBL.Sys_Pages_GetBy_Code("abot");

            ViewBag.objNewInfo = _pageInfo;
            return(View("~/Areas/Contact/Views/Contact/ContactDisplay.cshtml"));
        }
예제 #17
0
        public ActionResult Do_Fogot_Pass(string gmail)
        {
            bool _ck = false;

            try
            {
                UserInfo _user   = new UserInfo();
                UserBL   _userBL = new UserBL();
                _user = _userBL.GetBy_Email(gmail);
                List <string> _LstAttachment = new List <string>();

                if (_user == null || _user.Id == 0)
                {
                    return(Json(new { success = -2 }));
                }

                DateTime currentTime = DateTime.Now;
                DateTime current     = currentTime.AddMinutes(5);

                string _nd_confirm = current.ToString("ddMMyyyy HH:mm") + "_" + _user.Id;

                _nd_confirm = WebApps.CommonFunction.AppsCommon.EncryptString(_nd_confirm);
                //string key_EncryptString = WebApps.CommonFunction.AppsCommon.DecryptString(_nd_confirm);
                string link     = Configuration.LinkPathlaw + "/vi-vn/quen-mat-khau/thong-bao?confirm=" + _nd_confirm;
                string language = AppsCommon.GetCurrentLang();
                if (language != "VI_VN")
                {
                    link = Configuration.LinkPathlaw + "/en-gb/quen-mat-khau/thong-bao?confirm=" + _nd_confirm;
                }
                string content = GetContentMail(link);

                Email_Info _Email_Info = new Email_Info
                {
                    EmailFrom    = EmailHelper.EmailOriginal.EMailFrom,
                    Pass         = EmailHelper.EmailOriginal.PassWord,
                    Display_Name = EmailHelper.EmailOriginal.DisplayName,

                    EmailTo       = _user.Email,
                    EmailCC       = "",
                    Subject       = "Đặt lại mật khẩu",
                    Content       = content,
                    LstAttachment = _LstAttachment,
                };

                CommonFunction.AppsCommon.EnqueueSendEmail(_Email_Info);

                //_ck = EmailHelper.SendMail(_user.Email, "", "Đặt lại mật khẩu", content, _LstAttachment);
                return(Json(new { success = 1 }));
            }
            catch (Exception ex)
            {
                Logger.LogException(ex);
            }
            return(Json(new { success = _ck }));
        }
예제 #18
0
 public ActionResult DoDelete(int p_id)
 {
     try
     {
         Docking_BL _obj_bl    = new Docking_BL();
         var        modifiedBy = SessionData.CurrentUser.Username;
         decimal    _result    = _obj_bl.Docking_Update_Delete(p_id, AppsCommon.GetCurrentLang(), SessionData.CurrentUser.Username, DateTime.Now);
         return(Json(new { success = _result }));
     }
     catch (Exception ex)
     {
         Logger.LogException(ex);
         return(Json(new { success = -1 }));
     }
 }
예제 #19
0
 public ActionResult DoEditTimeSheet(Timesheet_Info p_Timesheet_Info)
 {
     try
     {
         TimeSheet_BL _obj_bl = new TimeSheet_BL();
         p_Timesheet_Info.Modify_By = SessionData.CurrentUser.Username;
         decimal _ck = _obj_bl.Timesheet_Update(p_Timesheet_Info, AppsCommon.GetCurrentLang());
         return(Json(new { success = _ck }));
     }
     catch (Exception ex)
     {
         Logger.LogException(ex);
         return(Json(new { success = "-1" }));
     }
 }
예제 #20
0
 public ActionResult DoDelete(int p_id)
 {
     try
     {
         SearchObject_BL _searchBL  = new SearchObject_BL();
         var             modifiedBy = SessionData.CurrentUser.Username;
         decimal         _result    = _searchBL.SEARCH_HEADER_DELETE(p_id, AppsCommon.GetCurrentLang(), SessionData.CurrentUser.Username);
         return(Json(new { success = _result }));
     }
     catch (Exception ex)
     {
         Logger.LogException(ex);
         return(Json(new { success = -1 }));
     }
 }
예제 #21
0
        public ActionResult GetView2View(decimal id, string case_code)
        {
            try
            {
                Email_BL   _obj_bl     = new Email_BL();
                Email_Info _Email_Info = _obj_bl.Email_GetBy_Id(id, case_code, AppsCommon.GetCurrentLang());
                ViewBag.Email_Info = _Email_Info;
            }
            catch (Exception ex)
            {
                Logger.LogException(ex);
            }

            return(PartialView("~/Areas/Manager/Views/Email/_PartialView.cshtml"));
        }
예제 #22
0
 public ActionResult DoInsertTimeSheet(Timesheet_Info p_Timesheet_Info)
 {
     try
     {
         TimeSheet_BL _obj_bl = new TimeSheet_BL();
         p_Timesheet_Info.Created_By = SessionData.CurrentUser.Username;
         p_Timesheet_Info.Lawer_Id   = SessionData.CurrentUser.Id;
         p_Timesheet_Info.Status     = (decimal)CommonEnums.TimeSheet_Status.New;
         decimal _ck = _obj_bl.Timesheet_Insert(p_Timesheet_Info, AppsCommon.GetCurrentLang());
         return(Json(new { success = _ck }));
     }
     catch (Exception ex)
     {
         Logger.LogException(ex);
         return(Json(new { success = "-1" }));
     }
 }
 public ActionResult AppDangKyNhanHieu()
 {
     try
     {
         AppDetail04NHBL          _AppDetail04NHBL = new AppDetail04NHBL();
         List <AppDetail04NHInfo> _list04nh        = new List <AppDetail04NHInfo>();
         // truyền vào trạng thái nào? để tạm thời = 7 là đã gửi lên cục
         _list04nh = _AppDetail04NHBL.AppTM04NHSearchByStatus(7, AppsCommon.GetCurrentLang());
         ViewBag.ListAppDetail04NHInfo = _list04nh;
         ViewBag.Isdisable             = 0;
     }
     catch (Exception ex)
     {
         Logger.LogException(ex);
     }
     return(PartialView("~/Areas/TradeMark/Views/TradeMarkRegistrationDKQT/_PartalDangKyNhanHieu.cshtml"));
 }
예제 #24
0
        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());
            }
        }
예제 #25
0
        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());
            }
        }
예제 #26
0
        public ActionResult TodoNews()
        {
            try
            {
                if (SessionData.CurrentUser == null)
                {
                    return(Redirect("/"));
                }
                string _casecode = "";
                if (RouteData.Values.ContainsKey("id"))
                {
                    _casecode = RouteData.Values["id"].ToString();
                }

                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(_casecode, SessionData.CurrentUser.Username);
                    if (_B_Todos_Info != null)
                    {
                        ViewBag.B_Todos_Info = _B_Todos_Info;
                    }
                }

                var objNewsBL = new NewsBL();
                ViewBag.lstCategory = WebApps.CommonFunction.AppsCommon.AllCode_GetBy_CdTypeCdName("ARTICLES", "CATEGORIES");
                string language   = AppsCommon.GetCurrentLang();
                var    objNewInfo = objNewsBL.ArticlesGetByCaseCode(_casecode, language);
                if (objNewInfo != null)
                {
                    ViewBag.Status = objNewInfo.Status;
                }

                return(View("~/Areas/Articles/Views/ArticlesNews/_Partial_Approve.cshtml", objNewInfo));
            }
            catch (Exception ex)
            {
                Logger.LogException(ex);
                return(View());
            }
        }
예제 #27
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());
     }
 }
예제 #28
0
        public ActionResult GetListArticles()
        {
            try
            {
                decimal pStatus = 0;
                if (SessionData.CurrentUser == null)
                {
                    return(Redirect("/"));
                }
                if (RouteData.Values.ContainsKey("id"))
                {
                    pStatus = CommonFuc.ConvertToDecimal(RouteData.Values["id"]);
                }
                ViewBag.Status = pStatus;


                decimal         _total_record = 0;
                NewsBL          objBL         = new NewsBL();
                string          _status       = "ALL";
                string          language      = AppsCommon.GetCurrentLang();
                string          _category     = "ALL";
                string          _title        = "ALL";
                string          _keySearch    = _status + "|ALL|" + language + "|" + _category + "|" + _title + "|" + SessionData.CurrentUser.Username;
                List <NewsInfo> _lst          = objBL.ArticleHomeSearch(_keySearch, ref _total_record);
                string          htmlPaging    = WebApps.CommonFunction.AppsCommon.Get_HtmlPaging <NewsInfo>((int)_total_record, 1, "Tin");
                ViewBag.listArticles = _lst;
                ViewBag.Paging       = htmlPaging;
                ViewBag.Status       = pStatus;
                ViewBag.SumRecord    = _total_record;
                ViewBag.lstCategory  = WebApps.CommonFunction.AppsCommon.AllCode_GetBy_CdTypeCdName("ARTICLES", "CATEGORIES");

                return(View("~/Areas/Articles/Views/ArticlesNews/GetListArticles.cshtml"));
            }
            catch (Exception ex)
            {
                Logger.LogException(ex);
                return(View());
            }
        }
예제 #29
0
 public ActionResult NewsDetailPortal()
 {
     try
     {
         decimal pIDArticles = 0;
         //int Status = 7;
         if (RouteData.Values.ContainsKey("id"))
         {
             pIDArticles = CommonFuc.ConvertToDecimal(RouteData.Values["id"]);
         }
         var    objNewsBL  = new NewsBL();
         string language   = AppsCommon.GetCurrentLang();
         var    objNewInfo = objNewsBL.ArticlesGetById(pIDArticles, language);
         ViewBag.objNewInfo = objNewInfo;
         return(View("~/Areas/Articles/Views/ArticlesNews/_HomeDetailNews.cshtml"));
     }
     catch (Exception ex)
     {
         Logger.LogException(ex);
         return(View());
     }
 }
예제 #30
0
 public ActionResult SendEmail(string name, string mail, string sub, string content)
 {
     try
     {
         // insert
         Contact_BL  _bl           = new Contact_BL();
         string      _LanguageCode = AppsCommon.GetCurrentLang();
         ContactInfo _contact      = new ContactInfo();
         _contact.ContactName = name;
         _contact.Email       = mail;
         _contact.Subject     = sub;
         _contact.Content     = content;
         _contact.Language    = _LanguageCode;
         decimal _ck = _bl.Contact_Insert(_contact);
         return(Json(new { status = _ck }));
     }
     catch (Exception ex)
     {
         Logger.LogException(ex);
         return(Json(new { status = -1 }));
     }
 }