예제 #1
0
        protected void Delete_Click(object sender, EventArgs e)
        {
            try
            {
                CheckBox          chk   = new CheckBox();
                Label             lbl   = new Label();
                string            phyid = "";
                PhysicianDataTier std   = new PhysicianDataTier();

                if (grdStudents.Rows.Count > 0)
                {
                    foreach (GridViewRow row in grdStudents.Rows)
                    {
                        chk = (CheckBox)row.FindControl("chkPhyID");

                        if (chk.Checked)
                        {
                            lbl   = (Label)row.Controls[0].FindControl("hidPhyID");
                            phyid = lbl.Text.Trim();

                            std.DeletePhysician(phyid);
                        }
                    }
                    DataBind();
                }
            }
            catch
            {
            }
        }
예제 #2
0
        private void DataBind()
        {
            PhysicianDataTier aDatatier = new PhysicianDataTier();

            DataSet aDataSet = new DataSet();

            aDataSet = aDatatier.ViewPhysician("", "", "");

            grdStudents.DataSource = aDataSet.Tables[0];

            // Cache for a while
            if (Cache["StudentData"] != null)
            {
                Cache.Add("StudentData", new DataView(aDataSet.Tables[0]),
                          null, System.Web.Caching.Cache.NoAbsoluteExpiration, System.TimeSpan.FromMinutes(10),
                          System.Web.Caching.CacheItemPriority.Default, null);
            }
            grdStudents.DataBind();
        }
예제 #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                PhysicianDataTier dataTier = new PhysicianDataTier();
                if (!string.IsNullOrEmpty(Request.QueryString["ID"]))
                {
                    DataSet dataSet = new DataSet();
                    string  phyid   = Request.QueryString["ID"];
                    dataSet = dataTier.FindByID(phyid);
                    if (Request.QueryString["ID"].Trim().ToUpper() == "EDIT")
                    {
                    }
                    else
                    {
                        //Response.Redirect("~/ViewPatients.aspx");
                        lblPhysicianID.Text = dataSet.Tables[0].Rows[0]["physician_id"].ToString();
                        txtFName.Text       = dataSet.Tables[0].Rows[0]["fname"].ToString();
                        txtMidInit.Text     = dataSet.Tables[0].Rows[0]["midint"].ToString();
                        txtLName.Text       = dataSet.Tables[0].Rows[0]["lname"].ToString();
                        ddlGender.Text      = dataSet.Tables[0].Rows[0]["gender"].ToString();
                        txtDOB.Text         = dataSet.Tables[0].Rows[0]["dob"].ToString();
                        txtStreet.Text      = dataSet.Tables[0].Rows[0]["streetname"].ToString();
                        txtCity.Text        = dataSet.Tables[0].Rows[0]["city"].ToString();
                        ddlState.Text       = dataSet.Tables[0].Rows[0]["doc_state"].ToString();
                        // Binds state to the dropdown list
                        ddlState.DataSource     = StateManager.getStates();
                        ddlState.DataTextField  = "FullAndAbbrev";
                        ddlState.DataValueField = "abbreviation";
                        ddlState.SelectedValue  = "PA";
                        ddlState.DataBind();

                        txtZIP.Text           = dataSet.Tables[0].Rows[0]["zip"].ToString();
                        txtOfficePhone.Text   = dataSet.Tables[0].Rows[0]["office_phone"].ToString();
                        txtPersonalPhone.Text = dataSet.Tables[0].Rows[0]["personal_phone"].ToString();
                        txtEmailI.Text        = dataSet.Tables[0].Rows[0]["personal_email"].ToString();
                        txtWorkEmail.Text     = dataSet.Tables[0].Rows[0]["work_email"].ToString();
                        txtSpecialty.Text     = dataSet.Tables[0].Rows[0]["speciality"].ToString();
                        txtSalary.Text        = dataSet.Tables[0].Rows[0]["salary"].ToString();
                    }
                }
            }
        }
예제 #4
0
        private void DataBind()
        {
            PhysicianDataTier aDatatier = new PhysicianDataTier();

            ViewState["vphyid"] = txtPhysicianID.Text.Trim();

            DataSet aDataSet = new DataSet();

            aDataSet = aDatatier.getphysician(Convert.ToString(ViewState["vphyid"]));

            grdPhysician.DataSource = aDataSet.Tables[0];

            // Cache for a while
            if (Cache["CustomerData"] != null)
            {
                Cache.Add("PhysicianData", new DataView(aDataSet.Tables[0]),
                          null, System.Web.Caching.Cache.NoAbsoluteExpiration, System.TimeSpan.FromMinutes(10),
                          System.Web.Caching.CacheItemPriority.Default, null);
            }
            grdPhysician.DataBind();
        }
예제 #5
0
        protected void btnHidden_Click(object sender, EventArgs e)
        {
            string reply;

            // Adds into SQL database
            try
            {
                PhysicianDataTier.AddPhysician(txtFName.Text, txtMidInit.Text, txtLName.Text, ddlGender.Text, txtStreet.Text,
                                               txtCity.Text, ddlState.Text, decimal.Parse(txtZIP.Text), DateTime.Parse(txtDOB.Text), txtOfficePhone.Text,
                                               txtPersonalPhone.Text, txtEmailI.Text, txtWorkEmail.Text, txtSpecialty.Text, decimal.Parse(txtSalary.Text));

                reply           = "Success";
                lblDisplay.Text = reply;
            }
            catch (Exception Ex)
            {
                throw new Exception(Ex.Message);
            }
            finally
            {
            }
        }