private void gvSibling_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.RowIndex >= 0)
     {
         int        admissionNo = Convert.ToInt32(gvSibling.Rows[e.RowIndex].Cells["Addmission_Number"].Value);
         FeeDeposit fd          = new FeeDeposit();
         fd.AdmissionNo = admissionNo;
         fd.Show();
         this.Close();
     }
 }
        private void toolStripMenuItem2_Click(object sender, EventArgs e)
        {
            FeeDeposit fd       = new FeeDeposit();
            string     userName = lblUserName.Text.Replace("Welcome ", "");

            Control[] ctrl     = fd.Controls.Find("lblUname", true);
            Label     lblUname = (Label)ctrl.FirstOrDefault();

            lblUname.Text = userName;

            fd.Show();
        }
        private void toolStripMenuItem2_Click(object sender, EventArgs e)
        {
            FeeDeposit fd = new FeeDeposit();

            fd.Show();
        }
Beispiel #4
0
        private void btn_Save_Click(object sender, EventArgs e)
        {
            try
            {
                if (txtAdmissionNo.Text == string.Empty)
                {
                    CommonFunctions.ShowError("Please enter Registration Number!");
                }
                else if (txtRegistrationFee.Text == "")
                {
                    MessageBox.Show("Please Enter Registration Fee!");
                }
                else if (txtAdmissionFee.Text == "")
                {
                    MessageBox.Show("Please Enter Admission Fee!");
                }
                else if (txtTutionFee.Text == "")
                {
                    MessageBox.Show("Please Enter Tution Fee!");
                }
                else if (ValidateFeeEntry() == true && Operation != "Update")
                {
                    MessageBox.Show("Fee Structure for this student is already saved !");
                }
                else
                {
                    if (Operation == "Update")
                    {
                        SqlConnection con = new SqlConnection(Connection.Connection_string.ConnectionString);
                        SqlCommand    cmd = new SqlCommand("delete tbl_StudentAnnualFeeStructure WHERE Addmission_Number='" + txtAdmissionNo.Text + "' AND Session='" + lblSession.Text + "'");
                        cmd.Connection = con;
                        con.Open();
                        cmd.ExecuteNonQuery();
                        con.Close();
                    }
                    SqlParameter[] m = new SqlParameter[29];
                    m[0]  = new SqlParameter("@FeeId", SqlDbType.Int);
                    m[1]  = new SqlParameter("@RegistrationFee", txtRegistrationFee.Text);
                    m[2]  = new SqlParameter("@AddmissionFee", txtAdmissionFee.Text);
                    m[3]  = new SqlParameter("@AnnualCharges", txtAnnualCharges.Text);
                    m[4]  = new SqlParameter("@TutionFee", txtTutionFee.Text);
                    m[5]  = new SqlParameter("@QuaterlyFee", txtQuarterlyFee.Text);
                    m[6]  = new SqlParameter("@TransportFee", txtTransportFee.Text);
                    m[7]  = new SqlParameter("@RegistrationFee_Disc", txtRegistrationFeeDisc.Text);
                    m[8]  = new SqlParameter("@AddmissionFee_Disc", txtAdmissionFeeDisc.Text);
                    m[9]  = new SqlParameter("@AnnualCharges_Disc", txtAnnualChargesDisc.Text);
                    m[10] = new SqlParameter("@TutionFee_Disc", txtTutionFeeDisc.Text);
                    m[11] = new SqlParameter("@QuaterlyFee_Disc", txtQuarterlyFeeDisc.Text);
                    m[12] = new SqlParameter("@TransportFee_Disc", txtTransportFeeDisc.Text);
                    m[13] = new SqlParameter("@Act_RegistrationFee", txtRegistrationFeeAct.Text);
                    m[14] = new SqlParameter("@Act_AddmissionFee", txtAdmissionFeeAct.Text);
                    m[15] = new SqlParameter("@Act_AnnualCharges", txtAnnualChargesAct.Text);
                    m[16] = new SqlParameter("@Act_TutionFee", txtTutionFeeAct.Text);
                    m[17] = new SqlParameter("@Act_QuaterlyFee", txtQuarterlyFeeAct.Text);
                    m[18] = new SqlParameter("@Act_TransportFee", txtTransportFeeAct.Text);
                    m[19] = new SqlParameter("@Addmission_Number", txtAdmissionNo.Text);
                    // m[20] = new SqlParameter("@Month", DateTime.Now.Month);
                    m[20] = new SqlParameter("@Class", txtClass.Text);
                    m[21] = new SqlParameter("@Acc_Number", txtAccountNo.Text);
                    m[22] = new SqlParameter("@TotalAmount", txtTotalAmount.Text);
                    m[23] = new SqlParameter("@UDF1", SqlDbType.Text);
                    m[24] = new SqlParameter("@UDF2", SqlDbType.Text);
                    m[25] = new SqlParameter("@UDF3", SqlDbType.Text);
                    m[26] = new SqlParameter("@Session", lblSession.Text);
                    m[27] = new SqlParameter("@Name", txtName.Text);
                    m[28] = new SqlParameter("@UserName", lblUname.Text);

                    SqlHelper.ExecuteNonQuery(Connection.Connection_string, CommandType.StoredProcedure, "StudentAnnualFeeStructure_Insert", m);
                    CommonFunctions.ShowMessage("Fee Structure Saved Successfully");
                    FeeDeposit fd = new FeeDeposit();
                    fd.AdmissionNo  = Convert.ToInt32(txtAdmissionNo.Text);
                    fd.NewAdmission = true;
                    fd.Show();
                    this.Hide();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }