Ejemplo n.º 1
0
    private void LoadData(string ProductName = "")
    {
        DAProduct daProduct = new DAProduct();

        RadComboBox2.DataSource = daProduct.USP_Product_SearchByName(ProductName);
        RadComboBox2.DataBind();
    }
Ejemplo n.º 2
0
    private void LoadDataProductList(string ProductName = "")
    {
        DAProduct daProduct = new DAProduct();

        sProfuctSearch.DataSource = daProduct.USP_Product_SearchByName(ProductName);
        sProfuctSearch.DataBind();
    }
Ejemplo n.º 3
0
        public int BAaddProductDetails(ProductEntities objProductDetails)
        {
            DAProduct objProductDA = new DAProduct();
            int       returnValue  = objProductDA.DAaddProductDetails(objProductDetails);

            return(returnValue);
        }
Ejemplo n.º 4
0
        public int BADeleteProduct(ProductEntities objProductdetails)
        {
            DAProduct objProductDA = new DAProduct();
            int       returnValue  = objProductDA.DADeleteProduct(objProductdetails);

            return(returnValue);
        }
Ejemplo n.º 5
0
 public JsonResult update(int id, int idCategory, int idBrand, string codeUnit, string name, bool divisible,
                          string divisibleCodeUnit, int divisibleNumberParts, bool perishable, bool traceable,
                          string barcodeType, IList <ENProductProperty> listProperty, IList <ENProductProperty> listPropertyDelete)
 {
     try
     {
         if (PValidateHeader(Request.Headers["Authorization"].ToString()))
         {
             uspGEProductSearch_Result data = new uspGEProductSearch_Result();
             data.idProduct            = id;
             data.idCategory           = idCategory;
             data.idBrand              = idBrand;
             data.codeUnit             = codeUnit;
             data.name                 = name;
             data.divisible            = divisible;
             data.divisibleCodeUnit    = divisibleCodeUnit;
             data.divisibleNumberParts = divisibleNumberParts;
             data.perishable           = perishable;
             data.traceable            = traceable;
             data.barcodeType          = barcodeType;
             DAProduct product = new DAProduct(PUser);
             ENResult  result  = product.update(data, listProperty, listPropertyDelete);
             result.token = PCreateToken();
             return(Json(result));
         }
         else
         {
             return(PSecurityError());
         }
     }
     catch (Exception ex)
     {
         return(PUnexpectedError(ex));
     }
 }
Ejemplo n.º 6
0
 override protected int DeleteByID(int pID)
 {
     try
     {
         DAProduct DAProduct = new DAProduct();
         DAProduct.USP_Product_Delete(pID);
         return(1);
     }
     catch { return(0); }
 }
    private void LoadProductDetail(Int32 ID)
    {
        try
        {
            DataTable dt    = new DataTable();
            DAProduct oData = new DAProduct();

            // get data
            dt.Load(oData.USP_Product_Client_GetByID(ID));

            // Lay
            if (dt.Rows.Count > 0)
            {
                imgLink.ImageUrl    = "/assets/images/products/pro_M_001.png";
                lblProductName.Text = dt.Rows[0]["ProductName"].ToString();
                if (dt.Rows[0]["ImgLink1"].ToString() != "")
                {
                    imgLink.ImageUrl = dt.Rows[0]["ImgLink1"].ToString();
                }


                lblPrice.Text = Convert.ToInt32(dt.Rows[0]["Price"]).ToString("#,##");

                //if(dt.Rows[0]["SalePrice"].ToString() != "0")
                //{
                //    lblSalePrice.Text = Convert.ToInt32(dt.Rows[0]["SalePrice"]).ToString("#,##") + " VNĐ";
                //}
                if (Convert.ToBoolean(dt.Rows[0]["IsHiddenWhenOutoff"]))
                {
                    lblOutofStock.Text    = "Hết hàng";
                    pnlOutofStock.Visible = false;
                }
                else
                {
                    lblOutofStock.Text = "Còn hàng";
                }

                lblDescription.Text = dt.Rows[0]["Description"].ToString();

                lblPID.Text = ID.ToString();

                // Load product relate
                DataTable dtDetail = new DataTable();
                dtDetail.Load(oData.USP_Product_Client_GetRelatebyID(ID));

                rptRelateProduct.DataSource = dtDetail;
                rptRelateProduct.DataBind();
            }
        }
        catch
        {
        }
    }
