Пример #1
0
    public void getdatarepeater()
    {
        DataTable dt = new DataTable();

        dt.Columns.Add("Quantity");
        dt.Columns.Add("Product");
        //dt.Columns.Add("ProductDetail");
        dt.Columns.Add("Price");
        //dt.Columns.Add("Checkin");
        //dt.Columns.Add("Checkout");
        //dt.Columns.Add("Quantity");
        dt.Columns.Add("Total");
        dt.Columns.Add("ProductOrderID");
        decimal total = 0;
        long    ID    = long.Parse(Request.QueryString["Id"]);

        CommonClassLibrary.CommonDataSet.ProductOrderDataTable collection = new CommonClassLibrary.CommonDataSetTableAdapters.ProductOrderTableAdapter().GetDataByTicketOrder(ID);
        foreach (CommonClassLibrary.CommonDataSet.ProductOrderRow item in collection)
        {
            CommonClassLibrary.CommonDataSet.ProductDetailDataTable collection2 = new CommonClassLibrary.CommonDataSetTableAdapters.ProductDetailTableAdapter().GetDataByProductShowName(item.Product);
            foreach (CommonClassLibrary.CommonDataSet.ProductDetailRow item2 in collection2)
            {
                total += item.Total;
                dt.Rows.Add(item2.KeyValue, item.Price.ToString("#,###") + ".-", item.Quantity, item.Total.ToString("#,###") + ".-", item.Id);  // item.LastUpdated.ToString("dd-MM-yyyy") + "   " + item.LastUpdated.ToString("HH:mm" + " น.")
            }
        }

        this.DetailTicketOrderRepeater.DataSource = dt;
        this.DetailTicketOrderRepeater.DataBind();
        this.Total_Label.Text = total.ToString("#,###") + ".-";
    }
Пример #2
0
    public void GetDataPrint()
    {
        DataTable dt = new DataTable();

        dt.Columns.Add("Product");
        //dt.Columns.Add("ProductDetail");
        dt.Columns.Add("Price");
        dt.Columns.Add("Checkin");
        dt.Columns.Add("Checkout");
        dt.Columns.Add("Quantity");
        dt.Columns.Add("Total");
        dt.Columns.Add("ProductOrderID");
        decimal total = 0;
        long    ID    = long.Parse(Request.QueryString["Id"]);

        CommonClassLibrary.CommonDataSet.ProductOrderDataTable collection = new CommonClassLibrary.CommonDataSetTableAdapters.ProductOrderTableAdapter().GetDataByTicket2(ID);
        foreach (CommonClassLibrary.CommonDataSet.ProductOrderRow item in collection)
        {
            CommonClassLibrary.CommonDataSet.ProductDetailDataTable collection2 = new CommonClassLibrary.CommonDataSetTableAdapters.ProductDetailTableAdapter().GetDataByProductShowName(item.Product);
            foreach (CommonClassLibrary.CommonDataSet.ProductDetailRow item2 in collection2)
            {
                string name = "";
                CommonClassLibrary.CommonDataSet.TextContentDataTable dt1 = new CommonClassLibrary.CommonDataSetTableAdapters.TextContentTableAdapter().GetDataById(long.Parse(item2.KeyValue));
                name   = dt1.Rows[0]["Thai"].ToString();
                total += item.Total;
                dt.Rows.Add(name, item.Price.ToString("#,###") + ".-", item.CreatedDate.ToString("dd-MM-yyyy") + "   " + item.CreatedDate.ToString("HH:mm" + " น."), item.LastUpdated.ToString("dd-MM-yyyy") + "   " + item.LastUpdated.ToString("HH:mm" + " น."), item.Quantity, item.Total.ToString("#,###") + ".-", item.Id);
            }
        }
        Repeater1.DataSource = dt;
        Repeater1.DataBind();
        Label3.Text    = total.ToString("#,###") + ".-";
        DateLabel.Text = DateTime.Now.ToString();
        IDT.Text       = ID.ToString();
    }
