Ejemplo n.º 1
0
        public ActionResult AddOrEditProduct(Guid?id)
        {
            ProductViewModel model = new ProductViewModel();

            model.DropDownBrand  = DropDownListDomain.DropDownList_Brand(_brandService.SelectAll());
            model.DropDownVendor = DropDownListDomain.DropDownList_Vendor(_vendorService.SelectAll());
            model.Volumes        = DropDownListDomain.GetVolumeCheckBoxes();

            if (id.HasValue)
            {
                var product = _productService.GetById(id.Value);
                model.Id          = product.Id;
                model.Name        = product.Name;
                model.Brand_Id    = product.Brand_Id;
                model.Vendor_Id   = product.Vendor_Id;
                model.Description = product.Description;
                model.ImagePath   = product.ImagePath;
                model.CreateDate  = product.CreatedDate;
                model.IsActive    = product.IsActive;
                return(View(model));
            }
            else
            {
                return(View(model));
            }
        }
        public ActionResult AddOrEditBanner(Guid?id)
        {
            try
            {
                BannerViewModel model = new BannerViewModel();

                model.DropDownBannerType = DropDownListDomain.DropDownList_BannerType();

                if (id.HasValue)
                {
                    var banner = _bannerService.GetById(id.Value);
                    model.Id    = banner.Id;
                    model.Image = banner.Image;
                    model.Link  = banner.Link;

                    model.CreateDate = banner.CreatedDate;
                    model.IsActive   = banner.IsActive;
                    return(View(model));
                }
                else
                {
                    return(View(model));
                }
            }
            catch { return(RedirectToAction("Erorr500", "HomdeAdmin")); }
        }
Ejemplo n.º 3
0
        private void BindDropDownList()
        {
            IList <ItarmSystem> resultSite = m_SystemListPopUpBiz.GetItarmSystemSite();

            DropDownListSite.DataSource     = resultSite;
            DropDownListSite.DataTextField  = "Site";
            DropDownListSite.DataValueField = "Site";
            DropDownListSite.DataBind();
            DropDownListSite.Items.Insert(0, "");

            IList <string> resultDomain = m_SystemListPopUpBiz.GetItarmSystemDomain();

            DropDownListDomain.DataSource = resultDomain;
            //DropDownListDomain.DataTextField = "value";
            //DropDownListDomain.DataValueField = "value";
            //DropDownListDomain.DataTextField = "SystemDomain";
            //DropDownListDomain.DataValueField = "SystemDomain";
            DropDownListDomain.DataBind();
            DropDownListDomain.Items.Insert(0, "");

            IList <ItarmUser> resultPM = m_SystemListPopUpBiz.GetItarmPmNoName();

            DropDownListPM.DataSource     = resultPM;
            DropDownListPM.DataTextField  = "EnglishName";
            DropDownListPM.DataValueField = "EnglishName";
            DropDownListPM.DataBind();
            DropDownListPM.Items.Insert(0, "");
        }
Ejemplo n.º 4
0
        public ActionResult AddOrEditProductVariation(Guid?id)
        {
            try
            {
                var model = new ProVarationViewModel();

                model.DropDownProduct = DropDownListDomain.DropDownList_Product(_productService.SelectAll());
                model.DropDownVolume  = DropDownListDomain.DropDownList_Volume();

                if (id.HasValue)
                {
                    var productVariation = _productVariationService.GetById(id.Value);

                    model = ConvertDomainToModel.ConvertModelFromDomainToProVa(productVariation);

                    model.DropDownProduct = DropDownListDomain.DropDownList_Product(_productService.SelectAll());
                    model.DropDownVolume  = DropDownListDomain.DropDownList_Volume();

                    model.Image = _productImageService.GetProductImage(model.Id) == null ? null :
                                  ConvertDomainToModel.GetProductImage(_productImageService.GetProductImage(model.Id));

                    return(View(model));
                }
                else
                {
                    return(View(model));
                }
            }
            catch { return(RedirectToAction("Erorr500", "HomdeAdmin")); }
        }
        public ActionResult AddOrEditProduct(Guid?id)
        {
            try
            {
                ProductViewModel model = new ProductViewModel();

                model.DropDownBrand      = DropDownListDomain.DropDownList_Brand(_brandService.SelectAll());
                model.DropDownVendor     = DropDownListDomain.DropDownList_Vendor(_vendorService.SelectAll());
                model.Volumes            = DropDownListDomain.GetVolumeCheckBoxes();
                model.DropDowncategories = DropDownListDomain.DropDownList_Categoty(_categoryService.SelectAll());

                if (id.HasValue)
                {
                    var product = _productService.GetById(id.Value);
                    model.Id          = product.Id;
                    model.Name        = product.Name;
                    model.Brand_Id    = product.Brand_Id;
                    model.Vendor_Id   = product.Vendor_Id;
                    model.Description = product.Description;
                    model.ImagePath   = product.ImagePath;
                    model.CreateDate  = product.CreatedDate;
                    model.IsActive    = true;
                    return(View(model));
                }
                else
                {
                    return(View(model));
                }
            }
            catch { return(RedirectToAction("Erorr500", "HomdeAdmin")); }
        }