Ejemplo n.º 8
0
    override protected int ExecUpdate()
    {
        DAProduct DAProduct = CreateObjectFromPage();

        // Update with ID = this.ID
        try
        {
            DAProduct.fID = this.KeyID;

            DAProduct.USP_Product_Update();
            return(UpdateCategory() == true ? 1 : -1);
        }
        catch { return(0); }
    }
Ejemplo n.º 9
0
    //Load dữ liệu
    private void LoadProducts(Int32 iProCate)
    {
        try
        {
            DataTable dt    = new DataTable();
            DAProduct oData = new DAProduct();

            dt.Load(oData.USP_Product_Client_GetAllList(iProCate));

            rptProList.DataSource = dt;
            rptProList.DataBind();
        }
        catch
        {
        }
    }
Ejemplo n.º 10
0
    private void LoadProductCategory()
    {
        try
        {
            DataTable dt    = new DataTable();
            DAProduct oData = new DAProduct();

            dt.Load(oData.USP_ProductCat_Client_GetAll());

            rptProductCate.DataSource = dt;
            rptProductCate.DataBind();
        }
        catch
        {
        }
    }
Ejemplo n.º 11
0
    private void LoadHotProducts()
    {
        try
        {
            DataTable dt    = new DataTable();
            DAProduct oData = new DAProduct();

            dt.Load(oData.USP_Product_Client_GetHot());

            rptHotProduct.DataSource = dt;
            rptHotProduct.DataBind();
        }
        catch
        {
        }
    }
Ejemplo n.º 12
0
    // Hiển thị menu
    private void LoadMenu()
    {
        try
        {
            DAProduct oData = new DAProduct();
            dt.Load(oData.USP_ProductCat_Client_GetAll());

            // Lay menu cha
            //DataTable dtParent = dt.Select("ParentID = 0").CopyToDataTable();
            DataView dv = new DataView(dt, "ParentID = 0", "Pos", DataViewRowState.CurrentRows);
            rptProCat.DataSource = dv;
            rptProCat.DataBind();
        }
        catch
        {
        }
    }
Ejemplo n.º 13
0
        public IActionResult ListadoProducto()
        {
            List <OrderItem> listado;
            var productos = HttpContext.Session.GetString("listaProducto");

            if (productos == null)
            {
                listado = new List <OrderItem>();
            }
            else
            {
                listado = JsonConvert.DeserializeObject <List <OrderItem> >(productos);
            }

            ViewBag.ProductosAgregados = listado;
            ViewBag.ListadoProducto    = DAProduct.Listado();
            return(PartialView());
        }
Ejemplo n.º 14
0
    private void LoadRelateProduct(Int32 ID)
    {
        try
        {
            DataTable dt    = new DataTable();
            DAProduct oData = new DAProduct();

            // get data

            // Load product relate
            DataTable dtDetail = new DataTable();
            dtDetail.Load(oData.USP_Product_Client_GetRelatebyID(ID));

            rptRelateProduct.DataSource = dtDetail;
            rptRelateProduct.DataBind();
        }
        catch
        {
        }
    }
Ejemplo n.º 15
0
    //Load dữ liệu vào ListView
    private void LoadProducts()
    {
        try
        {
            DataTable dt    = new DataTable();
            DAProduct oData = new DAProduct();

            dt.Load(oData.USP_Product_Client_Search(Session["SearchKey"].ToString()));

            lvData.DataSource = dt;
            lvData.DataBind();

            if (dt.Rows.Count < 10)
            {
                dvPaging.Visible = false;
            }
        }
        catch
        {
        }
    }
Ejemplo n.º 16
0
    //Load dữ liệu vào ListView
    private void LoadProducts(Int32 iProCat)
    {
        try
        {
            DataTable dt    = new DataTable();
            DAProduct oData = new DAProduct();

            dt.Load(oData.USP_Product_Client_GetAllList(iProCat));

            lvData.DataSource = dt;
            lvData.DataBind();

            if (dt.Rows.Count < 10)
            {
                dvPaging.Visible = false;
            }
        }
        catch
        {
        }
    }
Ejemplo n.º 17
0
    override protected int ExecInsert()
    {
        try
        {
            DAProduct DAProduct = CreateObjectFromPage();

            if (this.mode == ActParam.New)
            {
                DAProduct.fID = DAProduct.USP_GetKey();
                this.KeyID    = DAProduct.fID; // --> Update new SessionID for continue edit.
            }
            else
            {
                DAProduct.fID = 0;
            }

            DAProduct.USP_Product_Insert();
            return(UpdateCategory() == true ? 1 : -1);
        }
        catch (Exception ex) { return(0); }
    }
Ejemplo n.º 18
0
 public JsonResult searchCategory(int idCategory)
 {
     try
     {
         if (PValidateHeader(Request.Headers["Authorization"].ToString()))
         {
             DAProduct product = new DAProduct(PUser);
             ENResult  result  = product.searchCategory(idCategory);
             result.token = PCreateToken();
             return(Json(result));
         }
         else
         {
             return(PSecurityError());
         }
     }
     catch (Exception ex)
     {
         return(PUnexpectedError(ex));
     }
 }
Ejemplo n.º 19
0
        public async Task <IActionResult> Index()
        {
            ViewBag.ListadoCliente  = DACustomer.Listado();
            ViewBag.ListadoProducto = DAProduct.Listado();

            string tcEuro = String.Empty;

            using (var httpClient = new HttpClient())
            {
                using (var respuesta = await httpClient.GetAsync("https://api.exchangeratesapi.io/latest?base=USD"))
                {
                    string apiRespuesta = await respuesta.Content.ReadAsStringAsync();

                    tcEuro = (string )JObject.Parse(apiRespuesta)["rates"]["EUR"];
                }
            }

            ViewBag.TipoCambioEUR = tcEuro;

            return(View());
        }
Ejemplo n.º 20
0
    // Hiển thị
    private void LoadProduct()
    {
        try
        {
            DataTable dtHot = new DataTable();
            //DataTable dtNew = new DataTable();
            DAProduct oData = new DAProduct();

            dtHot.Load(oData.USP_Product_Client_GetHot());
            //dtNew.Load(oData.USP_Product_Client_GetNew());

            // Load
            rptHot.DataSource = dtHot;
            rptHot.DataBind();

            //rptNew.DataSource = dtNew;
            //rptNew.DataBind();
        }
        catch
        {
        }
    }
Ejemplo n.º 21
0
 public JsonResult delete(int id)
 {
     try
     {
         if (PValidateHeader(Request.Headers["Authorization"].ToString()))
         {
             uspGEProductSearch_Result data = new uspGEProductSearch_Result();
             data.idProduct = id;
             DAProduct product = new DAProduct(PUser);
             ENResult  result  = product.delete(data);
             result.token = PCreateToken();
             return(Json(result));
         }
         else
         {
             return(PSecurityError());
         }
     }
     catch (Exception ex)
     {
         return(PUnexpectedError(ex));
     }
 }
Ejemplo n.º 22
0
        public DataTable BAGetBrand()
        {
            DAProduct objProduct = new DAProduct();

            return(objProduct.DAGetBrand());
        }
Ejemplo n.º 23
0
    public static long InsertProduct(BOProduct objBO)
    {
        DAProduct objDA = new DAProduct();

        return(Convert.ToInt64(objDA.InsertProduct(objBO)));
    }
