Ejemplo n.º 1
0
 private void LuuTraGia()
 {
     try
     {
         TraGiaSanPham tg = new TraGiaSanPham();
         tg.InsertFields(int.Parse(ViewState["SanPhamID"].ToString()), Common.NguoiDungID(),
                         wneTraGia.ValueDecimal, wneSoLuongTraGia.ValueInt, txtYKienTraGia.Value, null, null);
         hidTraGia.Value = "false";
         //pnlProductDetail.RefreshTargetIDs = "wneSoLuongTraGia";
         //pnlProductDetail.TriggerControlIDs = "wneSoLuongTraGia";
         //wneSoLuongTraGia.Value = "1";
         //wneTraGia.Value = "";
     }
     catch (Exception ex)
     {
         //Response.Redirect("Message.aspx?msg=" + ex.Message.Replace("\r\n"," "), false);
         Response.Write(ex.ToString());
     }
 }
Ejemplo n.º 2
0
    private void LoadTabContent04()
    {
        tblTraGiaContent.Visible = true;
        tblHoiDap.Visible = false;
        tblHoiDapContent.Visible = false;
        tblCacCuaHang.Visible = false;
        tblContent.Rows.Clear();

        TraGiaSanPham tg = new TraGiaSanPham();
        DataSet sds = tg.SelectTraGiaSanPhamBySanPhamID(int.Parse(ViewState["SanPhamID"].ToString()));
        //string strThongTin = sds.Tables[0].Rows[0]["ThongTinSanPham"].ToString();
        int countrow = tblTraGiaContent.Rows.Count;
        for (int j = 1; j < countrow; j++)
        {
            tblTraGiaContent.Rows.Remove(tblTraGiaContent.Rows[1]);
        }

        int index = 0;
        foreach (DataRow dr in sds.Tables[0].Rows)
        {
            index++;
            HtmlTableRow str = new HtmlTableRow();
            //str.Style.Add("border", "1pt solid");
            HtmlTableCell std1 = new HtmlTableCell();
            HtmlTableCell std2 = new HtmlTableCell();
            HtmlTableCell std3 = new HtmlTableCell();
            HtmlTableCell std4 = new HtmlTableCell();
            HtmlTableCell std5 = new HtmlTableCell();
            std1.Align = "center";
            std1.Style.Add("border-right", "1pt solid");
            std1.Style.Add("border-bottom", "1pt solid");
            std2.Align = "center";
            std2.Style.Add("border-right", "1pt solid");
            std2.Style.Add("border-bottom", "1pt solid");
            std3.Align = "center";
            std3.Style.Add("border-right", "1pt solid");
            std3.Style.Add("border-bottom", "1pt solid");
            std4.Align = "center";
            std4.Style.Add("border-right", "1pt solid");
            std4.Style.Add("border-bottom", "1pt solid");
            std5.Align = "center";
            std5.Style.Add("border-right", "1pt solid");
            std5.Style.Add("border-bottom", "1pt solid");

            std1.InnerHtml = index.ToString();
            std2.InnerHtml = dr["HovaTen"] + "<br>" +
                             "<a href=\"ymsgr:sendIM?" + dr["YM"] + "\"><img src=\"http://opi.yahoo.com/online?u=" +
                             dr["YM"] + "&t=1\" border=\"0\"></a>";
            std3.InnerHtml = "<b>" + String.Format("{0:0,0}", decimal.Parse("0" + dr["GiaMuonMua"])).Replace(",", ".") +
                             " VNĐ";
            std4.InnerHtml = "&nbsp;" + dr["SoLuong"];
            std5.InnerHtml = "&nbsp;" + dr["ChiTiet"];

            str.Cells.Add(std1);
            str.Cells.Add(std2);
            str.Cells.Add(std3);
            str.Cells.Add(std4);
            str.Cells.Add(std5);

            tblTraGiaContent.Rows.Add(str);
        }
    }