Exemple #1
0
 protected void btn第七張圖_Click(object sender, EventArgs e)
 {
     if (FileUpload7.HasFile)
     {
         string savePath = Server.MapPath(@"/./images/7.jpg");
         FileUpload7.SaveAs(savePath);
         lbl7.Visible = true;
         lbl7.Text    = "上傳成功";
     }
 }
Exemple #2
0
    //上传聊天页面图片
    protected void Button6_Click(object sender, EventArgs e)
    {
        string bgStyle  = ConfigurationManager.AppSettings["UserDefinedPath"] + "\\Default\\chat_bg0.gif";
        string rightimg = this.FileUpload7.FileName;
        string topimg   = this.FileUpload8.FileName;

        if (string.IsNullOrEmpty(bgStyle) || string.IsNullOrEmpty(rightimg) || string.IsNullOrEmpty(topimg))
        {
            Label3.Text = "请选择上传图片";
            this.ModalPopupExtender3.Show();
            return;
        }
        if (!string.IsNullOrEmpty(LoadImageType(bgStyle)) || !string.IsNullOrEmpty(LoadImageType(rightimg)) || !string.IsNullOrEmpty(LoadImageType(topimg)))
        {
            Label3.Text = "图片,请上传格式为jpg,gif,png,bmp图片";
            this.ModalPopupExtender3.Show();
            return;
        }
        WebSite wst = WebSiteManager.GetWebSiteByDomainName(this.drpDomainName.SelectedValue);

        if (wst != null)
        {
            if (Session["User"] != null)
            {
                oper = (Operator)Session["User"];
                string path = ConfigurationManager.AppSettings["UserDefinedPath"] + "\\" + oper.Account.AccountNumber + "\\" + drpDomainName.SelectedValue;
                Directory.CreateDirectory(path);
                string aa           = LiveSupport.BLL.WebSiteManager.WebSite_UserDefined;
                string chatBGimg    = "chat_bg" + aa + Path.GetExtension(bgStyle);
                string chatRightimg = "chat_right" + aa + Path.GetExtension(rightimg);
                string leaveTopimg  = "leave_top" + aa + Path.GetExtension(topimg);
                File.Copy(bgStyle, path + "\\" + chatBGimg, true);
                FileUpload7.SaveAs(path + "\\" + chatRightimg);
                FileUpload8.SaveAs(path + "\\" + leaveTopimg);
                wst.ChatStyle = aa + "|" + chatBGimg + "|" + chatRightimg + "|" + leaveTopimg;
                WebSiteManager.Update(wst);
                AddIcoLocation(wst.IcoLocation);
                AddBannerStyle(wst.IconStyle);
                AddInviteStyle(wst.InviteStyle);
                AddChatStyle(wst.ChatStyle);
            }
            else
            {
                Response.Redirect("../Index.aspx");
            }
        }
        else
        {
            Response.Write("<script>alert('请选择上传到那个域名!');</script>");
        }
    }
 protected void btnupload_Click(object sender, EventArgs e)
 {
     FileUpload2.SaveAs(Server.MapPath(img1));
     Image1.ImageUrl = img1;
     FileUpload3.SaveAs(Server.MapPath(img2));
     Image2.ImageUrl = img2;
     FileUpload4.SaveAs(Server.MapPath(img3));
     Image3.ImageUrl = img3;
     FileUpload5.SaveAs(Server.MapPath(img4));
     Image4.ImageUrl = img4;
     FileUpload6.SaveAs(Server.MapPath(img5));
     Image5.ImageUrl = img5;
     FileUpload7.SaveAs(Server.MapPath(img6));
     Image6.ImageUrl = img6;
 }
    protected void Button8_Click(object sender, EventArgs e)
    {
        string strMsgSuccess = "Upload Success";
        string strMsgSelect  = "Please select your file";

        if (FileUpload7.HasFile)
        {
            String strFileName = FileUpload7.FileName;
            FileUpload7.SaveAs(Server.MapPath("lecture7/" + strFileName));
            //Response.Write("<script> alert('Upload Success');<script>");
            TextBox7.Text = strMsgSuccess;
        }
        else
        {
            //Response.Write("<script> alert('Pleases select your file');<script>");
            TextBox7.Text = strMsgSelect;
        }
    }
        protected void btnUpAnh_Click(object sender, EventArgs e)
        {
            string newName;
            int    girlid = int.Parse(Request.QueryString["id"]);

            if (FileUpload7.FileName != "")
            {
                DataTable listimg = im.getImagebyGFId(girlid);
                if (listimg.Rows.Count == 6)
                {
                    lblThongbaoanh.Text      = "Mỗi Girl Friend nên tối đa 6 ảnh !";
                    lblThongbaoanh.ForeColor = System.Drawing.Color.Red;
                }
                else
                {
                    System.IO.FileInfo f = new System.IO.FileInfo(FileUpload7.FileName);
                    newName = "Girl" + girlid + "-" + Guid.NewGuid().ToString("N") + f.Extension;
                    FileUpload7.SaveAs(Server.MapPath("/") + "Content/Image/" + newName);
                    im.insert(girlid, newName);
                }
            }
            Response.Redirect("EditGirlFriend.aspx?id=" + girlid);
        }
Exemple #6
0
    protected void Btnsubmit_Click(object sender, EventArgs e)
    {
        if (Page.IsValid)
        {
            if (Session["CheckRefresh"].ToString() == ViewState["CheckRefresh"].ToString())
            {
                Session["CheckRefresh"] = Server.UrlDecode(System.DateTime.Now.ToString());

                bl.user_id     = Session["username"].ToString();
                bl.district_id = ""; //Session["Dist_Code"].ToString();


                // Int32 maxLimit = 100000;// for 100 kb
                Int32 maxLimit = 5000;


                string content_type;
                if (FileUpload7.HasFile)
                {
                    //  string filename=  FileUpload7.FileName;
                    double size        = FileUpload7.PostedFile.ContentLength;
                    string contenttype = FileUpload7.PostedFile.ContentType;

                    if (FileUpload7.PostedFile.ContentLength > maxLimit)
                    {
                        Utilities.MessageBoxShow("File Is too Big...Maximum Size allowed is 5 KB");
                    }
                    else if (contenttype == "image/gif" || contenttype == "image/png" || contenttype == "image/jpg" || contenttype == "image/jpeg" || contenttype == "image/pjpeg" || contenttype == "image/x-png")
                    {
                        content_type = FileUpload7.PostedFile.ContentType.ToString();
                        // string filename = System.IO.Path.GetFileName(FileUpload7.PostedFile.FileName);

                        //Get Filename from fileupload control
                        string filename = Path.GetFileName(FileUpload7.PostedFile.FileName);


                        //Save images into Images folder
                        FileUpload7.SaveAs(Server.MapPath("../images/" + filename));
                        bl.filename = "../images/" + filename;
                        // bl.filename = "images/" + filename;


                        rb = dl.Insert_notice_image(bl);
                        if (rb.status == true)
                        {
                            Utilities.MessageBoxShow("Record Saved successfully");
                        }
                        else
                        {
                            Utilities.MessageBoxShow("Please Try again");
                        }
                    }
                    else
                    {
                        Utilities.MessageBoxShow("सिर्फ़ .jpg,.png,.gif,.jpeg दस्तावेज की अनुमति है, कृप्या पुनः प्रयास करे");
                    }
                }
                else
                {
                    Utilities.MessageBoxShow("कृप्या पुनः प्रयास करे");
                }
            }
            else
            {
                Utilities.MessageBoxShow(" पेज रिफ्रेश करना वर्जित है ");
            }
        }
    }
 protected void Button1_Click(object sender, EventArgs e)
 {
     FileUpload7.SaveAs(Server.MapPath(img6));
     Image6.ImageUrl = img6;
 }
Exemple #8
0
 void imageup()
 {
     if (FileUpload1.HasFile)
     {
         FileUpload1.SaveAs(Server.MapPath("/profilepics/") + FileUpload1.FileName);
         image[1] = "~/profilepics/" + FileUpload1.FileName;
         count++;
     }
     else
     {
         image[1] = "";
     }
     if (FileUpload2.HasFile)
     {
         FileUpload2.SaveAs(Server.MapPath("/profilepics/") + FileUpload2.FileName);
         image[2] = "~/profilepics/" + FileUpload2.FileName;
         count++;
     }
     else
     {
         image[2] = "";
     }
     if (FileUpload3.HasFile)
     {
         FileUpload3.SaveAs(Server.MapPath("/profilepics/") + FileUpload3.FileName);
         image[3] = "~/profilepics/" + FileUpload3.FileName;
         count++;
     }
     else
     {
         image[3] = "";
     }
     if (FileUpload4.HasFile)
     {
         FileUpload4.SaveAs(Server.MapPath("/profilepics/") + FileUpload4.FileName);
         image[4] = "~/profilepics/" + FileUpload4.FileName;
         count++;
     }
     else
     {
         image[4] = "";
     }
     if (FileUpload5.HasFile)
     {
         FileUpload5.SaveAs(Server.MapPath("/profilepics/") + FileUpload5.FileName);
         image[5] = "~/profilepics/" + FileUpload5.FileName;
         count++;
     }
     else
     {
         image[5] = "";
     }
     if (FileUpload6.HasFile)
     {
         FileUpload6.SaveAs(Server.MapPath("/profilepics/") + FileUpload6.FileName);
         image[6] = "~/profilepics/" + FileUpload6.FileName;
         count++;
     }
     else
     {
         image[6] = "";
     }
     if (FileUpload7.HasFile)
     {
         FileUpload7.SaveAs(Server.MapPath("/profilepics/") + FileUpload7.FileName);
         image[7] = "~/profilepics/" + FileUpload7.FileName;
         count++;
     }
     else
     {
         image[7] = "";
     }
     if (FileUpload8.HasFile)
     {
         FileUpload8.SaveAs(Server.MapPath("/profilepics/") + FileUpload8.FileName);
         image[8] = "~/profilepics/" + FileUpload8.FileName;
         count++;
     }
     else
     {
         image[8] = "";
     }
     if (FileUpload9.HasFile)
     {
         FileUpload9.SaveAs(Server.MapPath("/profilepics/") + FileUpload9.FileName);
         image[9] = "~/profilepics/" + FileUpload9.FileName;
         count++;
     }
     else
     {
         image[9] = "";
     }
     if (FileUpload10.HasFile)
     {
         FileUpload10.SaveAs(Server.MapPath("/profilepics/") + FileUpload10.FileName);
         image[10] = "~/profilepics/" + FileUpload10.FileName;
         count++;
     }
     else
     {
         image[10] = "";
     }
 }
