Exemplo n.º 1
0
    private void GetSellOff()
    {
        string str = "";
        try
        {

            DataSet ds = new ProductBestSellSystem().ProductSelloffAll();
            DataTable table = ds.Tables[0];
            int numPro = table.Rows.Count;
            if (numPro > 0)
            {
                Boolean iseven = true;
                str = "<table cellpadding='0' cellspacing='0' border='0' width='100%'>";
                if (desselloff.Length > 0)
                {
                    str += "<tr height='35'><td colspan='3' align='center' class='text_title'>" + desselloff + "</td></tr>";
                    str += "<tr><td colspan='3' class='line1'></td></tr>";
                }
                string id = "";
                string name = "";
                string url = "";
                string price = "";
                string oldprice = "";
                string warranty = "";
                for (int i = 0; i < numPro; i++)
                {
                    id = table.Rows[i]["idproduct"].ToString();
                    name = table.Rows[i]["Name"].ToString() + " " + table.Rows[i]["state"].ToString();
                    url = table.Rows[i]["UrlImage"].ToString();
                    if (url.Length > 0)
                    {
                        url = "image/img_pro/" + url;
                    }
                    else
                    {
                        url = "image/common/notimgpro.png";
                    }
                    price = table.Rows[i]["SellingPrice"].ToString();
                    oldprice = table.Rows[i]["price"].ToString();
                    warranty = table.Rows[i]["WarrantyMonth"].ToString();
                    if (iseven)
                    {
                        str += "<tr><td width='278'>";
                        str += "<table cellpadding='0' cellspacing='0' border='0' width='100%'>";
                        str += "<tr><td rowspan='2' width='88' align='center'>";
                        if (table.Rows[i]["promotion"].ToString().Length > 0)
                        {
                            str += "<img src='image/common/khuyenmai.gif' style='cursor:pointer;' onmouseover='showDivMessage(2," + id + ",-1,event);' onmouseout='OnMOut(event)'/><br />";
                        }
                        str += "<a href='?menu=dp&id=" + id + "'><img class='img2' onmouseover='showDivMessage(1," + id + "," + (i + 50) + ",event);' onmouseout='OnMOut(event)' src='" + url + "'/></a></td>";
                        str += "<td class='text_title' valign='top'><a href='?menu=dp&id=" + id + "' onmouseover='showDivMessage(1," + id + "," + (i + 50) + ",event);' onmouseout='OnMOut(event)'>" + name + "</a></td></tr>";
                        str += "<tr><td height='48'>" + tprice + ": ";
                        if (!oldprice.Equals("0"))
                        {
                            str += "<span style='text-decoration:line-through;'>" + oldprice + "</span> &raquo; ";
                        }
                        str += "<span class='txt4'>" + price + " " + unitPrice + "</span><br />" + twarranty + ": <span class='txt4'>" + warranty + " " + tmonth + "</span>";
                        str += "</td></tr>";
                        //str += "<tr><td colspan='2' height='32' align='center'><div class='button3' onclick='AddCart(" + id + ",1);'>" + torder + "</div></td></tr>";
                        str += "</table></td>";
                        str += "<td class='line2'></td>";
                        iseven = false;
                        if (i + 1 == numPro)
                        {
                            str += "<td width='278'>&nbsp;</td></tr>";
                        }
                    }
                    else
                    {
                        str += "<td width='278'>";
                        str += "<table cellpadding='0' cellspacing='0' border='0' width='100%'>";
                        str += "<tr><td rowspan='2' width='88' align='center'>";
                        if (table.Rows[i]["promotion"].ToString().Length > 0)
                        {
                            str += "<img src='image/common/khuyenmai.gif' style='cursor:pointer;' onmouseover='showDivMessage(2," + id + "," + (i + 50) + ",event);' onmouseout='OnMOut(event)'/><br />";
                        }
                        str += "<a href='?menu=dp&id=" + id + "'><img class='img2' onmouseover='showDivMessage(1," + id + "," + (i + 50) + ",event);' onmouseout='OnMOut(event)' src='" + url + "'/></a></td>";
                        str += "<td class='text_title' valign='top'><a href='?menu=dp&id=" + id + "' onmouseover='showDivMessage(1," + id + "," + (i+ 50) + ",event);' onmouseout='OnMOut(event)'>" + name + "</a></td></tr>";
                        str += "<tr><td height='48'>" + tprice + ": ";
                        if (!oldprice.Equals("0"))
                        {
                            str += "<span style='text-decoration:line-through;'>" + oldprice + "</span> &raquo; ";
                        }
                        str += "<span class='txt4'>" + price + " " + unitPrice + "</span><br />" + twarranty + ": <span class='txt4'>" + warranty + " " + tmonth + "</span>";
                        str += "</td></tr>";
                        //str += "<tr><td colspan='2' height='32' align='center'><div class='button3' onclick='AddCart(" + id + ",1);'>" + torder + "</div></td></tr>";
                        str += "</table></td></tr>";
                        if (i + 1 < numPro)
                        {
                            str += "<tr><td class='line1'></td><td></td><td class='line1'></td></tr>";
                        }
                        iseven = true;
                    }
                }
                str += "</table>";
            }
        }
        catch (Exception ex)
        {
            Console.Write(ex.ToString());
            str = "";
        }
        if (str.Length == 0)
        {
            return;
        }
        strSellOff = "<table width='100%' cellpadding='0' cellspacing='0' border='0'>";
        strSellOff += "<tr><td class='bg_b1'></td>";
        strSellOff += "<td class='bg_b2'><div class='text_bl'>" + tselloff + "</div></td>";
        strSellOff += "<td class='bg_b3'></td></tr>";
        strSellOff += "<tr><td class='bg_b4'></td>";
        strSellOff += "<td valign='top'><div class='text_5'>" + str + "</div></td>";
        strSellOff += "<td class='bg_b5'></td>";
        strSellOff += "</tr><tr><td class='bg_b7' colspan='3'></td></tr><tr><td height='7'></td></tr></table>";
    }
Exemplo n.º 2
0
 public string GetProBestSell(string tprice,string currency)
 {
     string strBestSell = "";
     try
     {
         DataTable table = new DataTable();
         ProductMainPage_data ds = new ProductBestSellSystem().ProductBestSellAll();
         table = ds.Tables[ProductMainPage_data._table];
         int num = table.Rows.Count;
         string id = "";
         string name = "";
         string price = "";
         string img = "";
         float rate = (float)Application["ratepromain"];
         float price1 = 1;
         string price2 = "";
         for (int i = 0; i < num; i++)
         {
             id = table.Rows[i][ProductMainPage_data._id].ToString();
             name = table.Rows[i][ProductMainPage_data._name].ToString() + " " + table.Rows[i][ProductMainPage_data._state].ToString(); ;
             price2 = table.Rows[i][ProductMainPage_data._price].ToString();
             price1 = float.Parse(table.Rows[i][ProductMainPage_data._price].ToString());
             price1 = price1 * rate;
             price = price1.ToString("N").Split('.')[0];
             string namepro = table.Rows[i][ProductMainPage_data._name].ToString();
             namepro = namepro.Replace("/", "");
             namepro = namepro.Replace("#", "");
             namepro = namepro.Replace(":", "");
             namepro = namepro.Replace("\"", "");
             if (price.Equals("0"))
             {
                 price = "";
                 price2 = "";
             }
             img = table.Rows[i][ProductMainPage_data._urlImage].ToString();
             if (img.Length > 0)
             {
                 img = "image/img_pro/" + img;
             }
             else
             {
                 img = "image/common/notimgpro.png";
             }
             strBestSell += "<tr><td class='div1'><a href='" + namepro + "-dp-" + id + ".html'>" + name + "</a><br />";
             strBestSell += "<a href='" + namepro + "-dp-" + id + ".html'><img src='" + img + "' class='img2' /></a>";
             if (currency.Equals("$"))
             {
                 strBestSell += "<span class='price1'>" + price2 + "<br />(" + price + " VND)</span></td></tr>";
             }
             else if (currency.Equals("$$"))
             {
                 strBestSell += "<span class='price1'>" + price2 + " USD<br />(" + price + " VND)</span></td></tr>";
             }
             else
             {
                 strBestSell += "<span class='price1'>" + price + " " + currency + "</span></td></tr>";
             }
             strBestSell += "<tr><td class='tvat' align='center'>" + strMVAT + "</td></tr>";
             if (i + 1 < num)
             {
                 strBestSell += "<tr><td class='bg_line2'></td></tr>";
             }
         }
     }
     catch (Exception ex)
     {
         Console.Write(ex.ToString());
     }
     return strBestSell;
 }