Пример #3
0
    protected void Confirmorder_Button_Click(object sender, EventArgs e)
    {
        long      ID = long.Parse(Request.QueryString["Id"]);
        DataTable dt = new DataTable();

        dt.Columns.Add("Product");
        //dt.Columns.Add("ProductDetail");
        dt.Columns.Add("Price");
        dt.Columns.Add("Quantity");
        dt.Columns.Add("Total");
        dt.Columns.Add("ProductOrderID");
        decimal total = 0;

        CommonClassLibrary.CommonDataSet.ProductOrderDataTable collection = new CommonClassLibrary.CommonDataSetTableAdapters.ProductOrderTableAdapter().GetDataByTicketOrder(ID);
        foreach (CommonClassLibrary.CommonDataSet.ProductOrderRow item in collection)
        {
            CommonClassLibrary.CommonDataSet.ProductDetailDataTable collection2 = new CommonClassLibrary.CommonDataSetTableAdapters.ProductDetailTableAdapter().GetDataByProductShowName(item.Product);
            foreach (CommonClassLibrary.CommonDataSet.ProductDetailRow item2 in collection2)
            {
                total += item.Price * item.Quantity;
                dt.Rows.Add(item2.KeyValue, item.Price.ToString("#,###.00"), item.Quantity.ToString("#,###.00"), (item.Price * item.Quantity).ToString("#,###") + ".-", item.Id);
            }
        }
        //Session["aaa"] = dt;
        //Session["bb"] = total.ToString("#,###") + ".-";
        if (new CommonClassLibrary.CommonDataSetTableAdapters.TicketOrderTableAdapter().UpdateQuery(DateTime.Now, DateTime.Now, 3, ID) == 1)
        {
            if (new CommonClassLibrary.CommonDataSetTableAdapters.ProductOrderTableAdapter().UpdateQueryStatus2(ID) != 0)
            {
                this.SuccessPanel.Visible = true;
                this.SuccessLabel.Text    = "บันทึกข้อมูลสำเร็จ";
                this.ErrorPanel.Visible   = false;
                showbutton();
                //Bill();
            }
            else
            {
                this.SuccessPanel.Visible = false;
                this.ErrorPanel.Visible   = true;
                this.ErrorLabel.Text      = "บันทึกข้อมูลไม่สำเร็จ";
            }
            getdatarepeater1();


            this.DetailTicketOrderRepeater.DataSource = dt;
            this.DetailTicketOrderRepeater.DataBind();
            this.Total_Label.Text = total.ToString("#,###") + ".-";

            // print
            Repeater1.DataSource = dt;
            Repeater1.DataBind();
            Label3.Text    = total.ToString("#,###") + ".-";
            DateLabel.Text = DateTime.Now.ToString();
            IDT.Text       = ID.ToString();
            //ConfirmOrderPrintPanel.Visible = true;
            // Page.ClientScript.RegisterStartupScript(this.GetType(), "CallMyFunction", "PrintConfirmDiv()", true);
            //Button1_Click(sender, e);
        }
    }
