private void AddDetail()
        {
            string action = FieldAction.Value;

            int SubCatId = Convert.ToInt32(FieldId.Value);
            string myUniqueFileName1 = null;
            string myUniqueFileName2 = null;
            string myUniqueFileName3 = null;
            string myUniqueFileName4 = null;
            string myUniqueFileName5 = null;
            int imgwidth = 0;
            int imgheight = 0;

            if (flupImage1.PostedFile != null && flupImage1.PostedFile.FileName != "")
            {
                string imgName1 = flupImage1.FileName;
                string ext = System.IO.Path.GetExtension(imgName1);
                myUniqueFileName1 = string.Format(@"{0}" + ext, Guid.NewGuid());
                string imgPath = "image/" + myUniqueFileName1;
                HttpPostedFile pf = flupImage1.PostedFile;
                System.Drawing.Image bm = System.Drawing.Image.FromStream(pf.InputStream);
                if (!img1chk.Checked)
                {
                    imgwidth = Convert.ToInt32(Request["img1w"]);
                    imgheight = Convert.ToInt32(Request["img1h"]);
                    bm = ResizeBitmap((Bitmap)bm, imgwidth, imgheight); /// new width, height
                    bm.Save(Server.MapPath(imgPath));
                }
                else
                {
                    flupImage1.SaveAs(Server.MapPath(imgPath));
                }
            }

            if (flupImage2.PostedFile != null && flupImage2.PostedFile.FileName != "")
            {
                string imgName1 = flupImage2.FileName;
                string ext = System.IO.Path.GetExtension(imgName1);
                myUniqueFileName2 = string.Format(@"{0}" + ext, Guid.NewGuid());
                string imgPath = "image/" + myUniqueFileName2;
                HttpPostedFile pf = flupImage2.PostedFile;
                System.Drawing.Image bm = System.Drawing.Image.FromStream(pf.InputStream);
                if (!img2chk.Checked)
                {
                    imgwidth = Convert.ToInt32(Request["img2w"]);
                    imgheight = Convert.ToInt32(Request["img2h"]);
                    bm = ResizeBitmap((Bitmap)bm, imgwidth, imgheight); /// new width, height
                    bm.Save(Server.MapPath(imgPath));
                }
                else
                {
                    flupImage2.SaveAs(Server.MapPath(imgPath));
                }

            }

            if (flupImage3.PostedFile != null && flupImage3.PostedFile.FileName != "")
            {
                string imgName1 = flupImage3.FileName;
                string ext = System.IO.Path.GetExtension(imgName1);
                myUniqueFileName3 = string.Format(@"{0}" + ext, Guid.NewGuid());
                string imgPath = "image/" + myUniqueFileName3;
                HttpPostedFile pf = flupImage3.PostedFile;
                System.Drawing.Image bm = System.Drawing.Image.FromStream(pf.InputStream);
                if (!img3chk.Checked)
                {
                    imgwidth = Convert.ToInt32(Request["img3w"]);
                    imgheight = Convert.ToInt32(Request["img3h"]);
                    bm = ResizeBitmap((Bitmap)bm, imgwidth, imgheight); /// new width, height
                    bm.Save(Server.MapPath(imgPath));
                }
                else
                {
                    flupImage3.SaveAs(Server.MapPath(imgPath));
                }

            }

            if (flupImage4.PostedFile != null && flupImage4.PostedFile.FileName != "")
            {
                string imgName1 = flupImage4.FileName;
                string ext = System.IO.Path.GetExtension(imgName1);
                myUniqueFileName4 = string.Format(@"{0}" + ext, Guid.NewGuid());
                string imgPath = "image/" + myUniqueFileName4;
                HttpPostedFile pf = flupImage4.PostedFile;
                System.Drawing.Image bm = System.Drawing.Image.FromStream(pf.InputStream);
                if (!img4chk.Checked)
                {
                    imgwidth = Convert.ToInt32(Request["img4w"]);
                    imgheight = Convert.ToInt32(Request["img4h"]);
                    bm = ResizeBitmap((Bitmap)bm, imgwidth, imgheight); /// new width, height
                    bm.Save(Server.MapPath(imgPath));
                }
                else
                {
                    flupImage4.SaveAs(Server.MapPath(imgPath));
                }

            }

            if (flupImage5.PostedFile != null && flupImage5.PostedFile.FileName != "")
            {
                string imgName1 = flupImage5.FileName;
                string ext = System.IO.Path.GetExtension(imgName1);
                myUniqueFileName5 = string.Format(@"{0}" + ext, Guid.NewGuid());
                string imgPath = "image/" + myUniqueFileName5;
                HttpPostedFile pf = flupImage5.PostedFile;
                System.Drawing.Image bm = System.Drawing.Image.FromStream(pf.InputStream);
                if (!img5chk.Checked)
                {
                    imgwidth = Convert.ToInt32(Request["img5w"]);
                    imgheight = Convert.ToInt32(Request["img5h"]);
                    bm = ResizeBitmap((Bitmap)bm, imgwidth, imgheight); /// new width, height
                    bm.Save(Server.MapPath(imgPath));
                }
                else
                {
                    flupImage5.SaveAs(Server.MapPath(imgPath));
                }

            }

            string Title = TitleText.Text;
            string SubTitle = SubTitleText.Text;
            int show = Show.Checked ? 1 : 0;
            string Desc1 = Desc1Text.Text;
            string Desc2 = Desc2Text.Text;
            int ScreenImage = 0;
            if (Scroll.Checked)
                ScreenImage = 1;
            else if (MainPage.Checked)
                ScreenImage = 2;
            else if (DetailPage.Checked)
                ScreenImage = 3;

            int offer = 0;
            if (DetailOffer.Checked == true)
                offer = 1;
            else
                offer = 2;

            string price = Price.Text == "" ? "0" : Price.Text;
            sql_object sql_obj = new sql_object();
            sql_obj.DetailAdd(SubCatId, Title, SubTitle, Desc1, Desc2, myUniqueFileName1, myUniqueFileName2, myUniqueFileName3,
                myUniqueFileName4, myUniqueFileName5, ScreenImage, show, offer, ItemNum.Text, Convert.ToDecimal(price));
        }