Exemplo n.º 3
0
 public string GetJustHave(string tprice, string currencymobile)
 {
     string strBestSell = "";
     try
     {
         DataTable table = new DataTable();
         ProductMainPage_data ds = new ProductBestSellSystem().ProductJustHaveTop();
         table = ds.Tables[ProductMainPage_data._table];
         int num = table.Rows.Count;
         string id = "";
         string name = "";
         string price = "";
         string img = "";
         float rate = (float)Application["ratepromain"];
         float price1 = 1;
         for (int i = 0; i < num; i++)
         {
             id = table.Rows[i][ProductMainPage_data._id].ToString();
             name = table.Rows[i][ProductMainPage_data._name].ToString() + " " + table.Rows[i][ProductMainPage_data._state].ToString();
             //price = table.Rows[i][ProductMainPage_data._price].ToString();
             price1 = float.Parse(table.Rows[i][ProductMainPage_data._price].ToString());
             price1 = price1 * rate;
             price = price1.ToString("N").Split('.')[0];
             if (price.Equals("0"))
             {
                 price = "-";
             }
             img = table.Rows[i][ProductMainPage_data._urlImage].ToString();
             if (img.Length > 0)
             {
                 img = "image/img_pro/" + img;
             }
             else
             {
                 img = "image/common/notimgpro.png";
             }
             strBestSell += "<tr><td class='div1'><a href='?menu=dp&id=" + id + "'>" + name + "</a><br />";
             strBestSell += "<a href='?menu=dp&id=" + id + "'><img src='" + img + "' class='img2' /></a>";
             strBestSell += "<span class='price1'>" + price + " " + currencymobile + "</span></td></tr>";
             if (i + 1 < num)
             {
                 strBestSell += "<tr><td class='bg_line2'></td></tr>";
             }
         }
     }
     catch (Exception ex)
     {
         Console.Write(ex.ToString());
     }
     return strBestSell;
 }
 public void GetNewHaveAll()
 {
     try
     {
         ProductMainPage_data ds = new ProductBestSellSystem().ProductJustHaveAll();
         DataTable table = ds.Tables[ProductMainPage_data._table];
         int numPro = table.Rows.Count;
         if (numPro > 0)
         {
             Boolean iseven = true;
             strProMain = "<table cellpadding='0' cellspacing='0' border='0' width='100%'>";
             string id = "";
             string name = "";
             string url = "";
             string price = "";
             string warranty = "";
             float rate = (float)Application["ratepromain"];
             float price1 = 1;
             string price2 = "";
             for (int i = 0; i < numPro; i++)
             {
                 id = table.Rows[i][ProductMainPage_data._id].ToString();
                 name = table.Rows[i][ProductMainPage_data._name].ToString() + " " + table.Rows[i][ProductMainPage_data._state].ToString();
                 url = table.Rows[i][ProductMainPage_data._urlImage].ToString();
                 string namepro = table.Rows[i][ProductMainPage_data._name].ToString();
                 namepro = namepro.Replace("/", "");
                 namepro = namepro.Replace("#", "");
                 if (url.Length > 0)
                 {
                     url = "image/img_pro/" + url;
                 }
                 else
                 {
                     url = "image/common/notimgpro.png";
                 }
                 price2 = table.Rows[i][ProductMainPage_data._price].ToString();
                 price1 = float.Parse(table.Rows[i][ProductMainPage_data._price].ToString());
                 price1 = price1 * rate;
                 price = price1.ToString("N").Split('.')[0];
                 warranty = table.Rows[i][ProductMainPage_data._WarrantyMonth].ToString();
                 if (iseven)
                 {
                     strProMain += "<tr><td width='278'>";
                     strProMain += "<table cellpadding='0' cellspacing='0' border='0' width='100%'>";
                     strProMain += "<tr><td rowspan='2' width='88' align='center' valign='top'>";
                     if (table.Rows[i][ProductMainPage_data._ispromotion].ToString().Length > 0)
                     {
                         strProMain += "<img src='image/common/khuyenmai.gif' style='cursor:pointer;' onmouseover='showDivMessage(2," + id + "," + i + ",event);' onmouseout='OnMOut(event)'/><br />";
                     }
                     strProMain += "<a href='" + namepro + "-dp-" + id + ".html'><img class='img1' onmouseover='showDivMessage(1," + id + "," + i + ",event);' onmouseout='OnMOut(event)' src='" + url + "'/></a></td>";
                     strProMain += "<td class='text_title' valign='top'><a href='" + namepro + "-dp-" + id + ".html' onmouseover='showDivMessage(1," + id + "," + i + ",event);' onmouseout='OnMOut(event)'>" + name + "</a></td></tr>";
                     strProMain += "<tr><td valign='middle' width='190' height='48'>" + tprice + ": <span class='price'>";
                     if (price.Equals("0"))
                     {
                         strProMain += tupdate + "</span><br />";
                     }
                     else
                     {
                         if (unitPrice.Equals("$"))
                         {
                             strProMain += price + " VND</span><br />";
                             strProMain += "<font color='#FFFFFF'>" + tprice + ": </font><span class='price'>" + price2 + "</span><br />";
                         }
                         else if (unitPrice.Equals("$$"))
                         {
                             strProMain += price + " VND</span><br />";
                             strProMain += "<font color='#FFFFFF'>" + tprice + ": </font><span class='price'>" + price2 + " USD</span><br />";
                         }
                         else
                         {
                             strProMain += price + " " + unitPrice + "</span><br />";
                         }
                     }
                     strProMain += "<span class='tvat'>" + strMVAT + "</span><br />";
                     strProMain += twarranty + ": <span class='price'>" + warranty + " " + tmonth + "</span>";
                     strProMain += "</td></tr>";
                     //strProMain += "<tr><td colspan='2' height='32' align='center'><div class='button3' onclick='AddCart(" + id + ",1);'>" + torder + "</div></td></tr>";
                     strProMain += "</table></td>";
                     strProMain += "<td class='bg_line4'></td>";
                     iseven = false;
                     if (i + 1 == numPro)
                     {
                         strProMain += "<td></td></tr>";
                     }
                 }
                 else
                 {
                     strProMain += "<td width='278'>";
                     strProMain += "<table cellpadding='0' cellspacing='0' border='0' width='100%'>";
                     strProMain += "<tr><td rowspan='2' width='88' align='center' valign='top'>";
                     if (table.Rows[i][ProductMainPage_data._ispromotion].ToString().Length > 0)
                     {
                         strProMain += "<img src='image/common/khuyenmai.gif' style='cursor:pointer;' onmouseover='showDivMessage(2," + id + "," + i + ",event);' onmouseout='OnMOut(event)'/><br />";
                     }
                     strProMain += "<a href='" + namepro + "-dp-" + id + ".html'><img class='img1' onmouseover='showDivMessage(1," + id + "," + i + ",event);' onmouseout='OnMOut(event)' src='" + url + "'/></a></td>";
                     strProMain += "<td class='text_title' valign='top'><a href='" + namepro + "-dp-" + id + ".html' onmouseover='showDivMessage(1," + id + "," + i + ",event);' onmouseout='OnMOut(event)'>" + name + "</a></td></tr>";
                     strProMain += "<tr><td valign='middle' width='190' height='48'>" + tprice + ": <span class='price'>";
                     if (price.Equals("0"))
                     {
                         strProMain += tupdate + "</span><br />";
                     }
                     else
                     {
                         if (unitPrice.Equals("$"))
                         {
                             strProMain += price + " VND</span><br />";
                             strProMain += "<font color='#FFFFFF'>" + tprice + ": </font><span class='price'>" + price2 + "</span><br />";
                         }
                         else if (unitPrice.Equals("$$"))
                         {
                             strProMain += price + " VND</span><br />";
                             strProMain += "<font color='#FFFFFF'>" + tprice + ": </font><span class='price'>" + price2 + " USD</span><br />";
                         }
                         else
                         {
                             strProMain += price + " " + unitPrice + "</span><br />";
                         }
                     }
                     strProMain += "<span class='tvat'>" + strMVAT + "</span><br />";
                     strProMain += twarranty + ": <span class='price'>" + warranty + " " + tmonth + "</span>";
                     strProMain += "</td></tr>";
                     //strProMain += "<tr><td colspan='2' height='32' align='center'><div class='button3' onclick='AddCart(" + id + ",1);'>" + torder + "</div></td></tr>";
                     strProMain += "</table></td></tr>";
                     if (i + 1 < numPro)
                     {
                         strProMain += "<tr><td class='bg_line3'></td><td></td><td class='bg_line3'></td></tr>";
                     }
                     iseven = true;
                 }
             }
             strProMain += "</table>";
         }
     }
     catch (Exception ex)
     {
         Console.Write(ex.ToString());
         strProMain = "";
     }
 }