Ejemplo n.º 24
0
    private void LoadProduct()
    {
        try
        {
            DataTable dtBest = new DataTable();
            DAProduct oData  = new DAProduct();

            // Load hinh
            DataTable dtImg = new DataTable();
            dtImg.Columns.Add("id", typeof(int));
            dtImg.Columns.Add("Img", typeof(string));

            dtBest.Load(oData.USP_Product_Client_GetBestSeller());

            if (dtBest.Rows.Count > 0)
            {
                //lblProductName.Text = dtBest.Rows[0]["ProductName"].ToString();
                //lblBrand.Text = dtBest.Rows[0]["ProducerName"].ToString();
                //hplProductName.Text = dtBest.Rows[0]["ProductName"].ToString();
                //hplProductName.NavigateUrl = dtBest.Rows[0]["RewriteURL"].ToString();
                //lblID.Text = dtBest.Rows[0]["ID"].ToString();

                if (dtBest.Rows[0]["ImgLink1"].ToString() != "")
                {
                    dtImg.Rows.Add(1, dtBest.Rows[0]["ImgLink1"].ToString());
                }

                if (dtBest.Rows[0]["ImgLink2"].ToString() != "")
                {
                    dtImg.Rows.Add(2, dtBest.Rows[0]["ImgLink2"].ToString());
                }

                if (dtBest.Rows[0]["ImgLink3"].ToString() != "")
                {
                    dtImg.Rows.Add(3, dtBest.Rows[0]["ImgLink3"].ToString());
                }

                if (dtBest.Rows[0]["ImgLink4"].ToString() != "")
                {
                    dtImg.Rows.Add(4, dtBest.Rows[0]["ImgLink4"].ToString());
                }

                if (dtBest.Rows[0]["ImgLink5"].ToString() != "")
                {
                    dtImg.Rows.Add(5, dtBest.Rows[0]["ImgLink5"].ToString());
                }

                //if(dtBest.Rows[0]["Price"].ToString()=="0")
                //    lblPrice.Text = "";
                //else
                //    lblPrice.Text = dtBest.Rows[0]["Price"].ToString() + " VNĐ";

                //rptImgShow.DataSource = dtImg;
                //rptImgShow.DataBind();
                //rptImgThumb.DataSource = dtImg;
                //rptImgThumb.DataBind();

                dtBest.Rows.RemoveAt(0);
            }
            DataView dv1 = new DataView(dtBest, "RowID<5", "RowID", DataViewRowState.CurrentRows);
            DataView dv2 = new DataView(dtBest, "RowID>4 and RowID<8", "RowID", DataViewRowState.CurrentRows);

            // Load
            //rptRow1.DataSource = dv1;
            //rptRow1.DataBind();
            //// Load
            //rptRow2.DataSource = dv2;
            //rptRow2.DataBind();
        }
        catch
        {
        }
    }
