public ActionResult Index()
 {
     Models.BaseModel model = new Models.BaseModel();
     model.UserInfo = _userInfo;
     model.UserRole = _userRole;
     return View(model);
 }
 protected void SetAllValues(Models.BaseModel model)
 {
     model.RecCreatedById = User.Identity.GetUserId();
     model.RecCreatedBy   = User.Identity.Name;
     model.RecCreatedOn   = DateTime.UtcNow;
     model.IsDeleted      = false;
     model.IsActive       = true;
     SetUpdatedValues(model);
 }
Ejemplo n.º 3
0
        public ActionResult About()
        {
            ViewBag.Message = "Your application description page.";

            var vm = new Models.BaseModel
            {
                DisplayName = base.DisplayName
            };

            return(View(vm));
        }
Ejemplo n.º 4
0
        public ActionResult ProductMessage(Models.BaseModel condition)
        {
            int userId = 0; // UserId

            // Kiểm tra đăng nhập
            if (CookieHelper.Get(AdminConfigs.COOKIES_USER_ID) == null)
            {
                string oldUrl = string.Empty;
                if (Request.UrlReferrer != null)
                {
                    oldUrl = Request.UrlReferrer.ToString();
                }

                TempData[AdminConfigs.TEMP_MESSAGE] = AdminConfigs.ERROR_NOT_LOGIN;
                return(RedirectToAction("Login", "User", new { area = "Admin", returnUrl = oldUrl }));
            }
            else
            {
                userId = int.Parse(CookieHelper.Get(AdminConfigs.COOKIES_USER_ID));
            }

            Models.ProductListMessage model = new ProductListMessage();
            var listMessage = productService.ListMessage(userId);
            // Lấy thông tin host.
            Uri    uri     = Request.Url;
            string urlHost = uri.GetLeftPart(UriPartial.Authority);

            if (listMessage.Count > 0)
            {
                foreach (var product in listMessage)
                {
                    product.Content = product.Content.Replace("[user]", product.UserName);
                    product.Content = product.Content.Replace("[phone]", product.Phone);
                    string link = "<a href='" + urlHost + "/" + AdminConfigs.FRIENDLY_LINK_PRODUCT_DETAIL.ToFriendlyUrl(product.ProductId, product.ProductText.ToAlias()) + "'>" + product.ProductText + "</a>";
                    product.Content = product.Content.Replace("[product]", link);
                }
            }
            model.ListMessage = listMessage;
            model.Condition   = condition;

            return(View(model));
        }
Ejemplo n.º 5
0
        public LoadDetailsPage(Models.BaseModel Model)
        {
            InitializeComponent();
            this.Model = Model;

            this.ModelInput.Children.Clear();
            this.ModelOutput.Children.Clear();
            this.SectionsDatagrid.Children.Clear();

            InputControl inputCont = (InputControl)ControlBase.Create(ControlTypes.Input);

            inputCont.SourceObject = Model;
            inputCont.Settings.UpdateDynamically = true;
            inputCont.InputChanged += new InputControl.InputEventHandler(Model.Calculate);
            this.ModelInput.Children.Add(inputCont);

            OutputControl outputCont = (OutputControl)ControlBase.Create(ControlTypes.Output);

            outputCont.SourceObject = Model;
            outputCont.Settings.UpdateDynamically = true;

            inputCont.Submitted += new InputControl.SubmittedHandler(outputCont.Refresh);
            this.ModelOutput.Children.Add(outputCont);
        }
 protected void SetUpdatedValues(Models.BaseModel model)
 {
     model.RecLastUpdatedById = User.Identity.GetUserId();
     model.RecLastUpdatedBy   = User.Identity.Name;
     model.RecLastUpdatedOn   = DateTime.UtcNow;
 }