Exemplo n.º 5
0
    private void GetJustHave()
    {
        string strProMain = "";
        try
        {

            ProductMainPage_data ds = new ProductBestSellSystem().ProductJustHaveAll();
            DataTable table = ds.Tables[ProductMainPage_data._table];
            int numPro = table.Rows.Count;
            if (numPro > 0)
            {
                Boolean iseven = true;
                strProMain = "<table cellpadding='0' cellspacing='0' border='0' width='100%'>";
                string id = "";
                string name = "";
                string url = "";
                string price = "";
                string warranty = "";
                for (int i = 0; i < numPro; i++)
                {
                    id = table.Rows[i][ProductMainPage_data._id].ToString();
                    name = table.Rows[i][ProductMainPage_data._name].ToString() + " " + table.Rows[i][ProductMainPage_data._state].ToString();
                    url = table.Rows[i][ProductMainPage_data._urlImage].ToString();
                    string namepro = table.Rows[i][ProductMainPage_data._name].ToString();
                    namepro = namepro.Replace("/", "");
                    namepro = namepro.Replace("#", "");
                    namepro = namepro.Replace(":", "");
                    namepro = namepro.Replace("\"", "");
                    if (url.Length > 0)
                    {
                        url = "image/img_pro/" + url;
                    }
                    else
                    {
                        url = "image/common/notimgpro.png";
                    }
                    price = table.Rows[i][ProductMainPage_data._price].ToString();
                    warranty = table.Rows[i][ProductMainPage_data._WarrantyMonth].ToString();
                    if (iseven)
                    {
                        strProMain += "<tr><td width='278'>";
                        strProMain += "<table cellpadding='0' cellspacing='0' border='0' width='100%'>";
                        strProMain += "<tr><td rowspan='2' width='88' align='center'>";
                        if (table.Rows[i][ProductMainPage_data._ispromotion].ToString().Length > 0)
                        {
                            strProMain += "<img src='image/common/khuyenmai.gif' style='cursor:pointer;' onmouseover='showDivMessage(2," + id + ",-1,event);' onmouseout='OnMOut(event)'/><br />";
                        }
                        strProMain += "<a href='" + namepro + "-dp-" + id + ".html'><img class='img1' onmouseover='showDivMessage(1," + id + ",-1,event);' onmouseout='OnMOut(event)' src='" + url + "'/></a></td>";
                        strProMain += "<td class='text_title' valign='top'><a href='" + namepro + "-dp-" + id + ".html' onmouseover='showDivMessage(1," + id + "," + i + ",event);' onmouseout='OnMOut(event)'>" + name + "</a></td></tr>";
                        strProMain += "<tr><td height='48'>" + tprice + ": <span class='price'>" + price + " " + unitPrice + "</span><br />" + twarranty + ": <span class='price'>" + warranty + " " + tmonth + "</span>";
                        strProMain += "</td></tr>";
                        strProMain += "<tr><td colspan='2' height='32' align='center'><div class='button3' onclick='AddCart(" + id + ",1);'>" + torder + "</div></td></tr>";
                        strProMain += "</table></td>";
                        strProMain += "<td class='bg_line4'></td>";
                        iseven = false;
                        if (i + 1 == numPro)
                        {
                            strProMain += "<td></td></tr>";
                        }
                    }
                    else
                    {
                        strProMain += "<td width='278'>";
                        strProMain += "<table cellpadding='0' cellspacing='0' border='0' width='100%'>";
                        strProMain += "<tr><td rowspan='2' width='88' align='center'>";
                        if (table.Rows[i][ProductMainPage_data._ispromotion].ToString().Length > 0)
                        {
                            strProMain += "<img src='image/common/khuyenmai.gif' style='cursor:pointer;' onmouseover='showDivMessage(2," + id + ",-1,event);' onmouseout='OnMOut(event)'/><br />";
                        }
                        strProMain += "<a href='" + namepro + "-dp-" + id + ".html'><img class='img1' onmouseover='showDivMessage(1," + id + ",-1,event);' onmouseout='OnMOut(event)' src='" + url + "'/></a></td>";
                        strProMain += "<td class='text_title' valign='top'><a href='" + namepro + "-dp-" + id + ".html' onmouseover='showDivMessage(1," + id + "," + i + ",event);' onmouseout='OnMOut(event)'>" + name + "</a></td></tr>";
                        strProMain += "<tr><td width='190' height='48'>" + tprice + ": <span class='price'>" + price + " " + unitPrice + "</span><br />" + twarranty + ": <span class='price'>" + warranty + " " + tmonth + "</span>";
                        strProMain += "</td></tr>";
                        strProMain += "<tr><td colspan='2' height='32' align='center'><div class='button3' onclick='AddCart(" + id + ",1);'>" + torder + "</div></td></tr>";
                        strProMain += "</table></td></tr>";
                        if (i + 1 < numPro)
                        {
                            strProMain += "<tr><td class='bg_line3'></td><td></td><td class='bg_line3'></td></tr>";
                        }
                        iseven = true;
                    }
                }
                strProMain += "</table>";
            }
        }
        catch (Exception ex)
        {
            Console.Write(ex.ToString());
            strProMain = "";
        }
        if (strProMain.Length == 0)
        {
            return;
        }
        strjusthave = "<table width='100%' cellpadding='0' cellspacing='0' border='0'>";
        strjusthave += "<tr><td class='bg_b1'></td>";
        strjusthave += "<td class='bg_b2'><div class='text_bl'>" + thavejust + "</div></td>";
        strjusthave += "<td class='bg_b3'></td></tr>";
        strjusthave += "<tr><td class='bg_b4'></td>";
        strjusthave += "<td valign='top'><div class='text_5'>"+ strProMain +"</div></td>";
        strjusthave += "<td class='bg_b5'></td>";
        strjusthave += "</tr><tr><td class='bg_b7' colspan='3'></td></tr><tr><td height='7'></td></tr></table>";
    }
