Ejemplo n.º 1
0
    public long AddProviderCertification(ProviderCertificationDTO providerCertification)
    {
        command             = new SqlCommand(StoredProcedureName.Names.AddProviderCertification.ToString(), connection);
        command.CommandType = CommandType.StoredProcedure;

        command.Parameters.Add("@ProviderId", SqlDbType.BigInt);
        command.Parameters.Add("@CertificationName", SqlDbType.VarChar, 50);
        command.Parameters.Add("@Description", SqlDbType.VarChar);
        command.Parameters.Add("@Percentage", SqlDbType.SmallInt, 100);
        command.Parameters.Add("@Score", SqlDbType.Int, 10);
        command.Parameters.Add("@YearCompleted", SqlDbType.VarChar, 10);

        command.Parameters[0].Value = providerCertification.ProviderId;
        command.Parameters[1].Value = providerCertification.CertificationName;
        command.Parameters[2].Value = providerCertification.Description;
        command.Parameters[3].Value = providerCertification.Percentage;
        command.Parameters[4].Value = providerCertification.Score;
        command.Parameters[5].Value = providerCertification.YearCompleted;


        connection.Open();

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

        connection.Close();

        return(CertificationId);
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        //System.Diagnostics.Debugger.Break();
        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);
            }

            CertificationId = Convert.ToInt64(Request.QueryString["CertificationId"]);

            ProviderCertificationbl = new ProviderCertificationBL();
            ProviderCertification   = new ProviderCertificationDTO();

            ProviderCertification = ProviderCertificationbl.GetProviderCertificationByCertificationId(ProviderId, CertificationId);

            TxtCertificationName.Text = ProviderCertification.CertificationName;
            TxtPercentage.Text        = ProviderCertification.Percentage.ToString();

            if (ProviderCertification.YearCompleted != "")
            {
                DropDownYears.Items.FindByValue(ProviderCertification.YearCompleted).Selected = true;
            }
            else
            {
                DropDownYears.Items.FindByValue("0").Selected = true;
            }
        }
    }
Ejemplo n.º 3
0
    public ProviderCertificationDTO GetProviderCertificationByCertificationId(long providerid, long certificationid)
    {
        ProviderCertification = new ProviderCertificationDTO();

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

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

        command.Parameters[0].Value = providerid;
        command.Parameters[1].Value = certificationid;

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

        if (!datareader.HasRows)
        {
            return(null);
        }
        while (datareader.Read())
        {
            ProviderCertification.CertificationId   = Convert.ToInt64(datareader["CertificationId"]);
            ProviderCertification.ProviderId        = Convert.ToInt64(datareader["ProviderId"]);
            ProviderCertification.CertificationName = datareader["CertificationName"].ToString();
            ProviderCertification.Description       = datareader["Description"].ToString();
            ProviderCertification.Percentage        = Convert.ToInt16(datareader["Percentage"]);
            ProviderCertification.Score             = Convert.ToInt32(datareader["Score"]);
            ProviderCertification.YearCompleted     = datareader["YearCompleted"].ToString();
        }
        connection.Close();
        return(ProviderCertification);
    }
Ejemplo n.º 4
0
    public int UpdateProviderCertification(ProviderCertificationDTO providerCertification)
    {
        command             = new SqlCommand(StoredProcedureName.Names.UpdateProviderCertification.ToString(), connection);
        command.CommandType = CommandType.StoredProcedure;

        command.Parameters.Add("@ProviderId", SqlDbType.BigInt);
        command.Parameters.Add("@CertificationId", SqlDbType.BigInt);
        command.Parameters.Add("@CertificationName", SqlDbType.VarChar, 50);
        command.Parameters.Add("@Description", SqlDbType.VarChar);
        command.Parameters.Add("@Percentage", SqlDbType.SmallInt, 100);
        command.Parameters.Add("@Score", SqlDbType.Int, 10);
        command.Parameters.Add("@YearCompleted", SqlDbType.VarChar, 10);

        command.Parameters[0].Value = providerCertification.ProviderId;
        command.Parameters[1].Value = providerCertification.CertificationId;
        command.Parameters[2].Value = providerCertification.CertificationName;
        command.Parameters[3].Value = providerCertification.Description;
        command.Parameters[4].Value = providerCertification.Percentage;
        command.Parameters[5].Value = providerCertification.Score;
        command.Parameters[6].Value = providerCertification.YearCompleted;

        int rowaffected = 0;

        connection.Open();

        rowaffected = command.ExecuteNonQuery();

        connection.Close();

        return(rowaffected);
    }
    protected void BtnSave_Click(object sender, EventArgs e)
    {
        ProviderCertification = new ProviderCertificationDTO();

        ProviderCertification.ProviderId        = ProviderId;
        ProviderCertification.CertificationName = TxtCertificationName.Text.ToString();
        if (TxtPercentage.Text != null && TxtPercentage.Text != "")
        {
            ProviderCertification.Percentage = Convert.ToInt16(TxtPercentage.Text);
        }

        if (Convert.ToInt32(DropDownYears.SelectedItem.Value) != 0)
        {
            ProviderCertification.YearCompleted = DropDownYears.SelectedItem.Value;
        }

        ProviderCertificationbl = new ProviderCertificationBL();
        CertificationId         = ProviderCertificationbl.AddProviderCertification(ProviderCertification);
        Response.Redirect("~/Provider/ProfilePage.aspx");
    }
Ejemplo n.º 6
0
 public long UpdateProviderCertification(ProviderCertificationDTO providerCertification)
 {
     ProviderCertificationdal = new ProviderCertificationDAL();
     return(ProviderCertificationdal.UpdateProviderCertification(providerCertification));
 }
Ejemplo n.º 7
0
 public long AddProviderCertification(ProviderCertificationDTO providerCertification)
 {
     ProviderCertificationdal = new ProviderCertificationDAL();
     return(ProviderCertificationdal.AddProviderCertification(providerCertification));
 }