Ejemplo n.º 25
0
    override protected Boolean LoadData()
    {
        try
        {
            LoadCategory();

            // Load Data For Page.
            DAProduct daProduct = new DAProduct();
            daProduct.USP_Product_GetFullID(this.KeyID);
            //
            fProductName.Value         = daProduct.fProductName.ToString();
            fDescription.Content       = daProduct.fDescription.ToString();
            fProductCode.Value         = daProduct.fProductCode.ToString();
            fUnitName.Value            = daProduct.fUnitName.ToString();
            fProducerID.Value          = daProduct.fProducerID.ToString();
            fPrice.Value               = daProduct.fPrice.ToString();
            fSalePrice.Value           = daProduct.fSalePrice.ToString();
            fSchSalePrice.Value        = daProduct.fSchSalePrice.ToString();
            fScheSaleFrom.SelectedDate = daProduct.fScheSaleFrom;
            fScheSaleTo.SelectedDate   = daProduct.fScheSaleTo;
            fVATID.Value               = daProduct.fVATID.ToString();

            fImgLink1.ImageUrl = "~" + daProduct.fImgLink1;
            fImgLink2.ImageUrl = "~" + daProduct.fImgLink2;
            fImgLink3.ImageUrl = "~" + daProduct.fImgLink3;
            fImgLink4.ImageUrl = "~" + daProduct.fImgLink4;
            fImgLink5.ImageUrl = "~" + daProduct.fImgLink5;

            //fImage1.Src = daProduct.fImgLink1 == String.Empty ? String.Empty : "~" + daProduct.fImgLink1;
            //fImage2.Src = daProduct.fImgLink2 == String.Empty ? String.Empty : "~" + daProduct.fImgLink2;
            //fImage3.Src = daProduct.fImgLink3 == String.Empty ? String.Empty : "~" + daProduct.fImgLink3;
            //fImage4.Src = daProduct.fImgLink4 == String.Empty ? String.Empty : "~" + daProduct.fImgLink4;
            //fImage5.Src = daProduct.fImgLink5 == String.Empty ? String.Empty : "~" + daProduct.fImgLink5;

            fIsManagerQuantity.Checked = daProduct.fIsManagerQuantity;
            fQuantity.Value            = daProduct.fQuantity.ToString();
            fNumSaled.Value            = daProduct.fNumSaled.ToString();
            fRewriteURL.Value          = daProduct.fRewriteURL.ToString();
            fPageTitle.Value           = daProduct.fPageTitle.ToString();
            fMetaTitle.Value           = daProduct.fMetaTitle.ToString();
            fMetaDescription.Value     = daProduct.fMetaDescription.ToString();
            fMetaKeywords.Value        = daProduct.fMetaKeywords.ToString();
            fTags.Value                 = daProduct.fTags.ToString();
            fDesShort.Value             = daProduct.fDesShort.ToString();
            fDesBeforPrice.Value        = daProduct.fDesBeforPrice.ToString();
            fDesAfterPrice.Value        = daProduct.fDesAfterPrice.ToString();
            fIsNewProduct.Checked       = daProduct.fIsNewProduct;
            fIsHot.Checked              = daProduct.fIsHot;
            fIsShow.Checked             = daProduct.fIsShow;
            fIsHiddenWhenOutoff.Checked = daProduct.fIsHiddenWhenOutoff;
            fIsShowYouSaving.Checked    = daProduct.fIsShowYouSaving;
            fBuyButtonText.Value        = daProduct.fBuyButtonText.ToString();
            fShowInProductTyleID.Value  = daProduct.fShowInProductTyleID.ToString();
            fMinOrder.Value             = daProduct.fMinOrder.ToString();
            fMaxForWarrning.Value       = daProduct.fMaxForWarrning.ToString();
            fBonusPoint.Value           = daProduct.fBonusPoint.ToString();
            fIsAllowComment.Checked     = daProduct.fIsAllowComment;
            fPos.Value            = daProduct.fPos.ToString();
            fSysDate.SelectedDate = daProduct.fSysDate;

            //

            // Khi cần enabled cột nào
            //if (this.KeyID > 0)
            //{
            //    if (mode != Act.Clone)
            //        fUserName.Enabled = false;
            //    else
            //        fUserName.Text = "";
            //}
        }
        catch (Exception e)
        {
            ShowErrorMes("Lỗi hệ thống: " + e.ToString());
            return(false);
        }

        return(true);
    }
Ejemplo n.º 26
0
        public DataTable BA_GetBrandFromCategory(ProductEntities BEProduct)
        {
            DAProduct objProduct = new DAProduct();

            return(objProduct.DA_GetBrandFromCategory(BEProduct));
        }