Exemple #9
0
        protected void SaveInfo()
        {
            DateTime DateRange      = new DateTime();
            DateTime DateExpiration = new DateTime();

            if (txtDateRange.Text != "")
            {
                DateRange = DateTime.ParseExact(txtDateRange.Text, "dd/MM/yyyy", null);
            }
            if (txtDateExpiration.Text != "")
            {
                DateExpiration = DateTime.ParseExact(txtDateExpiration.Text, "dd/MM/yyyy", null);
            }
            Cooperative_Info cop = new Cooperative_Info();

            cop.Cooperative_Key    = Convert.ToInt32(lbkey.Text);
            cop.Cooperative_ID     = txtCooperative_ID.Text;
            cop.Cooperative_Name   = txtCooperative_Name.Text;
            cop.ProvincesCities_ID = ddProvincesCitiesID.SelectedValue;
            cop.Address            = txtAddress.Text;
            cop.VietGAPCode        = txtVietGAPCode.Text;
            cop.Phone                 = txtPhone.Text;
            cop.Members               = Convert.ToInt32(txtMembers.Text);
            cop.Area                  = Convert.ToInt32(txtArea.Text);
            cop.Quantity              = Convert.ToInt32(txtQuantity.Text);
            cop.TreeType              = txtTreeType.Text;
            cop.DateRange             = DateRange;
            cop.DateExpiration        = DateExpiration;
            cop.Owner                 = txtOwner.Text;
            cop.Description           = txtDescription.Text;
            cop.CertifiedOrganization = ddCertifiedOrganization.SelectedValue;
            string[] arrListStr = txtlat.Text.Split(',');
            cop.Lat    = arrListStr[0];
            cop.Lng    = arrListStr[1];
            cop.Images = ddImage.SelectedValue;
            if (FileUploadControl.HasFile)
            {
                try
                {
                    string filename = Path.GetFileName(FileUploadControl.FileName);
                    FileUploadControl.SaveAs(Server.MapPath("~/Img/Tree/") + filename);
                    cop.Images = filename;
                }
                catch (Exception ex) {}
            }
            cop.Save();
            Cooperative_Image_Info cooImg = new Cooperative_Image_Info();

            if (FileUpload1.HasFile)
            {
                try{
                    string Name = lbkey.Text + "_1";
                    Cooperative_Image_Info cooImgName = new Cooperative_Image_Info(Name);
                    cooImg.Cooperative_Image_Key = cooImgName.Cooperative_Image_Key;
                    cooImg.Name            = Name;
                    cooImg.Cooperative_Key = Convert.ToInt32(lbkey.Text);
                    cooImg.DateTime        = DateTime.Now;
                    cooImg.Description     = txtCooperative_Name.Text;
                    string filename = lbkey.Text + "_img1.png";
                    FileUpload1.SaveAs(Server.MapPath("~/Img/coop/") + filename);
                    cooImg.Images = "../Img/coop/" + filename;
                    cooImg.Save();
                }catch (Exception ex) { }
            }
            if (FileUpload2.HasFile)
            {
                try
                {
                    string Name = lbkey.Text + "_2";
                    Cooperative_Image_Info cooImgName = new Cooperative_Image_Info(Name);
                    cooImg.Cooperative_Image_Key = cooImgName.Cooperative_Image_Key;
                    cooImg.Name            = Name;
                    cooImg.Cooperative_Key = Convert.ToInt32(lbkey.Text);
                    cooImg.DateTime        = DateTime.Now;
                    cooImg.Description     = txtCooperative_Name.Text;
                    string filename = lbkey.Text + "_img2.png";
                    FileUpload2.SaveAs(Server.MapPath("~/Img/coop/") + filename);
                    cooImg.Images = "../Img/coop/" + filename;
                    cooImg.Save();
                }
                catch (Exception ex) { }
            }
            if (FileUpload3.HasFile)
            {
                try
                {
                    string Name = lbkey.Text + "_3";
                    Cooperative_Image_Info cooImgName = new Cooperative_Image_Info(Name);
                    cooImg.Cooperative_Image_Key = cooImgName.Cooperative_Image_Key;
                    cooImg.Name            = Name;
                    cooImg.Cooperative_Key = Convert.ToInt32(lbkey.Text);
                    cooImg.DateTime        = DateTime.Now;
                    cooImg.Description     = txtCooperative_Name.Text;
                    string filename = lbkey.Text + "_img3.png";
                    FileUpload3.SaveAs(Server.MapPath("~/Img/coop/") + filename);
                    cooImg.Images = "../Img/coop/" + filename;
                    cooImg.Save();
                }
                catch (Exception ex) { }
            }
            if (FileUpload4.HasFile)
            {
                try
                {
                    string Name = lbkey.Text + "_4";
                    Cooperative_Image_Info cooImgName = new Cooperative_Image_Info(Name);
                    cooImg.Cooperative_Image_Key = cooImgName.Cooperative_Image_Key;
                    cooImg.Name            = Name;
                    cooImg.Cooperative_Key = Convert.ToInt32(lbkey.Text);
                    cooImg.DateTime        = DateTime.Now;
                    cooImg.Description     = txtCooperative_Name.Text;
                    string filename = lbkey.Text + "_img4.png";
                    FileUpload4.SaveAs(Server.MapPath("~/Img/coop/") + filename);
                    cooImg.Images = "../Img/coop/" + filename;
                    cooImg.Save();
                }
                catch (Exception ex) { }
            }
            if (FileUpload5.HasFile)
            {
                try
                {
                    string Name = lbkey.Text + "_5";
                    Cooperative_Image_Info cooImgName = new Cooperative_Image_Info(Name);
                    cooImg.Cooperative_Image_Key = cooImgName.Cooperative_Image_Key;
                    cooImg.Name            = Name;
                    cooImg.Cooperative_Key = Convert.ToInt32(lbkey.Text);
                    cooImg.DateTime        = DateTime.Now;
                    cooImg.Description     = txtCooperative_Name.Text;
                    string filename = lbkey.Text + "_img5.png";
                    FileUpload5.SaveAs(Server.MapPath("~/Img/coop/") + filename);
                    cooImg.Images = "../Img/coop/" + filename;
                    cooImg.Save();
                }
                catch (Exception ex) { }
            }
            if (FileUpload6.HasFile)
            {
                try
                {
                    string Name = lbkey.Text + "_6";
                    Cooperative_Image_Info cooImgName = new Cooperative_Image_Info(Name);
                    cooImg.Cooperative_Image_Key = cooImgName.Cooperative_Image_Key;
                    cooImg.Name            = Name;
                    cooImg.Cooperative_Key = Convert.ToInt32(lbkey.Text);
                    cooImg.DateTime        = DateTime.Now;
                    cooImg.Description     = txtCooperative_Name.Text;
                    string filename = lbkey.Text + "_img6.png";
                    FileUpload6.SaveAs(Server.MapPath("~/Img/coop/") + filename);
                    cooImg.Images = "../Img/coop/" + filename;
                    cooImg.Save();
                }
                catch (Exception ex) { }
            }
            if (FileUpload7.HasFile)
            {
                try
                {
                    string Name = lbkey.Text + "_7";
                    Cooperative_Image_Info cooImgName = new Cooperative_Image_Info(Name);
                    cooImg.Cooperative_Image_Key = cooImgName.Cooperative_Image_Key;
                    cooImg.Name            = Name;
                    cooImg.Cooperative_Key = Convert.ToInt32(lbkey.Text);
                    cooImg.DateTime        = DateTime.Now;
                    cooImg.Description     = txtCooperative_Name.Text;
                    string filename = lbkey.Text + "_img7.png";
                    FileUpload7.SaveAs(Server.MapPath("~/Img/coop/") + filename);
                    cooImg.Images = "../Img/coop/" + filename;
                    cooImg.Save();
                }
                catch (Exception ex) { }
            }
            if (FileUpload8.HasFile)
            {
                try
                {
                    string Name = lbkey.Text + "_8";
                    Cooperative_Image_Info cooImgName = new Cooperative_Image_Info(Name);
                    cooImg.Cooperative_Image_Key = cooImgName.Cooperative_Image_Key;
                    cooImg.Name            = Name;
                    cooImg.Cooperative_Key = Convert.ToInt32(lbkey.Text);
                    cooImg.DateTime        = DateTime.Now;
                    cooImg.Description     = txtCooperative_Name.Text;
                    string filename = lbkey.Text + "_img8.png";
                    FileUpload8.SaveAs(Server.MapPath("~/Img/coop/") + filename);
                    cooImg.Images = "../Img/coop/" + filename;
                    cooImg.Save();
                }
                catch (Exception ex) { }
            }
            if (FileUpload9.HasFile)
            {
                try
                {
                    string Name = lbkey.Text + "_9";
                    Cooperative_Image_Info cooImgName = new Cooperative_Image_Info(Name);
                    cooImg.Cooperative_Image_Key = cooImgName.Cooperative_Image_Key;
                    cooImg.Name            = Name;
                    cooImg.Cooperative_Key = Convert.ToInt32(lbkey.Text);
                    cooImg.DateTime        = DateTime.Now;
                    cooImg.Description     = txtCooperative_Name.Text;
                    string filename = lbkey.Text + "_img9.png";
                    FileUpload9.SaveAs(Server.MapPath("~/Img/coop/") + filename);
                    cooImg.Images = "../Img/coop/" + filename;
                    cooImg.Save();
                }
                catch (Exception ex) { }
            }
            if (FileUpload10.HasFile)
            {
                try
                {
                    string Name = lbkey.Text + "_10";
                    Cooperative_Image_Info cooImgName = new Cooperative_Image_Info(Name);
                    cooImg.Cooperative_Image_Key = cooImgName.Cooperative_Image_Key;
                    cooImg.Name            = Name;
                    cooImg.Cooperative_Key = Convert.ToInt32(lbkey.Text);
                    cooImg.DateTime        = DateTime.Now;
                    cooImg.Description     = txtCooperative_Name.Text;
                    string filename = lbkey.Text + "_img10.png";
                    FileUpload10.SaveAs(Server.MapPath("~/Img/coop/") + filename);
                    cooImg.Images = "../Img/coop/" + filename;
                    cooImg.Save();
                }
                catch (Exception ex) { }
            }
        }
    protected void Button7_Click(object sender, EventArgs e)
    {
        try
        {
            if (FileUpload1.HasFile || FileUpload2.HasFile || FileUpload3.HasFile || FileUpload4.HasFile || FileUpload5.HasFile || FileUpload6.HasFile || FileUpload7.HasFile || FileUpload8.HasFile || FileUpload9.HasFile || FileUpload10.HasFile || FileUpload11.HasFile || FileUpload12.HasFile || FileUpload13.HasFile || FileUpload14.HasFile || FileUpload15.HasFile || FileUpload16.HasFile || FileUpload17.HasFile || FileUpload18.HasFile || FileUpload19.HasFile || FileUpload20.HasFile || FileUpload21.HasFile || FileUpload22.HasFile || FileUpload23.HasFile || FileUpload24.HasFile || FileUpload25.HasFile || FileUpload26.HasFile || FileUpload27.HasFile || FileUpload28.HasFile || FileUpload29.HasFile || FileUpload30.HasFile || FileUpload31.HasFile || FileUpload32.HasFile || FileUpload33.HasFile || FileUpload34.HasFile || FileUpload35.HasFile || FileUpload36.HasFile || FileUpload37.HasFile || FileUpload38.HasFile || FileUpload39.HasFile)
            {
                string path = Server.MapPath("Images/");

                //HOME
                if (FileUpload1.HasFile)
                {
                    string ext = Path.GetExtension(FileUpload1.FileName);
                    if (ext == ".jpg" || ext == ".png")
                    {
                        FileUpload1.SaveAs(path + FileUpload1.FileName);
                        string name = "Images/" + FileUpload1.FileName;
                        string ss   = "update slider set image1='" + name + "' where id=14";

                        con.Open();
                        cmd = new SqlCommand(ss, con);
                        cmd.ExecuteNonQuery();
                        con.Close();
                    }
                }

                if (FileUpload2.HasFile)
                {
                    string ext = Path.GetExtension(FileUpload2.FileName);
                    if (ext == ".jpg" || ext == ".png")
                    {
                        FileUpload2.SaveAs(path + FileUpload2.FileName);
                        string name = "Images/" + FileUpload2.FileName;
                        string ss   = "update slider set image2='" + name + "' where id=14";

                        con.Open();
                        cmd = new SqlCommand(ss, con);
                        cmd.ExecuteNonQuery();
                        con.Close();
                    }
                }

                if (FileUpload3.HasFile)
                {
                    string ext = Path.GetExtension(FileUpload3.FileName);
                    if (ext == ".jpg" || ext == ".png")
                    {
                        FileUpload3.SaveAs(path + FileUpload3.FileName);
                        string name = "Images/" + FileUpload3.FileName;
                        string ss   = "update slider set image3='" + name + "' where id=14";

                        con.Open();
                        cmd = new SqlCommand(ss, con);
                        cmd.ExecuteNonQuery();
                        con.Close();
                    }
                }

                //BUY FLAT
                if (FileUpload4.HasFile)
                {
                    string ext = Path.GetExtension(FileUpload4.FileName);
                    if (ext == ".jpg" || ext == ".png")
                    {
                        FileUpload4.SaveAs(path + FileUpload4.FileName);
                        string name = "Images/" + FileUpload4.FileName;
                        string ss   = "update slider set image1='" + name + "' where id=1";

                        con.Open();
                        cmd = new SqlCommand(ss, con);
                        cmd.ExecuteNonQuery();
                        con.Close();
                    }
                }

                if (FileUpload5.HasFile)
                {
                    string ext = Path.GetExtension(FileUpload5.FileName);
                    if (ext == ".jpg" || ext == ".png")
                    {
                        FileUpload5.SaveAs(path + FileUpload5.FileName);
                        string name = "Images/" + FileUpload5.FileName;
                        string ss   = "update slider set image2='" + name + "' where id=1";

                        con.Open();
                        cmd = new SqlCommand(ss, con);
                        cmd.ExecuteNonQuery();
                        con.Close();
                    }
                }

                if (FileUpload6.HasFile)
                {
                    string ext = Path.GetExtension(FileUpload6.FileName);
                    if (ext == ".jpg" || ext == ".png")
                    {
                        FileUpload6.SaveAs(path + FileUpload6.FileName);
                        string name = "Images/" + FileUpload6.FileName;
                        string ss   = "update slider set image3='" + name + "' where id=1";

                        con.Open();
                        cmd = new SqlCommand(ss, con);
                        cmd.ExecuteNonQuery();
                        con.Close();
                    }
                }

                //BUY HOUSE
                if (FileUpload7.HasFile)
                {
                    string ext = Path.GetExtension(FileUpload7.FileName);
                    if (ext == ".jpg" || ext == ".png")
                    {
                        FileUpload7.SaveAs(path + FileUpload7.FileName);
                        string name = "Images/" + FileUpload7.FileName;
                        string ss   = "update slider set image1='" + name + "' where id=2";

                        con.Open();
                        cmd = new SqlCommand(ss, con);
                        cmd.ExecuteNonQuery();
                        con.Close();
                    }
                }

                if (FileUpload8.HasFile)
                {
                    string ext = Path.GetExtension(FileUpload8.FileName);
                    if (ext == ".jpg" || ext == ".png")
                    {
                        FileUpload8.SaveAs(path + FileUpload8.FileName);
                        string name = "Images/" + FileUpload8.FileName;
                        string ss   = "update slider set image2='" + name + "' where id=2";

                        con.Open();
                        cmd = new SqlCommand(ss, con);
                        cmd.ExecuteNonQuery();
                        con.Close();
                    }
                }

                if (FileUpload9.HasFile)
                {
                    string ext = Path.GetExtension(FileUpload9.FileName);
                    if (ext == ".jpg" || ext == ".png")
                    {
                        FileUpload9.SaveAs(path + FileUpload9.FileName);
                        string name = "Images/" + FileUpload9.FileName;
                        string ss   = "update slider set image3='" + name + "' where id=2";

                        con.Open();
                        cmd = new SqlCommand(ss, con);
                        cmd.ExecuteNonQuery();
                        con.Close();
                    }
                }

                //BUY VILLA
                if (FileUpload10.HasFile)
                {
                    string ext = Path.GetExtension(FileUpload10.FileName);
                    if (ext == ".jpg" || ext == ".png")
                    {
                        FileUpload10.SaveAs(path + FileUpload10.FileName);
                        string name = "Images/" + FileUpload10.FileName;
                        string ss   = "update slider set image1='" + name + "' where id=3";

                        con.Open();
                        cmd = new SqlCommand(ss, con);
                        cmd.ExecuteNonQuery();
                        con.Close();
                    }
                }

                if (FileUpload11.HasFile)
                {
                    string ext = Path.GetExtension(FileUpload11.FileName);
                    if (ext == ".jpg" || ext == ".png")
                    {
                        FileUpload11.SaveAs(path + FileUpload11.FileName);
                        string name = "Images/" + FileUpload11.FileName;
                        string ss   = "update slider set image2='" + name + "' where id=3";

                        con.Open();
                        cmd = new SqlCommand(ss, con);
                        cmd.ExecuteNonQuery();
                        con.Close();
                    }
                }

                if (FileUpload12.HasFile)
                {
                    string ext = Path.GetExtension(FileUpload12.FileName);
                    if (ext == ".jpg" || ext == ".png")
                    {
                        FileUpload12.SaveAs(path + FileUpload12.FileName);
                        string name = "Images/" + FileUpload12.FileName;
                        string ss   = "update slider set image3='" + name + "' where id=3";

                        con.Open();
                        cmd = new SqlCommand(ss, con);
                        cmd.ExecuteNonQuery();
                        con.Close();
                    }
                }

                //BUY LUXURY HOUSE
                if (FileUpload13.HasFile)
                {
                    string ext = Path.GetExtension(FileUpload13.FileName);
                    if (ext == ".jpg" || ext == ".png")
                    {
                        FileUpload13.SaveAs(path + FileUpload13.FileName);
                        string name = "Images/" + FileUpload13.FileName;
                        string ss   = "update slider set image1='" + name + "' where id=5";

                        con.Open();
                        cmd = new SqlCommand(ss, con);
                        cmd.ExecuteNonQuery();
                        con.Close();
                    }
                }

                if (FileUpload14.HasFile)
                {
                    string ext = Path.GetExtension(FileUpload14.FileName);
                    if (ext == ".jpg" || ext == ".png")
                    {
                        FileUpload14.SaveAs(path + FileUpload14.FileName);
                        string name = "Images/" + FileUpload14.FileName;
                        string ss   = "update slider set image2='" + name + "' where id=5";

                        con.Open();
                        cmd = new SqlCommand(ss, con);
                        cmd.ExecuteNonQuery();
                        con.Close();
                    }
                }

                if (FileUpload15.HasFile)
                {
                    string ext = Path.GetExtension(FileUpload15.FileName);
                    if (ext == ".jpg" || ext == ".png")
                    {
                        FileUpload15.SaveAs(path + FileUpload15.FileName);
                        string name = "Images/" + FileUpload15.FileName;
                        string ss   = "update slider set image3='" + name + "' where id=5";

                        con.Open();
                        cmd = new SqlCommand(ss, con);
                        cmd.ExecuteNonQuery();
                        con.Close();
                    }
                }

                //BUY BUDGET DEAL
                if (FileUpload16.HasFile)
                {
                    string ext = Path.GetExtension(FileUpload16.FileName);
                    if (ext == ".jpg" || ext == ".png")
                    {
                        FileUpload16.SaveAs(path + FileUpload16.FileName);
                        string name = "Images/" + FileUpload16.FileName;
                        string ss   = "update slider set image1='" + name + "' where id=6";

                        con.Open();
                        cmd = new SqlCommand(ss, con);
                        cmd.ExecuteNonQuery();
                        con.Close();
                    }
                }

                if (FileUpload17.HasFile)
                {
                    string ext = Path.GetExtension(FileUpload17.FileName);
                    if (ext == ".jpg" || ext == ".png")
                    {
                        FileUpload17.SaveAs(path + FileUpload17.FileName);
                        string name = "Images/" + FileUpload17.FileName;
                        string ss   = "update slider set image2='" + name + "' where id=6";

                        con.Open();
                        cmd = new SqlCommand(ss, con);
                        cmd.ExecuteNonQuery();
                        con.Close();
                    }
                }

                if (FileUpload18.HasFile)
                {
                    string ext = Path.GetExtension(FileUpload18.FileName);
                    if (ext == ".jpg" || ext == ".png")
                    {
                        FileUpload18.SaveAs(path + FileUpload18.FileName);
                        string name = "Images/" + FileUpload18.FileName;
                        string ss   = "update slider set image3='" + name + "' where id=6";

                        con.Open();
                        cmd = new SqlCommand(ss, con);
                        cmd.ExecuteNonQuery();
                        con.Close();
                    }
                }

                //RENT FLAT
                if (FileUpload19.HasFile)
                {
                    string ext = Path.GetExtension(FileUpload19.FileName);
                    if (ext == ".jpg" || ext == ".png")
                    {
                        FileUpload19.SaveAs(path + FileUpload19.FileName);
                        string name = "Images/" + FileUpload19.FileName;
                        string ss   = "update slider set image1='" + name + "' where id=7";

                        con.Open();
                        cmd = new SqlCommand(ss, con);
                        cmd.ExecuteNonQuery();
                        con.Close();
                    }
                }

                if (FileUpload20.HasFile)
                {
                    string ext = Path.GetExtension(FileUpload20.FileName);
                    if (ext == ".jpg" || ext == ".png")
                    {
                        FileUpload20.SaveAs(path + FileUpload20.FileName);
                        string name = "Images/" + FileUpload20.FileName;
                        string ss   = "update slider set image2='" + name + "' where id=7";

                        con.Open();
                        cmd = new SqlCommand(ss, con);
                        cmd.ExecuteNonQuery();
                        con.Close();
                    }
                }

                if (FileUpload21.HasFile)
                {
                    string ext = Path.GetExtension(FileUpload21.FileName);
                    if (ext == ".jpg" || ext == ".png")
                    {
                        FileUpload21.SaveAs(path + FileUpload21.FileName);
                        string name = "Images/" + FileUpload21.FileName;
                        string ss   = "update slider set image3='" + name + "' where id=7";

                        con.Open();
                        cmd = new SqlCommand(ss, con);
                        cmd.ExecuteNonQuery();
                        con.Close();
                    }
                }

                //RENT HOUSE
                if (FileUpload22.HasFile)
                {
                    string ext = Path.GetExtension(FileUpload22.FileName);
                    if (ext == ".jpg" || ext == ".png")
                    {
                        FileUpload22.SaveAs(path + FileUpload22.FileName);
                        string name = "Images/" + FileUpload22.FileName;
                        string ss   = "update slider set image1='" + name + "' where id=8";

                        con.Open();
                        cmd = new SqlCommand(ss, con);
                        cmd.ExecuteNonQuery();
                        con.Close();
                    }
                }

                if (FileUpload23.HasFile)
                {
                    string ext = Path.GetExtension(FileUpload23.FileName);
                    if (ext == ".jpg" || ext == ".png")
                    {
                        FileUpload23.SaveAs(path + FileUpload23.FileName);
                        string name = "Images/" + FileUpload23.FileName;
                        string ss   = "update slider set image2='" + name + "' where id=8";

                        con.Open();
                        cmd = new SqlCommand(ss, con);
                        cmd.ExecuteNonQuery();
                        con.Close();
                    }
                }

                if (FileUpload24.HasFile)
                {
                    string ext = Path.GetExtension(FileUpload24.FileName);
                    if (ext == ".jpg" || ext == ".png")
                    {
                        FileUpload24.SaveAs(path + FileUpload24.FileName);
                        string name = "Images/" + FileUpload24.FileName;
                        string ss   = "update slider set image3='" + name + "' where id=8";

                        con.Open();
                        cmd = new SqlCommand(ss, con);
                        cmd.ExecuteNonQuery();
                        con.Close();
                    }
                }

                //RENT VILLA
                if (FileUpload25.HasFile)
                {
                    string ext = Path.GetExtension(FileUpload25.FileName);
                    if (ext == ".jpg" || ext == ".png")
                    {
                        FileUpload25.SaveAs(path + FileUpload25.FileName);
                        string name = "Images/" + FileUpload25.FileName;
                        string ss   = "update slider set image1='" + name + "' where id=9";

                        con.Open();
                        cmd = new SqlCommand(ss, con);
                        cmd.ExecuteNonQuery();
                        con.Close();
                    }
                }

                if (FileUpload26.HasFile)
                {
                    string ext = Path.GetExtension(FileUpload26.FileName);
                    if (ext == ".jpg" || ext == ".png")
                    {
                        FileUpload26.SaveAs(path + FileUpload26.FileName);
                        string name = "Images/" + FileUpload26.FileName;
                        string ss   = "update slider set image2='" + name + "' where id=9";

                        con.Open();
                        cmd = new SqlCommand(ss, con);
                        cmd.ExecuteNonQuery();
                        con.Close();
                    }
                }

                if (FileUpload27.HasFile)
                {
                    string ext = Path.GetExtension(FileUpload27.FileName);
                    if (ext == ".jpg" || ext == ".png")
                    {
                        FileUpload27.SaveAs(path + FileUpload27.FileName);
                        string name = "Images/" + FileUpload27.FileName;
                        string ss   = "update slider set image3='" + name + "' where id=9";

                        con.Open();
                        cmd = new SqlCommand(ss, con);
                        cmd.ExecuteNonQuery();
                        con.Close();
                    }
                }

                //RENT BACHELOR FRIENDLY
                if (FileUpload28.HasFile)
                {
                    string ext = Path.GetExtension(FileUpload28.FileName);
                    if (ext == ".jpg" || ext == ".png")
                    {
                        FileUpload28.SaveAs(path + FileUpload28.FileName);
                        string name = "Images/" + FileUpload28.FileName;
                        string ss   = "update slider set image1='" + name + "' where id=10";

                        con.Open();
                        cmd = new SqlCommand(ss, con);
                        cmd.ExecuteNonQuery();
                        con.Close();
                    }
                }

                if (FileUpload29.HasFile)
                {
                    string ext = Path.GetExtension(FileUpload29.FileName);
                    if (ext == ".jpg" || ext == ".png")
                    {
                        FileUpload29.SaveAs(path + FileUpload29.FileName);
                        string name = "Images/" + FileUpload29.FileName;
                        string ss   = "update slider set image2='" + name + "' where id=10";

                        con.Open();
                        cmd = new SqlCommand(ss, con);
                        cmd.ExecuteNonQuery();
                        con.Close();
                    }
                }

                if (FileUpload30.HasFile)
                {
                    string ext = Path.GetExtension(FileUpload30.FileName);
                    if (ext == ".jpg" || ext == ".png")
                    {
                        FileUpload30.SaveAs(path + FileUpload30.FileName);
                        string name = "Images/" + FileUpload30.FileName;
                        string ss   = "update slider set image3='" + name + "' where id=10";

                        con.Open();
                        cmd = new SqlCommand(ss, con);
                        cmd.ExecuteNonQuery();
                        con.Close();
                    }
                }

                //RENT BUDGET DEAL
                if (FileUpload31.HasFile)
                {
                    string ext = Path.GetExtension(FileUpload31.FileName);
                    if (ext == ".jpg" || ext == ".png")
                    {
                        FileUpload31.SaveAs(path + FileUpload31.FileName);
                        string name = "Images/" + FileUpload31.FileName;
                        string ss   = "update slider set image1='" + name + "' where id=11";

                        con.Open();
                        cmd = new SqlCommand(ss, con);
                        cmd.ExecuteNonQuery();
                        con.Close();
                    }
                }

                if (FileUpload32.HasFile)
                {
                    string ext = Path.GetExtension(FileUpload32.FileName);
                    if (ext == ".jpg" || ext == ".png")
                    {
                        FileUpload32.SaveAs(path + FileUpload32.FileName);
                        string name = "Images/" + FileUpload32.FileName;
                        string ss   = "update slider set image2='" + name + "' where id=11";

                        con.Open();
                        cmd = new SqlCommand(ss, con);
                        cmd.ExecuteNonQuery();
                        con.Close();
                    }
                }

                if (FileUpload33.HasFile)
                {
                    string ext = Path.GetExtension(FileUpload33.FileName);
                    if (ext == ".jpg" || ext == ".png")
                    {
                        FileUpload33.SaveAs(path + FileUpload33.FileName);
                        string name = "Images/" + FileUpload33.FileName;
                        string ss   = "update slider set image3='" + name + "' where id=11";

                        con.Open();
                        cmd = new SqlCommand(ss, con);
                        cmd.ExecuteNonQuery();
                        con.Close();
                    }
                }

                //OFFICE SPACE
                if (FileUpload34.HasFile)
                {
                    string ext = Path.GetExtension(FileUpload34.FileName);
                    if (ext == ".jpg" || ext == ".png")
                    {
                        FileUpload34.SaveAs(path + FileUpload34.FileName);
                        string name = "Images/" + FileUpload34.FileName;
                        string ss   = "update slider set image1='" + name + "' where id=11";

                        con.Open();
                        cmd = new SqlCommand(ss, con);
                        cmd.ExecuteNonQuery();
                        con.Close();
                    }
                }

                if (FileUpload35.HasFile)
                {
                    string ext = Path.GetExtension(FileUpload35.FileName);
                    if (ext == ".jpg" || ext == ".png")
                    {
                        FileUpload35.SaveAs(path + FileUpload35.FileName);
                        string name = "Images/" + FileUpload35.FileName;
                        string ss   = "update slider set image2='" + name + "' where id=12";

                        con.Open();
                        cmd = new SqlCommand(ss, con);
                        cmd.ExecuteNonQuery();
                        con.Close();
                    }
                }

                if (FileUpload36.HasFile)
                {
                    string ext = Path.GetExtension(FileUpload36.FileName);
                    if (ext == ".jpg" || ext == ".png")
                    {
                        FileUpload36.SaveAs(path + FileUpload36.FileName);
                        string name = "Images/" + FileUpload36.FileName;
                        string ss   = "update slider set image3='" + name + "' where id=12";

                        con.Open();
                        cmd = new SqlCommand(ss, con);
                        cmd.ExecuteNonQuery();
                        con.Close();
                    }
                }

                //BHK FLAT
                if (FileUpload37.HasFile)
                {
                    string ext = Path.GetExtension(FileUpload37.FileName);
                    if (ext == ".jpg" || ext == ".png")
                    {
                        FileUpload37.SaveAs(path + FileUpload37.FileName);
                        string name = "Images/" + FileUpload37.FileName;
                        string ss   = "update slider set image1='" + name + "' where id=13";

                        con.Open();
                        cmd = new SqlCommand(ss, con);
                        cmd.ExecuteNonQuery();
                        con.Close();
                    }
                }

                if (FileUpload38.HasFile)
                {
                    string ext = Path.GetExtension(FileUpload38.FileName);
                    if (ext == ".jpg" || ext == ".png")
                    {
                        FileUpload38.SaveAs(path + FileUpload38.FileName);
                        string name = "Images/" + FileUpload38.FileName;
                        string ss   = "update slider set image2='" + name + "' where id=13";

                        con.Open();
                        cmd = new SqlCommand(ss, con);
                        cmd.ExecuteNonQuery();
                        con.Close();
                    }
                }

                if (FileUpload39.HasFile)
                {
                    string ext = Path.GetExtension(FileUpload39.FileName);
                    if (ext == ".jpg" || ext == ".png")
                    {
                        FileUpload39.SaveAs(path + FileUpload39.FileName);
                        string name = "Images/" + FileUpload39.FileName;
                        string ss   = "update slider set image3='" + name + "' where id=13";

                        con.Open();
                        cmd = new SqlCommand(ss, con);
                        cmd.ExecuteNonQuery();
                        con.Close();
                    }
                }

                count++;
                Response.Redirect("adminpanel-slider.aspx");
            }
            else
            {
                a++;
                Response.Redirect("adminpanel-slider.aspx");
            }
        }

        catch (Exception)
        {
            Label2.Visible = true;
        }
    }
