Exemple #1
0
        protected void btnEdit_Click(object sender, EventArgs e)
        {
            Company_DB DB     = new Company_DB();
            int        UserID = 0;

            try
            {
                //int Userids = 0;
                //Userids = Convert.ToInt32(HttpContext.Current.Session["UserID"]);
                //int Userids = 0;
                //Userids = Convert.ToInt32(HttpContext.Current.Session["UserID"]);
                // int Userids = 0;
                int CompID = 0;
                CompID            = Convert.ToInt32(GridComView.SelectedRow.Cells[1].Text);
                UserID            = DB.Update_CompanyName(CompID, txtComName.Text, txtComAdd.Text, TxtComEmail.Text, txtPhone.Text, txtTelephone.Text, txtWeb.Text);
                txtComName.Text   = "";
                txtComAdd.Text    = "";
                TxtComEmail.Text  = "";
                txtPhone.Text     = "";
                txtTelephone.Text = "";
                txtWeb.Text       = "";
                lblMsg.Text       = "Company Profile Successfully Modified";
                lblMsg.ForeColor  = System.Drawing.Color.Green;
                CompanyGridView();
                txtComName.Text   = GridComView.SelectedRow.Cells[2].Text;
                txtComAdd.Text    = GridComView.SelectedRow.Cells[3].Text;
                TxtComEmail.Text  = GridComView.SelectedRow.Cells[4].Text;
                txtPhone.Text     = GridComView.SelectedRow.Cells[5].Text;
                txtTelephone.Text = GridComView.SelectedRow.Cells[6].Text;
                txtWeb.Text       = GridComView.SelectedRow.Cells[7].Text;


                //lblMsg.ForeColor = System.Drawing.Color.Green;
                //if (avatarUpload.PostedFile.FileName != null && avatarUpload.PostedFile.FileName != "")
                // {
                //   string filepath = avatarUpload.PostedFile.FileName;
                //  string filename = Path.GetFileName(filepath);
                //string ext = Path.GetExtension(filename);

                //   if (ext == ".jpeg" || ext == ".jpg")
                //   {
                //  UploadFiles(txtShortName.Text, ext);
                // }

                //}
            }

            catch (Exception ex)
            {
                lblMsg.Text      = "Please Enter Valid Information";
                lblMsg.ForeColor = System.Drawing.Color.Red;
            }
            finally
            {
            }
        }