Exemplo n.º 6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            string menu=Request.QueryString["menu"].ToString();
            string strmobile="";
            switch (menu)
            {
                case ("imgpro"):
                    {
                        try
                        {
                            string id = Request.QueryString["id"].ToString();
                            string name = Request.QueryString["name"].ToString();
                            string namepro = Request.QueryString["namepro"].ToString();
                            string subName = "";
                            int leng = namepro.Length;
                            for (int i = 0; i < leng; i++)
                            {
                                if(namepro[i].Equals('('))
                                    break;
                                if(!namepro[i].Equals(','))
                                {
                                    subName += namepro[i];
                                }
                            }
                            subName = subName.Trim();
                            Session["SSIdProUpload"] = id + "," + name + "," + subName;
                        }
                        catch
                        {

                        }
                        Response.Write("ok");
                        break;
                    }
                case ("bestsell"):
                    {
                        string strreturn = "";
                        try
                        {
                            string type=Request.QueryString["type"].ToString();
                            string id = Request.QueryString["id"].ToString();
                            ProductBestSellSystem products = new ProductBestSellSystem();
                            Boolean test = products.ProductBestUpdate(int.Parse(id), int.Parse(type));
                            if (!test)
                            {
                                strreturn = "err";
                            }
                            else
                            {
                                //ProductMainPage_data ds = new ProductBestSellSystem().ProductBestSellAll();
                                //Application["appProductBestsell"] = ds.Tables[ProductMainPage_data._table];
                            }
                        }
                        catch
                        {
                            strreturn = "err";
                        }
                        Response.Write(strreturn);
                    }
                    break;
                case ("justhave"):
                    {
                        string strreturn = "";
                        try
                        {
                            string type = Request.QueryString["type"].ToString();
                            string id = Request.QueryString["id"].ToString();
                            ProductBestSellSystem products = new ProductBestSellSystem();
                            Boolean test = products.ProductJustHaveUpdate(int.Parse(id), int.Parse(type));
                            if (!test)
                            {
                                strreturn = "err";
                            }
                            else
                            {
                                //ProductMainPage_data ds = new ProductBestSellSystem().ProductBestSellAll();
                                //Application["appProductBestsell"] = ds.Tables[ProductMainPage_data._table];
                            }
                        }
                        catch
                        {
                            strreturn = "err";
                        }
                        Response.Write(strreturn);
                    }
                    break;
                    //prepare out:
                case ("prepareout"):
                    {
                        string PrepareStr = "";
                        try
                        {
                            string type = Request.QueryString["type"].ToString();
                            string id = Request.QueryString["id"].ToString();
                            ProductBestSellSystem products = new ProductBestSellSystem();
                            Boolean test = products.ProductPrepareoutUpdate(int.Parse(id), int.Parse(type));
                            if (!test)
                            {
                                PrepareStr = "err";
                            }
                            else
                            {
                                //ProductMainPage_data ds = new ProductBestSellSystem().ProductBestSellAll();
                                //Application["appProductBestsell"] = ds.Tables[ProductMainPage_data._table];
                            }
                        }
                        catch
                        {
                            PrepareStr = "err";
                        }
                        Response.Write(PrepareStr);
                    }
                    break;
                //proselloff:
                case ("proselloff"):
                    {
                        string strselloff = "";
                        try
                        {
                            string type = Request.QueryString["type"].ToString();
                            string id = Request.QueryString["id"].ToString();
                            float price = float.Parse(Request.QueryString["price"].ToString());
                            ProductBestSellSystem products = new ProductBestSellSystem();
                            Boolean test = products.ProductSelloffUpdate(int.Parse(id), int.Parse(type),price);
                            if (!test)
                            {
                                strselloff = "err";
                            }
                            else
                            {
                                //ProductMainPage_data ds = new ProductBestSellSystem().ProductBestSellAll();
                                //Application["appProductBestsell"] = ds.Tables[ProductMainPage_data._table];
                            }
                        }
                        catch
                        {
                            strselloff = "err";
                        }
                        Response.Write(strselloff);
                    }
                    break;
                case ("mainpage"):
                    string strmain = "";
                    try
                    {
                        string type = Request.QueryString["type"].ToString();
                        string id = Request.QueryString["id"].ToString();
                        string sort = Request.QueryString["sort"].ToString();
                        ProductMainPageSystem products = new ProductMainPageSystem();
                        Boolean test = products.ProductMainpageUpdate(int.Parse(id), int.Parse(type),int.Parse(sort));
                        if (!test)
                        {
                            strmain = "err";
                        }
                    }
                    catch
                    {
                        strmain = "err";
                    }
                    Response.Write(strmain);
                    break;
                case ("original"):
                string stroriginal = "";
                try
                {
                    string type = Request.QueryString["type"].ToString();
                    string id = Request.QueryString["id"].ToString();
                    string sort = Request.QueryString["sort"].ToString();
                    ProductMainPageSystem products = new ProductMainPageSystem();
                    Boolean test = products.ProductOriginalUpdate(int.Parse(id), int.Parse(type), int.Parse(sort));
                    if (!test)
                    {
                        stroriginal = "err";
                    }
                }
                catch
                {
                    strmain = "err";
                }
                Response.Write(stroriginal);
                break;
                case ("dgroup"):
                    string strdelete = "";
                    try
                    {
                        string id=Request.QueryString["id"].ToString();
                        ArticleManagerSystem Articles = new ArticleManagerSystem();

                        if (Articles.AdminGroupDeleteId(id))
                        {
                            strdelete = "1";
                        }
                        else
                        {
                            strdelete = "0";
                        }
                    }catch
                    {
                        strdelete = "0";
                    }
                    Response.Write(strdelete);
                    break;
                case ("dgcontact"):
                    string strdcontact = "";
                    try
                    {
                        string id = Request.QueryString["id"].ToString();
                        ContacstSystem Contacts = new ContacstSystem();

                        if (Contacts.GroupContactDeleteId(id))
                        {
                            strdcontact = "1";
                        }
                        else
                        {
                            strdcontact = "0";
                        }
                    }
                    catch
                    {
                        strdcontact = "0";
                    }
                    Response.Write(strdcontact);
                    break;
                case ("dglocation"):
                    string strdlocation = "";
                    try
                    {
                        string id = Request.QueryString["id"].ToString();
                        ContacstSystem Contacts = new ContacstSystem();

                        if (Contacts.LocationContactDelete(id))
                        {
                            strdlocation = "1";
                        }
                        else
                        {
                            strdlocation = "0";
                        }
                    }
                    catch
                    {
                        strdlocation = "0";
                    }
                    Response.Write(strdlocation);
                    break;
                case ("dhelp"):
                    string strdhelp = "0";
                    try
                    {
                        string id = Request.QueryString["id"].ToString();
                        HelpsSystem helps = new HelpsSystem();

                        if (helps.HelpsDelete(id))
                        {
                            strdhelp = "1";
                        }
                    }
                    catch
                    {
                        strdhelp = "0";
                    }
                    Response.Write(strdhelp);
                    break;
                case ("donline"):
                    string stronline = "0";
                    try
                    {
                        string id = Request.QueryString["id"].ToString();
                        SupportOnlineSystem Support = new SupportOnlineSystem();
                        if (Support.OnlineDelete(id))
                        {
                            stronline = "1";
                            Application["appOnline"] = null;
                        }
                    }
                    catch
                    {
                        stronline = "0";
                    }
                    Response.Write(stronline);
                    break;
                case ("dadvertise"):
                    string strdadvertise = "0";
                    try
                    {
                        string id = Request.QueryString["id"].ToString();
                        AdvertiseSystem advertise = new AdvertiseSystem();
                        DataSet ds = advertise.AdvertiseSelectId(id);
                        if (ds.Tables[0].Rows.Count > 0)
                        {
                            string url1 = ds.Tables[0].Rows[0]["urlimage"].ToString();
                            string path = Server.MapPath("../image/advertise/");
                            CvalidateImageForPost manageImage = new CvalidateImageForPost();
                            if (url1.Length > 0)
                            {
                                manageImage.DeleteFile(path + url1);
                            }
                        }
                        if (advertise.AdvertiseDelete(id))
                        {
                            strdadvertise = "1";
                            Application["appAdvertiset"] = null;
                        }
                    }
                    catch
                    {
                        strdadvertise = "0";
                    }
                    Response.Write(strdadvertise);
                    break;
                case ("dadvertisespecial"):
                    string strspecial = "0";
                    try
                    {
                        string id = Request.QueryString["id"].ToString();
                        AdvertiseSystem advertise = new AdvertiseSystem();
                        DataSet ds = advertise.SpecialSelectId(int.Parse(id));
                        if (ds.Tables[0].Rows.Count > 0)
                        {
                            string url1 = ds.Tables[0].Rows[0]["urlimage1"].ToString();
                            string url2 = ds.Tables[0].Rows[0]["urlimage2"].ToString();
                            string path = Server.MapPath("../image/advertise/");
                            CvalidateImageForPost manageImage = new CvalidateImageForPost();
                            if (url1.Length > 0)
                            {
                                manageImage.DeleteFile(path + url1);
                            }
                            if (url2.Length > 0)
                            {
                                manageImage.DeleteFile(path + url2);
                            }
                        }
                        if (advertise.SpecialDelete(id))
                        {
                            strspecial = "1";
                        }
                    }
                    catch
                    {
                        strspecial = "0";
                    }
                    Response.Write(strspecial);
                    break;
                case "darticle":
                    string strdarticle = "0";
                    try
                    {
                        string id = Request.QueryString["id"].ToString();
                        ArticleManagerSystem article = new ArticleManagerSystem();
                        DataSet ds = article.ArticleSelectDetail(int.Parse(id));
                        if (ds.Tables[0].Rows.Count > 0)
                        {
                            string url1 = ds.Tables[0].Rows[0]["urlimage"].ToString();
                            string path = Server.MapPath("../image/img_article/");
                            CvalidateImageForPost manageImage = new CvalidateImageForPost();
                            if (url1.Length > 0)
                            {
                                manageImage.DeleteFile(path + url1);
                            }
                        }
                        if (article.AdminArticleDelete(id))
                        {
                            strdarticle = "1";
                        }
                    }
                    catch
                    {
                        strdarticle = "0";
                    }
                    Response.Write(strdarticle);
                    break;
                    //for mobile:
                case "mobile1":
                    try
                    {
                        string type = Request.QueryString["type"].ToString();
                        string id = Request.QueryString["id"].ToString();
                        string sort = Request.QueryString["sort"].ToString();
                        string insert = Request.QueryString["insert"].ToString();
                        Mobilesystem Mobile = new Mobilesystem();
                        Boolean test = Mobile.MobileUpdate(int.Parse(id), int.Parse(insert), int.Parse(type), int.Parse(sort));
                        if (!test)
                        {
                            strmobile= "err";
                        }
                    }
                    catch
                    {
                        strmobile = "err";
                    }
                    Response.Write(strmobile);
                    break;
            }
        }
        catch
        {

        }
    }