Пример #4
0
    protected void Payment_Button_Click(object sender, EventArgs e)
    {
        long      ID = long.Parse(Request.QueryString["Id"]);
        DataTable dt = new DataTable();

        dt.Columns.Add("Product");
        //dt.Columns.Add("ProductDetail");
        dt.Columns.Add("Price");
        dt.Columns.Add("Quantity");
        dt.Columns.Add("Total");
        dt.Columns.Add("ProductOrderID");
        decimal total = 0;

        CommonClassLibrary.CommonDataSet.ProductOrderDataTable collection = new CommonClassLibrary.CommonDataSetTableAdapters.ProductOrderTableAdapter().GetDataByTicketOrder(ID);
        foreach (CommonClassLibrary.CommonDataSet.ProductOrderRow item in collection)
        {
            CommonClassLibrary.CommonDataSet.ProductDetailDataTable collection2 = new CommonClassLibrary.CommonDataSetTableAdapters.ProductDetailTableAdapter().GetDataByProductShowName(item.Product);
            foreach (CommonClassLibrary.CommonDataSet.ProductDetailRow item2 in collection2)
            {
                total += item.Price * item.Quantity;
                dt.Rows.Add(item2.KeyValue, item.Price.ToString("#,###.00"), item.Quantity.ToString("#,###.00"), (item.Price * item.Quantity).ToString("#,###") + ".-", item.Id);
            }
        }

        // Session["aaa"] = dt;
        // Session["bb"] = total.ToString("#,###") + ".-";

        HttpCookie cookie = Request.Cookies[Resources.Resource.CookieName];

        if (new CommonClassLibrary.CommonDataSetTableAdapters.PaymentTableAdapter().InsertQuery(ID, "-", DateTime.Now, DateTime.Now, 0, int.Parse(cookie.Values["Id"])) == 1)
        {
            this.SuccessPanel.Visible = true;
            this.SuccessLabel.Text    = "ชำระเงินสำเร็จ";
            this.ErrorPanel.Visible   = false;

            //ConfirmOrderPrintPanel.Visible = true;
            Page.ClientScript.RegisterStartupScript(this.GetType(), "CallMyFunction", "PrintConfirmDiv()", true);

            showbutton();
        }
        else
        {
            this.SuccessPanel.Visible = false;
            this.ErrorPanel.Visible   = true;
            this.ErrorLabel.Text      = "ชำระเงินไม่สำเร็จ";
        }
    }
Пример #5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            System.Web.UI.HtmlControls.HtmlGenericControl Services = (System.Web.UI.HtmlControls.HtmlGenericControl)Master.FindControl("Li5");
            Services.Attributes.Add("class", "active");

            int IDProduct = int.Parse(Request.QueryString["IDProduct"]);


            CommonClassLibrary.CommonDataSet.ProductDetailDataTable collection = new CommonClassLibrary.CommonDataSetTableAdapters.ProductDetailTableAdapter().GetDataByProductShowName(IDProduct);
            foreach (CommonClassLibrary.CommonDataSet.ProductDetailRow item in collection)
            {
                Label4.Text = item.KeyValue;
                CommonClassLibrary.CommonDataSet.TextContentDataTable collection111 = new CommonClassLibrary.CommonDataSetTableAdapters.TextContentTableAdapter().GetDataById(long.Parse(item.KeyValue));
                foreach (CommonClassLibrary.CommonDataSet.TextContentRow item111 in collection111)
                {
                    this.Name_TextBox.Text   = item111.Thai;
                    this.NameEN_TextBox.Text = item111.English;
                }
            }

            CommonClassLibrary.CommonDataSet.ProductDetailDataTable collection2 = new CommonClassLibrary.CommonDataSetTableAdapters.ProductDetailTableAdapter().GetDataByProductShowDetail(IDProduct);
            foreach (CommonClassLibrary.CommonDataSet.ProductDetailRow item2 in collection2)
            {
                Label5.Text = item2.KeyValue;

                CommonClassLibrary.CommonDataSet.TextContentDataTable collection222 = new CommonClassLibrary.CommonDataSetTableAdapters.TextContentTableAdapter().GetDataById(long.Parse(item2.KeyValue));

                foreach (CommonClassLibrary.CommonDataSet.TextContentRow item222 in collection222)
                {
                    this.Detail_TextBox.Text   = item222.Thai;
                    this.DetailEN_TextBox.Text = item222.English;
                }
            }



            getImage();
        }
    }