Ejemplo n.º 27
0
    private DAProduct CreateObjectFromPage()
    {
        // check
        DAProduct daProduct = new DAProduct();

        daProduct.USP_Product_GetFullID(this.KeyID);
        //
        daProduct.fProductName   = fProductName.Value.Trim();
        daProduct.fProductNosign = Utils.convertToUnSign2(fProductName.Value);
        daProduct.fDescription   = fDescription.Content.Trim();
        daProduct.fProductCode   = fProductCode.Value.Trim();
        daProduct.fUnitName      = fUnitName.Value.Trim();
        daProduct.fProducerID    = Convert.ToInt32(fProducerID.Value.Trim());
        daProduct.fPrice         = Convert.ToInt32(fPrice.Value.Trim());
        daProduct.fSalePrice     = Convert.ToInt32(fSalePrice.Value.Trim());
        daProduct.fSchSalePrice  = Convert.ToInt32(fSchSalePrice.Value.Trim());
        daProduct.fScheSaleFrom  = Convert.ToDateTime(fScheSaleFrom.SelectedDate);
        daProduct.fScheSaleTo    = Convert.ToDateTime(fScheSaleTo.SelectedDate);
        daProduct.fVATID         = Convert.ToInt32(fVATID.Value.Trim());
        //daProduct.fThumbLink = fThumbLink.ImageUrl;
        //daProduct.fImgLink1 = fImage1.;
        //daProduct.fImgLink2 = fImage2.ImageUrl;
        //daProduct.fImgLink3 = fImage3.ImageUrl;
        //daProduct.fImgLink4 = fImage4.ImageUrl;
        //daProduct.fImgLink5 = fImage5.ImageUrl;


        //uploadImages(ref daProduct);

        // Image 1
        HttpPostedFile fileImg1 = inputFileImg1.PostedFile;

        if (fileImg1 != null && fileImg1.ContentLength > 0)
        {
            //Delete old file
            Utils.DeleteFile(fImgLink1.ImageUrl, Server);
            daProduct.fImgLink1 = Utils.UploadImage(fileImg1, Server, "~/Media/Product");
        }
        else
        {
            daProduct.fImgLink1 = fImgLink1.ImageUrl.Replace("~", "");
        }
        fImgLink1.ImageUrl = "~" + daProduct.fImgLink1;

        // End


        // Image 2
        HttpPostedFile fileImg2 = inputFileImg2.PostedFile;

        if (fileImg2 != null && fileImg2.ContentLength > 0)
        {
            //Delete old file
            Utils.DeleteFile(fImgLink2.ImageUrl, Server);
            daProduct.fImgLink2 = Utils.UploadImage(fileImg2, Server, "~/Media/Product");
        }
        else
        {
            daProduct.fImgLink2 = fImgLink2.ImageUrl.Replace("~", "");
        }
        fImgLink2.ImageUrl = "~" + daProduct.fImgLink2;
        // End


        // Image 3
        HttpPostedFile fileImg3 = inputFileImg3.PostedFile;

        if (fileImg3 != null && fileImg3.ContentLength > 0)
        {
            //Delete old file
            Utils.DeleteFile(fImgLink3.ImageUrl, Server);
            daProduct.fImgLink3 = Utils.UploadImage(fileImg3, Server, "~/Media/Product");
        }
        else
        {
            daProduct.fImgLink3 = fImgLink3.ImageUrl.Replace("~", "");
        }
        fImgLink3.ImageUrl = "~" + daProduct.fImgLink3;
        // End

        //End

        // Image 4
        HttpPostedFile fileImg4 = inputFileImg4.PostedFile;

        if (fileImg4 != null && fileImg4.ContentLength > 0)
        {
            //Delete old file
            Utils.DeleteFile(fImgLink4.ImageUrl, Server);
            daProduct.fImgLink4 = Utils.UploadImage(fileImg4, Server, "~/Media/Product");
        }
        else
        {
            daProduct.fImgLink4 = fImgLink4.ImageUrl.Replace("~", "");
        }
        fImgLink4.ImageUrl = "~" + daProduct.fImgLink4;
        // End


        // Image 5
        // Image 3
        HttpPostedFile fileImg5 = inputFileImg5.PostedFile;

        if (fileImg5 != null && fileImg5.ContentLength > 0)
        {
            //Delete old file
            Utils.DeleteFile(fImgLink5.ImageUrl, Server);
            daProduct.fImgLink5 = Utils.UploadImage(fileImg5, Server, "~/Media/Product");
        }
        else
        {
            daProduct.fImgLink5 = fImgLink5.ImageUrl.Replace("~", "");
        }
        fImgLink5.ImageUrl = "~" + daProduct.fImgLink5;
        // End
        // End


        daProduct.fIsManagerQuantity = fIsManagerQuantity.Checked;
        daProduct.fQuantity          = Convert.ToInt32(fQuantity.Value.Trim());
        daProduct.fNumSaled          = Convert.ToInt32(fNumSaled.Value.Trim());
        daProduct.fRewriteURL        = fRewriteURL.Value.Trim();
        daProduct.fPageTitle         = fPageTitle.Value.Trim();
        daProduct.fMetaTitle         = fMetaTitle.Value.Trim();
        daProduct.fMetaDescription   = fMetaDescription.Value.Trim();
        daProduct.fMetaKeywords      = fMetaKeywords.Value.Trim();
        daProduct.fTags                = fTags.Value.Trim();
        daProduct.fDesShort            = fDesShort.Value.Trim();
        daProduct.fDesBeforPrice       = fDesBeforPrice.Value.Trim();
        daProduct.fDesAfterPrice       = fDesAfterPrice.Value.Trim();
        daProduct.fIsNewProduct        = fIsNewProduct.Checked;
        daProduct.fIsHot               = fIsHot.Checked;
        daProduct.fIsShow              = fIsShow.Checked;
        daProduct.fIsHiddenWhenOutoff  = fIsHiddenWhenOutoff.Checked;
        daProduct.fIsShowYouSaving     = fIsShowYouSaving.Checked;
        daProduct.fBuyButtonText       = fBuyButtonText.Value.Trim();
        daProduct.fShowInProductTyleID = Convert.ToInt32(fShowInProductTyleID.Value.Trim());
        daProduct.fMinOrder            = Convert.ToInt32(fMinOrder.Value.Trim());
        daProduct.fMaxForWarrning      = Convert.ToInt32(fMaxForWarrning.Value.Trim());
        daProduct.fBonusPoint          = Convert.ToInt32(fBonusPoint.Value.Trim());
        daProduct.fIsAllowComment      = fIsAllowComment.Checked;
        daProduct.fPos      = Convert.ToInt32(fPos.Value.Trim());
        daProduct.fOperator = MySession.UserName;

        //

        return(daProduct);
    }
 public IActionResult Index()
 {
     ViewBag.ListadoCliente  = DACustomer.Listado();
     ViewBag.ListadoProducto = DAProduct.Listado();
     return(View());
 }