Ejemplo n.º 6
0
    private void Domain_Loader()
    {
        string constrng = ConfigurationManager.ConnectionStrings["ConnString"].ConnectionString;

        using (SqlConnection con = new SqlConnection(constrng))
        {
            using (SqlCommand cmd = new SqlCommand("[domain_procedure]", con))
            {
                cmd.CommandType = CommandType.StoredProcedure;
                con.Open();
                using (SqlDataAdapter da = new SqlDataAdapter(cmd))
                {
                    DataSet ds = new DataSet();

                    da.Fill(ds);
                    DropDownListDomain.DataSource      = ds.Tables[0];
                    DropDownListDomain2.DataSource     = ds.Tables[0];
                    DropDownListDomain.DataTextField   = "domain_menu";
                    DropDownListDomain2.DataTextField  = "domain_menu";
                    DropDownListDomain.DataValueField  = "id";
                    DropDownListDomain2.DataValueField = "id";
                    DropDownListDomain.DataBind();
                    DropDownListDomain2.DataBind();
                }
            }
        }
        DropDownListDomain.Items.Insert(0, new ListItem("Select Domain", "0"));
        DropDownListDomain2.Items.Insert(0, new ListItem("Select Domain", "0"));
    }
        public ActionResult AddOrEditCategory(Guid?id)
        {
            try
            {
                CategoryViewModel model = new CategoryViewModel();

                model.DropDownCategory = DropDownListDomain.DropDownList_Categoty(_categoryService.SelectAll().OrderBy(p => p.Name).ToList());
                model.DropDownProduct  = DropDownListDomain.DropDownList_Product(_productService.SelectAll().OrderBy(p => p.Name).ToList());

                if (id.HasValue)
                {
                    var category = _categoryService.GetById(id.Value);
                    model.Id          = category.Id;
                    model.Name        = category.Name;
                    model.ParentId    = category.ParentId;
                    model.Summary     = category.Summary;
                    model.UpdatedDate = category.UpdatedDate;
                    model.CreatedDate = category.CreatedDate;
                    model.IsActive    = category.IsActive;
                    return(View(model));
                }
                else
                {
                    return(View(model));
                }
            }
            catch { return(RedirectToAction("Erorr500", "HomdeAdmin")); }
        }
        public ActionResult AddOrEditProductAdvertisement(Guid?id)
        {
            try
            {
                ProductAdvertisementViewModel model = new ProductAdvertisementViewModel();

                model.DropDownProductAd = DropDownListDomain.DropDownList_ProductADType();

                if (id.HasValue)
                {
                    var productadvertisement = _productadvertisementService.GetById(id.Value);
                    model.Id              = productadvertisement.Id;
                    model.Title           = productadvertisement.Title;
                    model.EventUrl        = productadvertisement.EventUrl;
                    model.EventUrlCaption = productadvertisement.EventUrlCaption;
                    model.Description     = productadvertisement.Description;
                    model.ImagePath       = productadvertisement.ImagePath;
                    model.CreateDate      = productadvertisement.CreatedDate;
                    model.IsActive        = productadvertisement.IsActive;
                    return(View(model));
                }
                else
                {
                    return(View(model));
                }
            }
            catch { return(RedirectToAction("Erorr500", "HomdeAdmin")); }
        }
Ejemplo n.º 9
0
 /// <summary>
 /// get detail Order and display on DetailOrder view
 /// </summary>
 /// <param name="id">Order Id</param>
 /// <returns></returns>
 public ActionResult DetailOrder(Guid id)
 {
     try
     {
         var order = _orderService.GetOrderById(id);
         var model = new OrderViewModel
         {
             Id = order.Id,
             DeliveryAddress = order.DeliveryAddress,
             DeliveryName    = order.DeliveryName,
             DeliveryPhone   = order.DeliveryPhone,
             OrderDate       = order.OrderDate,
             CreateDate      = order.CreatedDate,
             IsActive        = order.IsActive,
             DeliveryFee     = order.DeliveryFee,
             Email           = order.Email,
             Note            = order.Note,
             Status          = order.Status,
             SubPrice        = order.SubPrice,
             ToatalPrice     = order.ToatalPrice,
             OrderDetails    = order.OrderDetails
         };
         ViewBag.OrderStatus = DropDownListDomain.DropDownList_OrderStatus();
         return(View(model));
     }
     catch { return(RedirectToAction("Erorr500", "HomdeAdmin")); }
 }
Ejemplo n.º 10
0
        public void BindDropDown()
        {
            IList <BaseDataDepartment> baseDataDepartment = bugInquiryBiz.SelectBaseDataDepartmentNameId();

            DropDownListDepartment.DataSource     = baseDataDepartment;
            DropDownListDepartment.DataTextField  = "Name";
            DropDownListDepartment.DataValueField = "Id";
            DropDownListDepartment.DataBind();
            DropDownListDepartment.Items.Insert(0, "");
            ViewState["baseDataDepartment"] = baseDataDepartment;

            IList <BaseDataDomain> baseDataDomainList = baseDataDomainBiz.SelectBaseDataDomain(null);

            DropDownListDomain.DataSource     = baseDataDomainList;
            DropDownListDomain.DataTextField  = "Name";
            DropDownListDomain.DataValueField = "Id";
            DropDownListDomain.DataBind();
            DropDownListDomain.Items.Insert(0, "");
            ViewState["baseDataDomainList"] = baseDataDomainList;
        }
Ejemplo n.º 11
0
        private void BindDropDownList()
        {
            try
            {
                PmsSysBiz      pmsSysBiz  = new PmsSysBiz();
                IList <PmsSys> pmsSysList = new List <PmsSys>();

                pmsSysList = pmsSysBiz.SelectData1ByType("PM", "ReportDomain");

                DropDownListDomain.DataSource     = pmsSysList;
                DropDownListDomain.DataTextField  = "data1";
                DropDownListDomain.DataValueField = "data1";
                DropDownListDomain.DataBind();

                DropDownListDomain.Items.Insert(0, new ListItem());
                DropDownListDomain.Items[0].Text  = "";
                DropDownListDomain.Items[0].Value = "";
            }
            catch
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), Guid.NewGuid().ToString(), "alert('Bind DropDownList failure');", true);
            }
        }