Beispiel #1
0
        private void LoadCompanyPhone()
        {
            this.txtID.Text = Request.QueryString["CompanyID"];
            int CompanyID = Convert.ToInt32(txtID.Text);

            this.txtPhID.Text = Request.QueryString["PhoneID"];
            int PhoneID = Convert.ToInt32(txtPhID.Text);

            //I should make a line of code for every text box, converting the value to the string .

            DataManager.DataAccess da = new DataManager.DataAccess();

            DataSet ds = da.FetchPhoneNumber(PhoneID);

            DataSet ds2 = da.FetchCompanyPhone(PhoneID);
            //  DataSet ds2 = da.FetchPersonPhones(PersonID);

            // txtID.Text = ds.Tables[0].Rows[0]["PersonID"].ToString();
            //txtPhID.Text = ds.Tables[0].Rows[0]["PhoneID"].ToString();

            object pi = ds.Tables[0].Rows[0]["PhoneID"];  // PhoneID, AreaCode, PhoneNumber, Extension, PhoneType
            object ac = ds.Tables[0].Rows[0]["AreaCode"];
            object pn = ds.Tables[0].Rows[0]["PhoneNumber"];
            object ex = ds.Tables[0].Rows[0]["Extension"];
            object pt = ds.Tables[0].Rows[0]["PhoneTypeID"];

            // txtID.Text = pi.ToString();
            txtAreaCode.Text    = ac.ToString();
            txtPhoneNumber.Text = pn.ToString();
            txtExtension.Text   = ex.ToString();
            ddlPhoneTypeID.Text = pt.ToString();



            object EPPn = ds2.Tables[0].Rows[0]["Notes"];
            object EPPd = ds2.Tables[0].Rows[0]["Description"];


            txtDescription.Text = EPPd.ToString();
            txtNotes.Text       = EPPn.ToString();
        }
        private void LoadCompanyPhone()
        {
            this.txtID.Text = Request.QueryString["CompanyID"];
            int CompanyID = Convert.ToInt32(txtID.Text);

            this.txtPhID.Text = Request.QueryString["PhoneID"];
            int PhoneID = Convert.ToInt32(txtPhID.Text);
            //I should make a line of code for every text box, converting the value to the string .

            DataManager.DataAccess da = new DataManager.DataAccess();

            DataSet ds = da.FetchPhoneNumber(PhoneID);

            DataSet ds2 = da.FetchCompanyPhone(PhoneID);
            //  DataSet ds2 = da.FetchPersonPhones(PersonID);

            // txtID.Text = ds.Tables[0].Rows[0]["PersonID"].ToString();
            //txtPhID.Text = ds.Tables[0].Rows[0]["PhoneID"].ToString();

            object pi = ds.Tables[0].Rows[0]["PhoneID"];  // PhoneID, AreaCode, PhoneNumber, Extension, PhoneType
            object ac = ds.Tables[0].Rows[0]["AreaCode"];
            object pn = ds.Tables[0].Rows[0]["PhoneNumber"];
            object ex = ds.Tables[0].Rows[0]["Extension"];
            object pt = ds.Tables[0].Rows[0]["PhoneTypeID"];
            // txtID.Text = pi.ToString();
            txtAreaCode.Text = ac.ToString();
            txtPhoneNumber.Text = pn.ToString();
            txtExtension.Text = ex.ToString();
            ddlPhoneTypeID.Text = pt.ToString();

            object EPPn = ds2.Tables[0].Rows[0]["Notes"];
            object EPPd = ds2.Tables[0].Rows[0]["Description"];

            txtDescription.Text = EPPd.ToString();
            txtNotes.Text = EPPn.ToString();
        }