Пример #6
0
    public void getbeveragerepeater()
    {
        string    nameEn   = "";
        string    nameCH   = "";
        int       Category = int.Parse(Request.QueryString["Category"]);
        DataTable dt       = new DataTable();

        dt.Columns.Add("IDProduct");
        dt.Columns.Add("Name");
        dt.Columns.Add("ImageURL");
        dt.Columns.Add("Detail");
        dt.Columns.Add("Price");
        dt.Columns.Add("PromotionPrice");
        dt.Columns.Add("NameEn");
        CommonClassLibrary.CommonDataSet.ProductCateDataTable collection = new CommonClassLibrary.CommonDataSetTableAdapters.ProductCateTableAdapter().GetDataByCategory(Category);
        foreach (CommonClassLibrary.CommonDataSet.ProductCateRow item in collection)
        {
            string name      = "";
            string imageUrl  = "Image/no_image_available.jpg";
            string detail    = "";
            string price     = "";
            string promotion = "";
            CommonClassLibrary.CommonDataSet.ProductDetailDataTable collection2 = new CommonClassLibrary.CommonDataSetTableAdapters.ProductDetailTableAdapter().GetDataByProduct(item.Product);
            foreach (CommonClassLibrary.CommonDataSet.ProductDetailRow item2 in collection2)
            {
                if (item2.KeyName == "Name")
                {
                    name = item2.KeyValue;
                    CommonClassLibrary.CommonDataSet.TextContentDataTable collection3 = new CommonClassLibrary.CommonDataSetTableAdapters.TextContentTableAdapter().GetDataById(long.Parse(item2.KeyValue));
                    foreach (CommonClassLibrary.CommonDataSet.TextContentRow item3 in collection3)
                    {
                        name   = item3.Thai;
                        nameEn = item3.English;
                    }
                }
                else if (item2.KeyName == "Picture")
                {
                    if (item2.KeyValue == "")
                    {
                        imageUrl = "no_image_available.jpg";
                    }
                    else
                    {
                        imageUrl = item2.KeyValue;
                    }
                }
                else if (item2.KeyName == "Detail")
                {
                    detail = item2.KeyValue;
                }
                else if (item2.KeyName == "Price")
                {
                    price = double.Parse(item2.KeyValue).ToString("#.###") + ".-";
                }
                else if (item2.KeyName == "PromotionPrice")
                {
                    if (item2.KeyValue == "-")
                    {
                        promotion = (item2.KeyValue);
                    }
                    else
                    {
                        promotion = double.Parse(item2.KeyValue).ToString("#.###") + ".-";
                    }
                }
            }
            dt.Rows.Add(item.Product, name, imageUrl, detail, price, promotion, nameEn);
        }
        this.BeverageRepeater.DataSource = dt;
        this.BeverageRepeater.DataBind();
    }
Пример #7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            System.Web.UI.HtmlControls.HtmlGenericControl Services = (System.Web.UI.HtmlControls.HtmlGenericControl)Master.FindControl("Li1");
            Services.Attributes.Add("class", "active");

            int IDProduct = int.Parse(Request.QueryString["IDProduct"]);
            getcategorycheckbox();


            CommonClassLibrary.CommonDataSet.ProductDetailDataTable collection = new CommonClassLibrary.CommonDataSetTableAdapters.ProductDetailTableAdapter().GetDataByProductShowName(IDProduct);
            foreach (CommonClassLibrary.CommonDataSet.ProductDetailRow item in collection)
            {
                Label4.Text = item.KeyValue;
                CommonClassLibrary.CommonDataSet.TextContentDataTable collection111 = new CommonClassLibrary.CommonDataSetTableAdapters.TextContentTableAdapter().GetDataById(long.Parse(item.KeyValue));
                foreach (CommonClassLibrary.CommonDataSet.TextContentRow item111 in collection111)
                {
                    this.Name_TextBox.Text   = item111.Thai;
                    this.NameEN_TextBox.Text = item111.English;
                }
            }

            CommonClassLibrary.CommonDataSet.ProductDetailDataTable collection2 = new CommonClassLibrary.CommonDataSetTableAdapters.ProductDetailTableAdapter().GetDataByProductShowDetail(IDProduct);
            foreach (CommonClassLibrary.CommonDataSet.ProductDetailRow item2 in collection2)
            {
                Label5.Text = item2.KeyValue;

                CommonClassLibrary.CommonDataSet.TextContentDataTable collection222 = new CommonClassLibrary.CommonDataSetTableAdapters.TextContentTableAdapter().GetDataById(long.Parse(item2.KeyValue));

                foreach (CommonClassLibrary.CommonDataSet.TextContentRow item222 in collection222)
                {
                    this.Detail_TextBox.Text   = item222.Thai;
                    this.DetailEN_TextBox.Text = item222.English;
                }
            }

            CommonClassLibrary.CommonDataSet.ProductDetailDataTable collection3 = new CommonClassLibrary.CommonDataSetTableAdapters.ProductDetailTableAdapter().GetDataByProductShowPrice(IDProduct);
            foreach (CommonClassLibrary.CommonDataSet.ProductDetailRow item3 in collection3)
            {
                this.Price_TextBox.Text = item3.KeyValue;
            }

            CommonClassLibrary.CommonDataSet.ProductDetailDataTable collection4 = new CommonClassLibrary.CommonDataSetTableAdapters.ProductDetailTableAdapter().GetDataByProductShowPromotionPrice(IDProduct);
            foreach (CommonClassLibrary.CommonDataSet.ProductDetailRow item4 in collection4)
            {
                if (item4.KeyValue != "-")
                {
                    this.PromotionPrice_TextBox.Text = item4.KeyValue;
                }
            }



            CommonClassLibrary.CommonDataSet.ProductCateDataTable collection6 = new CommonClassLibrary.CommonDataSetTableAdapters.ProductCateTableAdapter().GetDataByProduct(IDProduct);
            foreach (CommonClassLibrary.CommonDataSet.ProductCateRow item6 in collection6)
            {
                radiobutton.SelectedValue = Request.QueryString["Category"]; //setselect
            }

            getImage();
            getMenu();
        }
    }