Ejemplo n.º 29
0
        public int BA_ValidateProduct(ProductEntities objProductdetails)
        {
            DAProduct objProductDA = new DAProduct();

            return(objProductDA.DA_ValidateProduct(objProductdetails));
        }
Ejemplo n.º 30
0
    // Hiển thị menu
    private void LoadProductDetail(Int32 ID)
    {
        try
        {
            DataTable dt    = new DataTable();
            DAProduct oData = new DAProduct();

            // get data
            dt.Load(oData.USP_Product_Client_GetByID(ID));

            // Lay
            if (dt.Rows.Count > 0)
            {
                lblProductName.Text = dt.Rows[0]["ProductName"].ToString();
                lblBrand.Text       = dt.Rows[0]["ProducerName"].ToString();
                lblSKU.Text         = dt.Rows[0]["ProductCode"].ToString();
                txtProductID.Text   = dt.Rows[0]["ID"].ToString();

                //if (dt.Rows[0]["Price"].ToString() == "0")
                //    lblPrice.Text = "Liên hệ";
                //else
                //    lblPrice.Text = dt.Rows[0]["Price"].ToString() + " VNĐ";
                // Load hinh
                DataTable dtImg = new DataTable();
                dtImg.Columns.Add("id", typeof(int));
                dtImg.Columns.Add("Img", typeof(string));

                if (dt.Rows[0]["ImgLink1"].ToString() != "")
                {
                    dtImg.Rows.Add(1, dt.Rows[0]["ImgLink1"].ToString());
                }

                if (dt.Rows[0]["ImgLink2"].ToString() != "")
                {
                    dtImg.Rows.Add(2, dt.Rows[0]["ImgLink2"].ToString());
                }

                if (dt.Rows[0]["ImgLink3"].ToString() != "")
                {
                    dtImg.Rows.Add(3, dt.Rows[0]["ImgLink3"].ToString());
                }

                if (dt.Rows[0]["ImgLink4"].ToString() != "")
                {
                    dtImg.Rows.Add(4, dt.Rows[0]["ImgLink4"].ToString());
                }

                if (dt.Rows[0]["ImgLink5"].ToString() != "")
                {
                    dtImg.Rows.Add(5, dt.Rows[0]["ImgLink5"].ToString());
                }

                lblDescription.Text = dt.Rows[0]["Description"].ToString();
                //sImgSlider = sSlider;
                //sImgThumb = sThumb;
                rptImgShow.DataSource = dtImg;
                rptImgShow.DataBind();
                rptImgThumb.DataSource = dtImg;
                rptImgThumb.DataBind();

                // Load product relate
                DataTable dtDetail = new DataTable();
                dtDetail.Load(oData.USP_Product_Client_GetRelatebyID(ID));

                rptRelateProduct.DataSource = dtDetail;
                rptRelateProduct.DataBind();
            }
        }
        catch
        {
        }
    }