Beispiel #1
0
    public int UpdateProviderEducation(ProviderEducationDTO providereducation)
    {
        command             = new SqlCommand(StoredProcedureName.Names.UpdateProviderEducation.ToString(), connection);
        command.CommandType = CommandType.StoredProcedure;

        command.Parameters.Add("@EducationId", SqlDbType.BigInt);
        command.Parameters.Add("@ProviderId", SqlDbType.BigInt);
        command.Parameters.Add("@InstitutionName", SqlDbType.VarChar, 100);
        command.Parameters.Add("@DegreeTitle", SqlDbType.VarChar, 100);
        command.Parameters.Add("@YearCompleted", SqlDbType.VarChar, 10);

        command.Parameters[0].Value = providereducation.EducationId;
        command.Parameters[1].Value = providereducation.ProviderId;
        command.Parameters[2].Value = providereducation.InstitutionName;
        command.Parameters[3].Value = providereducation.DegreeTitle;
        command.Parameters[4].Value = providereducation.YearCompleted;

        int rowaffected = 0;

        connection.Open();

        rowaffected = command.ExecuteNonQuery();

        connection.Close();

        return(rowaffected);
    }
Beispiel #2
0
    public List <ProviderEducationDTO> GetProviderEducationByProviderId(long providerid)
    {
        ProviderEducationList = new List <ProviderEducationDTO>();

        command             = new SqlCommand(StoredProcedureName.Names.GetProviderEducationByProviderId.ToString(), connection);
        command.CommandType = CommandType.StoredProcedure;

        command.Parameters.Add("@ProviderId", SqlDbType.BigInt);

        command.Parameters[0].Value = providerid;

        connection.Open();
        datareader = command.ExecuteReader();

        if (!datareader.HasRows)
        {
            return(null);
        }
        while (datareader.Read())
        {
            ProviderEducation                 = new ProviderEducationDTO();
            ProviderEducation.EducationId     = Convert.ToInt64(datareader["EducationId"]);
            ProviderEducation.ProviderId      = Convert.ToInt64(datareader["ProviderId"]);
            ProviderEducation.InstitutionName = datareader["InstitutionName"].ToString();
            ProviderEducation.DegreeTitle     = datareader["DegreeTitle"].ToString();
            ProviderEducation.YearCompleted   = datareader["YearCompleted"].ToString();
            ProviderEducationList.Add(ProviderEducation);
        }
        connection.Close();
        return(ProviderEducationList);
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        GetCookie();
        if (!IsPostBack)
        {
            for (int year = DateTime.Now.Year; year > (DateTime.Now.Year - 58); year--)
            {
                ListItem item = new ListItem(year.ToString(), year.ToString());
                DropDownYears.Items.Add(item);
            }

            Educationid          = Convert.ToInt64(Request.QueryString["EducationId"]);
            ProviderEducationdto = new ProviderEducationDTO();
            ProviderEducationBl  = new ProviderEducationBL();

            ProviderEducationdto = ProviderEducationBl.GetProviderEducationByEducationId(ProviderId, Educationid);

            TxtDegreeTitle.Text     = ProviderEducationdto.DegreeTitle;
            TxtInstitutionName.Text = ProviderEducationdto.InstitutionName;
            if (ProviderEducationdto.YearCompleted != "")
            {
                DropDownYears.Items.FindByValue(ProviderEducationdto.YearCompleted).Selected = true;
            }
            else
            {
                DropDownYears.Items.FindByValue("0").Selected = true;
            }
        }
    }
Beispiel #4
0
    protected void BtnSave_Click(object sender, EventArgs e)
    {
        ProviderEducationdto = new ProviderEducationDTO();
        ProviderEducationBl  = new ProviderEducationBL();

        ProviderEducationdto.ProviderId      = ProviderId;
        ProviderEducationdto.InstitutionName = TxtInstitutionName.Text.ToString();
        ProviderEducationdto.DegreeTitle     = TxtDegreeTitle.Text.ToString();
        if (Convert.ToInt32(DropDownYears.SelectedItem.Value) != 0)
        {
            ProviderEducationdto.YearCompleted = DropDownYears.SelectedItem.Value;
        }
        ProviderEducationBl.AddProviderEducation(ProviderEducationdto);

        Response.Redirect("~/Provider/ProfilePage.aspx");
    }
    protected void BtnSave_Click(object sender, EventArgs e)
    {
        Educationid          = Convert.ToInt64(Request.QueryString["EducationId"]);
        ProviderEducationdto = new ProviderEducationDTO();
        ProviderEducationBl  = new ProviderEducationBL();

        ProviderEducationdto.ProviderId      = ProviderId;
        ProviderEducationdto.EducationId     = Educationid;
        ProviderEducationdto.InstitutionName = TxtInstitutionName.Text.ToString();
        ProviderEducationdto.DegreeTitle     = TxtDegreeTitle.Text.ToString();
        if (DropDownYears.SelectedItem.Value != 0.ToString())
        {
            ProviderEducationdto.YearCompleted = DropDownYears.SelectedItem.Value;
        }
        ProviderEducationBl.UpdateProviderEducation(ProviderEducationdto);

        Response.Redirect("~/Provider/ProfilePage.aspx");
    }
Beispiel #6
0
    public long AddProviderEducation(ProviderEducationDTO providereducation)
    {
        command             = new SqlCommand(StoredProcedureName.Names.AddProviderEducation.ToString(), connection);
        command.CommandType = CommandType.StoredProcedure;

        command.Parameters.Add("@ProviderId", SqlDbType.BigInt);
        command.Parameters.Add("@InstitutionName", SqlDbType.VarChar, 100);
        command.Parameters.Add("@DegreeTitle", SqlDbType.VarChar, 100);
        command.Parameters.Add("@YearCompleted", SqlDbType.VarChar, 10);

        command.Parameters[0].Value = providereducation.ProviderId;
        command.Parameters[1].Value = providereducation.InstitutionName;
        command.Parameters[2].Value = providereducation.DegreeTitle;
        command.Parameters[3].Value = providereducation.YearCompleted;

        connection.Open();

        EducationId = Convert.ToInt64(command.ExecuteScalar());

        connection.Close();

        return(EducationId);
    }
 public int UpdateProviderEducation(ProviderEducationDTO providereducation)
 {
     ProviderEducationdal = new ProviderEducationDAL();
     return(ProviderEducationdal.UpdateProviderEducation(providereducation));
 }
 public long AddProviderEducation(ProviderEducationDTO providereducation)
 {
     ProviderEducationdal = new ProviderEducationDAL();
     return(ProviderEducationdal.AddProviderEducation(providereducation));
 }