Пример #8
0
    protected void Confirm_Button_Click(object sender, EventArgs e)
    {
        int IDProduct = int.Parse(Request.QueryString["IDProduct"]);

        //Name
        if (new CommonClassLibrary.CommonDataSetTableAdapters.TextContentTableAdapter().UpdateQueryById(Name_TextBox.Text, NameEN_TextBox.Text, " ", DateTime.Now, 1, long.Parse(Label4.Text)) == 1)
        {
            this.SuccessPanel.Visible = true;
            this.SuccessLabel.Text    = "บันทึกข้อมูลสำเร็จ";
            this.ErrorPanel.Visible   = false;
        }
        else
        {
            this.SuccessPanel.Visible = false;
            this.ErrorLabel.Text      = "บันทึกข้อมูลไม่สำเร็จ";
            this.ErrorPanel.Visible   = true;
        }
        //Detail
        if (new CommonClassLibrary.CommonDataSetTableAdapters.TextContentTableAdapter().UpdateQueryById(Detail_TextBox.Text, DetailEN_TextBox.Text, " ", DateTime.Now, 1, long.Parse(Label5.Text)) == 1)
        {
            this.SuccessPanel.Visible = true;
            this.SuccessLabel.Text    = "บันทึกข้อมูลสำเร็จ";
            this.ErrorPanel.Visible   = false;
        }
        else
        {
            this.SuccessPanel.Visible = false;
            this.ErrorLabel.Text      = "บันทึกข้อมูลไม่สำเร็จ";
            this.ErrorPanel.Visible   = true;
        }
        //if (new CommonClassLibrary.CommonDataSetTableAdapters.ProductDetailTableAdapter().UpdateQuery(IDProduct, DateTime.Now, DateTime.Now, 1, 1, "Name", this.Name_TextBox.Text) == 1)
        //{
        //    this.SuccessPanel.Visible = true;
        //    this.SuccessLabel.Text = "บันทึกข้อมูลสำเร็จ";
        //    this.ErrorPanel.Visible = false;
        //    this.PictureSuccessPanel.Visible = false;
        //    this.PictureErrorPanel.Visible = false;
        //}
        //else
        //{
        //    this.SuccessPanel.Visible = false;
        //    this.ErrorLabel.Text = "บันทึกข้อมูลไม่สำเร็จ";
        //    this.ErrorPanel.Visible = true;
        //    this.PictureSuccessPanel.Visible = false;
        //    this.PictureErrorPanel.Visible = false;
        //}

        if (new CommonClassLibrary.CommonDataSetTableAdapters.ProductDetailTableAdapter().UpdateQuery(IDProduct, DateTime.Now, DateTime.Now, 1, 1, "Price", this.Price_TextBox.Text) == 1)
        {
            this.SuccessPanel.Visible = true;
            this.SuccessLabel.Text    = "บันทึกข้อมูลสำเร็จ";
            this.ErrorPanel.Visible   = false;
        }
        else
        {
            this.SuccessPanel.Visible = false;
            this.ErrorLabel.Text      = "บันทึกข้อมูลไม่สำเร็จ";
            this.ErrorPanel.Visible   = true;
        }
        if (this.PromotionPrice_TextBox.Text != "")
        {
            if (new CommonClassLibrary.CommonDataSetTableAdapters.ProductDetailTableAdapter().UpdateQuery(IDProduct, DateTime.Now, DateTime.Now, 1, 1, "PromotionPrice", this.PromotionPrice_TextBox.Text) == 1)
            {
                this.SuccessPanel.Visible = true;
                this.SuccessLabel.Text    = "บันทึกข้อมูลสำเร็จ";
                this.ErrorPanel.Visible   = false;
            }
            else
            {
                this.SuccessPanel.Visible = false;
                this.ErrorLabel.Text      = "บันทึกข้อมูลไม่สำเร็จ";
                this.ErrorPanel.Visible   = true;
            }
        }
        else
        {
            if (new CommonClassLibrary.CommonDataSetTableAdapters.ProductDetailTableAdapter().UpdateQuery(IDProduct, DateTime.Now, DateTime.Now, 1, 1, "PromotionPrice", "-") == 1)
            {
                this.SuccessPanel.Visible = true;
                this.SuccessLabel.Text    = "บันทึกข้อมูลสำเร็จ";
                this.ErrorPanel.Visible   = false;
            }
            else
            {
                this.SuccessPanel.Visible = false;
                this.ErrorLabel.Text      = "บันทึกข้อมูลไม่สำเร็จ";
                this.ErrorPanel.Visible   = true;
            }
        }



        if (Picture_FileUpload.HasFile)
        {
            string namefile = SaveFile(Picture_FileUpload);

            CommonClassLibrary.CommonDataSet.ProductDetailDataTable collection3 = new CommonClassLibrary.CommonDataSetTableAdapters.ProductDetailTableAdapter().GetDataByProduceShowImage(IDProduct);
            if (collection3.Rows.Count > 0)
            {
                if (new CommonClassLibrary.CommonDataSetTableAdapters.ProductDetailTableAdapter().UpdateQuery(IDProduct, DateTime.Now, DateTime.Now, 1, 1, "Picture", "Image/" + namefile) == 1)
                {
                    if (new CommonClassLibrary.CommonDataSetTableAdapters.ProductDetailTableAdapter().UpdateQuery(IDProduct, DateTime.Now, DateTime.Now, 1, 1, "Thumbnail", "Thumbnail/" + namefile) == 1)
                    {
                        this.SuccessPanel.Visible = true;
                        this.SuccessLabel.Text    = "บันทึกข้อมูลสำเร็จ";
                        this.ErrorPanel.Visible   = false;
                        getImage();
                    }
                    else
                    {
                        this.SuccessPanel.Visible = false;
                        this.ErrorLabel.Text      = "บันทึกข้อมูลไม่สำเร็จ";
                        this.ErrorPanel.Visible   = true;
                    }
                }
                else
                {
                    this.SuccessPanel.Visible = false;
                    this.ErrorLabel.Text      = "บันทึกข้อมูลไม่สำเร็จ";
                    this.ErrorPanel.Visible   = true;
                }
            }
            else
            {
                if (new CommonClassLibrary.CommonDataSetTableAdapters.ProductDetailTableAdapter().InsertQuery(IDProduct, DateTime.Now, DateTime.Now, 1, 1, "Picture", "Image/" + namefile) == 1)
                {
                    if (new CommonClassLibrary.CommonDataSetTableAdapters.ProductDetailTableAdapter().InsertQuery(IDProduct, DateTime.Now, DateTime.Now, 1, 1, "Thumbnail", "Thumbnail/" + namefile) == 1)
                    {
                        this.SuccessPanel.Visible = true;
                        this.SuccessLabel.Text    = "บันทึกข้อมูลสำเร็จ";
                        this.ErrorPanel.Visible   = false;
                        getImage();
                    }
                    else
                    {
                        this.SuccessPanel.Visible = false;
                        this.ErrorLabel.Text      = "บันทึกข้อมูลไม่สำเร็จ";
                        this.ErrorPanel.Visible   = true;
                    }
                }
                else
                {
                    this.SuccessPanel.Visible = false;
                    this.ErrorLabel.Text      = "บันทึกข้อมูลไม่สำเร็จ";
                    this.ErrorPanel.Visible   = true;
                }
            }
        }



        if (new CommonClassLibrary.CommonDataSetTableAdapters.ProductCateTableAdapter().DeleteQueryProduct(IDProduct) > 0)
        {
            if (radiobutton.SelectedItem.Selected)
            {
                if (new CommonClassLibrary.CommonDataSetTableAdapters.ProductCateTableAdapter().InsertQuery(IDProduct, int.Parse(radiobutton.SelectedItem.Value)) == 1)
                {
                    this.SuccessPanel.Visible = true;
                    this.SuccessLabel.Text    = "บันทึกข้อมูลสำเร็จ";
                    this.ErrorPanel.Visible   = false;
                }
                else
                {
                    this.SuccessPanel.Visible = false;
                    this.ErrorLabel.Text      = "บันทึกข้อมูลไม่สำเร็จ";
                    this.ErrorPanel.Visible   = true;
                }
            }
        }

        //for (int i = 0; i < Category_CheckBoxList.Items.Count; i++)
        //{
        //    if (Category_CheckBoxList.Items[i].Selected)
        //    {
        //        CommonClassLibrary.CommonDataSet.ProductCateDataTable collection = new CommonClassLibrary.CommonDataSetTableAdapters.ProductCateTableAdapter().GetDataByProductandCategory(IDProduct, int.Parse(Category_CheckBoxList.SelectedValue));
        //        if (collection.Rows.Count == 0)
        //        {
        //            if (new CommonClassLibrary.CommonDataSetTableAdapters.ProductCateTableAdapter().InsertQuery(IDProduct, int.Parse(Category_CheckBoxList.SelectedValue)) == 1)
        //            {
        //                this.SuccessPanel.Visible = true;
        //                this.SuccessLabel.Text = "บันทึกข้อมูลสำเร็จ";
        //                this.ErrorPanel.Visible = false;
        //                this.PictureSuccessPanel.Visible = false;
        //                this.PictureErrorPanel.Visible = false;
        //            }
        //            else
        //            {
        //                this.SuccessPanel.Visible = false;
        //                this.ErrorLabel.Text = "บันทึกข้อมูลไม่สำเร็จ";
        //                this.ErrorPanel.Visible = true;
        //                this.PictureSuccessPanel.Visible = false;
        //                this.PictureErrorPanel.Visible = false;
        //            }
        //        }
        //    }
        //    else
        //    {
        //        CommonClassLibrary.CommonDataSet.ProductCateDataTable collection2 = new CommonClassLibrary.CommonDataSetTableAdapters.ProductCateTableAdapter().GetDataByProductandCategory(IDProduct, i + 1);
        //        if (collection2.Rows.Count == 1)
        //        {
        //            if (new CommonClassLibrary.CommonDataSetTableAdapters.ProductCateTableAdapter().DeleteQueryProductandCategory(IDProduct, i + 1) == 1)
        //            {
        //                this.SuccessPanel.Visible = true;
        //                this.SuccessLabel.Text = "บันทึกข้อมูลสำเร็จ";
        //                this.ErrorPanel.Visible = false;
        //                this.PictureSuccessPanel.Visible = false;
        //                this.PictureErrorPanel.Visible = false;
        //            }
        //            else
        //            {
        //                this.SuccessPanel.Visible = false;
        //                this.ErrorLabel.Text = "บันทึกข้อมูลไม่สำเร็จ";
        //                this.ErrorPanel.Visible = true;
        //                this.PictureSuccessPanel.Visible = false;
        //                this.PictureErrorPanel.Visible = false;
        //            }
        //        }
        //    }
        //}
    }