示例#1
0
        protected void btnServiceupdate_Click(object sender, EventArgs e)
        {
            BALAccounts      Bal = new BALAccounts();
            MedicareServices medicareservices = new MedicareServices
            {
                MedicareServicesId1  = int.Parse(Request.QueryString["medicareservicesid"].ToString()),
                Medicare_service1    = txtMS.Text,
                Service_Description1 = txtMSDescription.Text,
                Amount1 = int.Parse(txtAmount.Text)
            };

            Bal.modifymedicareservices(medicareservices);
        }
        protected void btnServiceSubmit_Click(object sender, EventArgs e)
        {
            BALAccounts         Bal = new BALAccounts();
            MedicareServicesSql medicareServicesSql = new MedicareServicesSql();
            MedicareServices    mediServices        = new MedicareServices
            {
                Medicare_service1    = txtMS.Text,
                Service_Description1 = txtMSDescription.Text,
                Amount1 = int.Parse(txtAmount.Text)
            };

            Bal.addmedicareservices(mediServices);
            lblerror.Text         = "Added Successfully";
            txtMS.Text            = "";
            txtMSDescription.Text = "";
            txtAmount.Text        = "";
        }
示例#3
0
 public void AddMedicareServices(MedicareServices medicareservices)
 {
     try
     {
         SqlConnection _sqlConnection = ConnectionHandler.GetConnection();
         SqlCommand    _sqlCommand    = new SqlCommand();
         _sqlCommand.Connection  = _sqlConnection;
         _sqlCommand.CommandType = CommandType.StoredProcedure;
         _sqlCommand.CommandText = "addmedicareservices";
         _sqlCommand.Parameters.AddWithValue("@MedicareService", medicareservices.Medicare_service1);
         _sqlCommand.Parameters.AddWithValue("@ServiceDescription", medicareservices.Service_Description1);
         _sqlCommand.Parameters.AddWithValue("@Amount", medicareservices.Amount1);
         _sqlConnection.Open();
         int result = _sqlCommand.ExecuteNonQuery();
         _sqlConnection.Close();
     }
     catch (Exception ex)
     {
     }
 }
        protected void MserviceDetails_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            GridViewRow             row              = MserviceDetails.Rows[e.RowIndex];
            string                  name             = (row.FindControl("lblmedicareservice") as Label).Text;
            MedicareServices        medicareservices = new MedicareServices();
            BALAccounts             Bal              = new BALAccounts();
            List <MedicareServices> medservices      = Bal.displaymedicareservices();

            if (medservices.Count > 0)
            {
                for (int i = 0; i < medservices.Count; i++)
                {
                    if (medservices[i].Medicare_service1 == name)
                    {
                        medservices.RemoveAt(i);
                    }
                }
                Bal.removemedicareservices(name);
                lblStatus.Text = "Medicare Services Deleted successfully";
                GetMedicareServices();
            }
        }
 public ActionResult MedicareServicesForm(MedicareServices medicare, FormCollection formData)
 {
     if (!ModelState.IsValid)
     {
         ViewBag.ValidationMessage = "Please update the highlighted mandatory field(s)";
         return(View());
     }
     else
     {
         DataBaseContext medicareServices = new DataBaseContext();
         foreach (var item in medicareServices.MedicareServices)
         {
             if (item.MedicareId == Int32.Parse(formData["MedicareId"]))
             {
                 ViewBag.ValidationMessage = "Medicare Id already exists.";
             }
         }
         medicareServices.MedicareServices.Add(medicare);
         medicareServices.SaveChanges();
         ViewBag.ValidationMessage = "Your details are submitted succesfully.";
         return(View());
     }
 }
示例#6
0
 public void modifymedicareservices(MedicareServices medicareservices)
 {
     medicareservicessql.ModifyMedicareServices(medicareservices);
 }
示例#7
0
 public void addmedicareservices(MedicareServices medicareservices)
 {
     medicareservicessql.AddMedicareServices(medicareservices);
 }