Exemple #11
0
    protected void Button7_Click(object sender, EventArgs e)
    {
        try{
            if (FileUpload1.HasFile || FileUpload2.HasFile || FileUpload3.HasFile || FileUpload4.HasFile || FileUpload5.HasFile || FileUpload6.HasFile || FileUpload7.HasFile || FileUpload8.HasFile || FileUpload9.HasFile || FileUpload10.HasFile)
            {
                string path = Server.MapPath("Images/");

                //first
                if (FileUpload1.HasFile)
                {
                    string ext = Path.GetExtension(FileUpload1.FileName);
                    if (ext == ".jpg" || ext == ".png")
                    {
                        FileUpload1.SaveAs(path + FileUpload1.FileName);
                        string name = "Images/" + FileUpload1.FileName;
                        string ss   = "update user_review set image='" + name + "', name='" + TextBox1.Text + "',city='" + TextBox2.Text + "',contentt='" + TextBox3.Text + "' where id=1";

                        con.Open();
                        cmd = new SqlCommand(ss, con);
                        cmd.ExecuteNonQuery();
                        con.Close();
                    }
                }

                //second
                if (FileUpload2.HasFile)
                {
                    string ext = Path.GetExtension(FileUpload2.FileName);
                    if (ext == ".jpg" || ext == ".png")
                    {
                        FileUpload2.SaveAs(path + FileUpload2.FileName);
                        string name = "Images/" + FileUpload2.FileName;
                        string ss   = "update user_review set image='" + name + "', name='" + TextBox4.Text + "',city='" + TextBox5.Text + "',contentt='" + TextBox6.Text + "' where id=2";

                        con.Open();
                        cmd = new SqlCommand(ss, con);
                        cmd.ExecuteNonQuery();
                        con.Close();
                    }
                }

                //third
                if (FileUpload3.HasFile)
                {
                    string ext = Path.GetExtension(FileUpload3.FileName);
                    if (ext == ".jpg" || ext == ".png")
                    {
                        FileUpload3.SaveAs(path + FileUpload3.FileName);
                        string name = "Images/" + FileUpload3.FileName;
                        string ss   = "update user_review set image='" + name + "', name='" + TextBox7.Text + "',city='" + TextBox8.Text + "',contentt='" + TextBox9.Text + "' where id=3";

                        con.Open();
                        cmd = new SqlCommand(ss, con);
                        cmd.ExecuteNonQuery();
                        con.Close();
                    }
                }

                //forth
                if (FileUpload4.HasFile)
                {
                    string ext = Path.GetExtension(FileUpload4.FileName);
                    if (ext == ".jpg" || ext == ".png")
                    {
                        FileUpload4.SaveAs(path + FileUpload4.FileName);
                        string name = "Images/" + FileUpload4.FileName;
                        string ss   = "update user_review set image='" + name + "', name='" + TextBox10.Text + "',city='" + TextBox11.Text + "',contentt='" + TextBox12.Text + "' where id=4";

                        con.Open();
                        cmd = new SqlCommand(ss, con);
                        cmd.ExecuteNonQuery();
                        con.Close();
                    }
                }

                //fifth
                if (FileUpload5.HasFile)
                {
                    string ext = Path.GetExtension(FileUpload5.FileName);
                    if (ext == ".jpg" || ext == ".png")
                    {
                        FileUpload5.SaveAs(path + FileUpload5.FileName);
                        string name = "Images/" + FileUpload5.FileName;
                        string ss   = "update user_review set image='" + name + "', name='" + TextBox13.Text + "',city='" + TextBox14.Text + "',contentt='" + TextBox15.Text + "' where id=5";

                        con.Open();
                        cmd = new SqlCommand(ss, con);
                        cmd.ExecuteNonQuery();
                        con.Close();
                    }
                }

                //sixth
                if (FileUpload6.HasFile)
                {
                    string ext = Path.GetExtension(FileUpload6.FileName);
                    if (ext == ".jpg" || ext == ".png")
                    {
                        FileUpload6.SaveAs(path + FileUpload6.FileName);
                        string name = "Images/" + FileUpload6.FileName;
                        string ss   = "update user_review set image='" + name + "', name='" + TextBox16.Text + "',city='" + TextBox17.Text + "',contentt='" + TextBox18.Text + "' where id=6";

                        con.Open();
                        cmd = new SqlCommand(ss, con);
                        cmd.ExecuteNonQuery();
                        con.Close();
                    }
                }

                //first
                if (FileUpload7.HasFile)
                {
                    string ext = Path.GetExtension(FileUpload7.FileName);
                    if (ext == ".jpg" || ext == ".png")
                    {
                        FileUpload7.SaveAs(path + FileUpload7.FileName);
                        string name = "Images/" + FileUpload7.FileName;
                        string ss   = "update user_review set image='" + name + "', name='" + TextBox19.Text + "',city='" + TextBox20.Text + "',contentt='" + TextBox21.Text + "' where id=7";

                        con.Open();
                        cmd = new SqlCommand(ss, con);
                        cmd.ExecuteNonQuery();
                        con.Close();
                    }
                }

                //eighth
                if (FileUpload8.HasFile)
                {
                    string ext = Path.GetExtension(FileUpload8.FileName);
                    if (ext == ".jpg" || ext == ".png")
                    {
                        FileUpload8.SaveAs(path + FileUpload8.FileName);
                        string name = "Images/" + FileUpload8.FileName;
                        string ss   = "update user_review set image='" + name + "', name='" + TextBox22.Text + "',city='" + TextBox23.Text + "',contentt='" + TextBox24.Text + "' where id=8";

                        con.Open();
                        cmd = new SqlCommand(ss, con);
                        cmd.ExecuteNonQuery();
                        con.Close();
                    }
                }

                //nineth
                if (FileUpload9.HasFile)
                {
                    string ext = Path.GetExtension(FileUpload9.FileName);
                    if (ext == ".jpg" || ext == ".png")
                    {
                        FileUpload9.SaveAs(path + FileUpload9.FileName);
                        string name = "Images/" + FileUpload9.FileName;
                        string ss   = "update user_review set image='" + name + "', name='" + TextBox25.Text + "',city='" + TextBox26.Text + "',contentt='" + TextBox27.Text + "' where id=9";

                        con.Open();
                        cmd = new SqlCommand(ss, con);
                        cmd.ExecuteNonQuery();
                        con.Close();
                    }
                }
                //tenth
                if (FileUpload10.HasFile)
                {
                    string ext = Path.GetExtension(FileUpload10.FileName);
                    if (ext == ".jpg" || ext == ".png")
                    {
                        FileUpload10.SaveAs(path + FileUpload10.FileName);
                        string name = "Images/" + FileUpload10.FileName;
                        string ss   = "update user_review set image='" + name + "', name='" + TextBox28.Text + "',city='" + TextBox29.Text + "',contentt='" + TextBox30.Text + "' where id=10";

                        con.Open();
                        cmd = new SqlCommand(ss, con);
                        cmd.ExecuteNonQuery();
                        con.Close();
                    }
                }

                count++;
                Response.Redirect("adminpanel-user-review.aspx");
            }
            else
            {
                a++;
                Response.Redirect("adminpanel-user-review.aspx");
            }
        }

        catch (Exception)
        {
            Label2.Visible = true;
        }
    }
    protected void Button2_Click(object sender, EventArgs e)
    {
        try
        {
            bl.id       = Convert.ToInt32(Request.QueryString["id"].ToString());
            bl.comp_nm  = txt_cmp.Text;
            bl.address1 = txt_add1.Text;
            bl.address2 = txt_add2.Text;
            bl.state_id = Convert.ToInt32(dwd_st.SelectedValue.ToString());

            bl.city_id  = Convert.ToInt32(dwd_ct.SelectedValue.ToString());
            bl.range    = txt_range.Text;
            bl.division = txt_division.Text;
            bl.phone    = txt_phn.Text;
            // bl.vat_1 = dwd_vat.Text;
            //bl.tax_4 = DropDownList1.Text;
            // bl.ecc_p = dwd_exc.Text;
            bl.openinig_date = txt_form.Text;

            if (FileUpload7.HasFile)
            {
                string filename = Path.GetFileName(FileUpload7.FileName);
                FileUpload7.SaveAs(Server.MapPath("~/img/") + txt_cmp.Text + "." + Path.GetExtension(FileUpload7.FileName));
                filename = "img/" + txt_cmp.Text + "logo." + Path.GetExtension(FileUpload7.FileName);
                bl.logo  = filename;
            }
            else
            {
                bl.logo = dd_logo.NavigateUrl;
            }
            bl.vat     = txt_vat.Text;
            bl.vatdate = txt_dt.Text;
            if (FileUpload1.HasFile)
            {
                string filename = Path.GetFileName(FileUpload1.FileName);
                FileUpload1.SaveAs(Server.MapPath("~/img/") + txt_cmp.Text + "vat." + Path.GetExtension(FileUpload1.FileName));
                filename  = "img/" + txt_cmp.Text + "vat." + Path.GetExtension(FileUpload1.FileName);
                bl.vatcrt = filename;
            }
            else
            {
                bl.vatcrt = dd_vat_crt.NavigateUrl;
            }
            bl.cst      = txt_cst.Text;
            bl.cst_date = txt_cstdt.Text;
            if (FileUpload2.HasFile)
            {
                string filename = Path.GetFileName(FileUpload2.FileName);
                FileUpload2.SaveAs(Server.MapPath("~/img/") + txt_cmp.Text + "cst." + Path.GetExtension(FileUpload2.FileName));
                filename = "img/" + txt_cmp.Text + "cst." + Path.GetExtension(FileUpload2.FileName);
                bl.cts   = filename;
            }
            else
            {
                bl.cts = dd_cst_crt.NavigateUrl;
            }
            bl.exse      = txt_exse.Text;
            bl.exse_date = txt_exedt.Text;

            if (FileUpload3.HasFile)
            {
                string filename = Path.GetFileName(FileUpload3.FileName);
                FileUpload3.SaveAs(Server.MapPath("~/img/") + txt_cmp.Text + "ecc." + Path.GetExtension(FileUpload3.FileName));
                filename    = "img/" + txt_cmp.Text + "ecc." + Path.GetExtension(FileUpload3.FileName);
                bl.exse_crt = filename;
            }
            else
            {
                bl.exse_crt = dd_exc_crt.NavigateUrl;
            }
            bl.st     = txt_st.Text;
            bl.stdate = txt_stdt.Text;

            if (FileUpload4.HasFile)
            {
                string filename = Path.GetFileName(FileUpload4.FileName);
                FileUpload4.SaveAs(Server.MapPath("~/img/") + txt_cmp.Text + "st." + Path.GetExtension(FileUpload4.FileName));
                filename  = "img/" + txt_cmp.Text + "st." + Path.GetExtension(FileUpload4.FileName);
                bl.st_crt = filename;
            }
            else
            {
                bl.st_crt = dd_st_crt.NavigateUrl;
            }

            bl.tds      = txt_tds.Text;
            bl.tds_date = txt_tdsdt.Text;

            if (FileUpload8.HasFile)
            {
                string filename = Path.GetFileName(FileUpload8.FileName);
                FileUpload7.SaveAs(Server.MapPath("~/img/") + txt_cmp.Text + "." + Path.GetExtension(FileUpload8.FileName));
                filename   = "img/" + txt_cmp.Text + "tds." + Path.GetExtension(FileUpload8.FileName);
                bl.tds_crt = filename;
            }
            else
            {
                bl.tds_crt = dd_tds_crt.NavigateUrl;
            }
            bl.cin = txt_cin.Text;

            if (FileUpload5.HasFile)
            {
                string filename = Path.GetFileName(FileUpload5.FileName);
                FileUpload5.SaveAs(Server.MapPath("~/img/") + txt_cmp.Text + "cin." + Path.GetExtension(FileUpload5.FileName));
                filename  = "img/" + txt_cmp.Text + "cin." + Path.GetExtension(FileUpload5.FileName);
                bl.cincrt = filename;
            }
            else
            {
                bl.cincrt = dd_cin_crt.NavigateUrl;
            }
            bl.pan = txt_pan.Text;

            if (FileUpload6.HasFile)
            {
                string filename = Path.GetFileName(FileUpload6.FileName);
                FileUpload6.SaveAs(Server.MapPath("~/img/") + txt_cmp.Text + "pan." + Path.GetExtension(FileUpload6.FileName));
                filename  = "img/" + txt_cmp.Text + "pan." + Path.GetExtension(FileUpload6.FileName);
                bl.pancrt = filename;
            }
            else
            {
                bl.pancrt = dd_pan_crt.NavigateUrl;
            }
            bl.website    = txt_website.Text;
            bl.email      = txt_email.Text;
            bl.mobile     = txt_mobile.Text;
            bl.pin_code   = txt_pincd.Text;
            bl.comissinrt = txt_comis_rt.Text;
            bl.notfy      = txt_not_under.Text;
            dl.update_comapnymaster(bl);
            ScriptManager.RegisterStartupScript(this, this.GetType(), "redirect", "alert('Comapany Master update successfully'); window.location='edit_cmp.aspx';", true);
        }
        catch
        {
        }
    }