예제 #1
0
        protected void btnPayFee_Click(object sender, EventArgs e)
        {
            SqlConnection con;
            SqlCommand    csm;

            try
            {
                using (con = new SqlConnection(cs))
                {
                    csm = new SqlCommand("insert into dbo.StudentFeeStatus values(@sessionId,@rollNo,@feeAmount,@TimeStamp,@status,@semester)", con);


                    csm.Parameters.AddWithValue("@sessionId", FeeHelper.convertsessionnametoid(ddlSessionName.Text));
                    csm.Parameters.AddWithValue("@rollNo", Session["Rollno"]);
                    csm.Parameters.AddWithValue("@feeAmount", lblFeeAmount.Text);
                    csm.Parameters.AddWithValue("@TimeStamp", DateTime.Today);
                    csm.Parameters.AddWithValue("@status", lblTempStatus.Text);
                    csm.Parameters.AddWithValue("@semester", ddlSemester.Text);
                    con.Open();
                    csm.ExecuteNonQuery();
                }
                Response.Redirect("~/Student/Check_Status.aspx");
                // Response.Redirect("http://coetbgsbu.org/src/pg/testrequest.aspx");
            }
            catch (Exception)
            {
            }
        }
예제 #2
0
        //private void GetHostelFeeFrosmb()
        //{
        //    ddlSessionName.Items.Clear();



        //    SqlConnection con = new SqlConnection(cs);
        //    SqlCommand csm = new SqlCommand("select SessionId from dbo.MasterFee where YearOfAdmission = @yearofadmission and DepttId = @depttid", con);
        //    csm.Parameters.AddWithValue("@yearofadmission", lblBatch.Text);
        //    csm.Parameters.AddWithValue("@depttid", FeeHelper2.ConvertDepartmentNameToId(lblDepttName.Text));

        //    try
        //    {
        //        ListItem newItem = new ListItem();
        //        newItem.Text = "<Select Session>";
        //        newItem.Value = "0";
        //        ddlSessionName.Items.Add(newItem);

        //        con.Open();
        //        SqlDataReader rdr = csm.ExecuteReader();
        //        while (rdr.Read())
        //        {
        //            newItem = new ListItem();
        //            newItem.Text = StudentFeeHelper.ConvertSessionIdToSessionName(rdr["SessionId"].ToString());
        //            ddlSessionName.Items.Add(newItem);
        //        }
        //        rdr.Close();
        //    }
        //    catch (Exception)
        //    {
        //    }
        //    finally
        //    {
        //        con.Close();
        //    }
        //}



        protected void ddlSessionName_SelectedIndexChanged(object sender, EventArgs e)
        {
            SqlConnection con;
            SqlCommand    csm;
            SqlDataReader rdr;


            if (rbTutionFee.Checked == true)
            {
                using (con = new SqlConnection(cs))
                {
                    csm = new SqlCommand("select TutionFeeAmount from dbo.MasterFee where SessionId=@sessionId", con);
                    csm.Parameters.AddWithValue("@sessionId", FeeHelper.convertsessionnametoid(ddlSessionName.Text));
                    con.Open();

                    rdr = csm.ExecuteReader();
                    if (rdr.Read())
                    {
                        lblFeeAmount.Text = rdr["TutionFeeAmount"].ToString();
                        btnPayFee.Enabled = true;
                    }
                }
            }


            if (rbExaminationFee.Checked == true)
            {
                using (con = new SqlConnection(cs))
                {
                    csm = new SqlCommand("select ExaminationFeeAmount from dbo.MasterFee where SessionId=@sessionId", con);
                    csm.Parameters.AddWithValue("@sessionId", FeeHelper.convertsessionnametoid(ddlSessionName.Text));
                    con.Open();

                    rdr = csm.ExecuteReader();
                    if (rdr.Read())
                    {
                        lblFeeAmount.Text = rdr["ExaminationFeeAmount"].ToString();

                        btnPayFee.Enabled = true;
                    }
                }
                rdr.Close();
            }
        }
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            try
            {
                string tmpsql = "";

                using (SqlConnection con = new SqlConnection(cs))
                {
                    int i = 0;
                    foreach (TableRow objrow in tblresult.Rows)

                    {
                        if (i == 0)
                        {
                            i += 1;
                            continue;
                        }

                        i += 1;


                        objtext = (TextBox)objrow.Cells[3].FindControl("fee" + Convert.ToString(i - 1));

                        if (objtext == null)
                        {
                            continue;
                        }


                        objtext2 = (TextBox)objrow.Cells[4].FindControl("hfee" + Convert.ToString(i - 1));

                        if (objtext2 == null)
                        {
                            continue;
                        }

                        //tmpsql += "insert into masterfee () values () " + objtext2.Text + " ";



                        tmpsql += "insert into dbo.MasterFee values(" + objrow.Cells[0].Text + "," + FeeHelper.convertsessionnametoid(objrow.Cells[1].Text) + "," + FeeHelper2.ConvertDepartmentNameToId(objrow.Cells[2].Text) + ", " + objtext.Text + "," + objtext2.Text + ");";
                    }
                    SqlCommand csm = new SqlCommand(tmpsql, con);
                    con.Open();
                    csm.ExecuteNonQuery();
                    con.Close();
                }



                // Response.Write(tmpsql);
                // Response.Redirect("~/Admin/View_Fee.aspx");



                //Response.Write(tmpsql);
            }
            catch (Exception)
            {
            }
            finally
            {
                Response.Redirect("~/Admin/View_Fee.aspx");
            }
        }
예제 #4
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            SqlConnection con;

            if (ddlFeeType.Text == "Examination Fee")
            {
                using (con = new SqlConnection(cs))
                {
                    SqlCommand cmd = new SqlCommand("select ExaminationFeeAmount from dbo.MasterFee where YearOfAdmission=@yoa and SessionId=@sessionid and DepttId=@depttid", con);
                    cmd.Parameters.AddWithValue("@yoa", lbltemp1.Text);
                    cmd.Parameters.AddWithValue("@sessionid", FeeHelper.convertsessionnametoid(ddlSessionName.Text));
                    cmd.Parameters.AddWithValue("@depttid", lbltemp2.Text);
                    con.Open();
                    SqlDataReader rdr = cmd.ExecuteReader();
                    if (rdr.Read())
                    {
                        lbltempfee.Text = rdr["ExaminationFeeAmount"].ToString();
                    }
                }
            }
            if (ddlFeeType.Text == "Tution Fee")
            {
                using (con = new SqlConnection(cs))
                {
                    SqlCommand cmd = new SqlCommand("select TutionFeeAmount from dbo.MasterFee where YearOfAdmission=@yoa and SessionId=@sessionid and DepttId=@depttid", con);
                    cmd.Parameters.AddWithValue("@yoa", lbltemp1.Text);
                    cmd.Parameters.AddWithValue("@sessionid", FeeHelper.convertsessionnametoid(ddlSessionName.Text));
                    cmd.Parameters.AddWithValue("@depttid", lbltemp2.Text);
                    con.Open();
                    SqlDataReader rdr = cmd.ExecuteReader();
                    if (rdr.Read())
                    {
                        lbltempfee.Text = rdr["TutionFeeAmount"].ToString();
                    }
                }
            }



            using (con = new SqlConnection(cs))
            {
                SqlCommand csm = new SqlCommand("SELECT Students.Rollno, Students.StudentFullName, Students.DepttId,Students.Batch, Session.SessionName, StudentFeeStatus.FeeAmount, StudentFeeStatus.txn_id, StudentFeeStatus.TimeStamp, StudentFeeStatus.Status FROM     StudentFeeStatus INNER JOIN  Session ON StudentFeeStatus.SessionId = Session.SessionId INNER JOIN Students ON StudentFeeStatus.Rollno = Students.Rollno where Session.SessionName = @sessionname  and StudentFeeStatus.[Status] = 'completed' and StudentFeeStatus.Semester =@semester and  Students.Rollno = @rollno ", con);
                csm.Parameters.AddWithValue("@sessionname", ddlSessionName.Text);
                csm.Parameters.AddWithValue("@rollno", Session["Rollno"]);
                csm.Parameters.AddWithValue("@semester", ddlSemester.Text);
                csm.Parameters.AddWithValue("@feeamount", lbltempfee.Text);
                con.Open();
                SqlDataReader rdr = csm.ExecuteReader();
                while (rdr.Read())
                {
                    lblSttudentName.Text   = rdr["StudentFullName"].ToString();
                    lblRollno.Text         = rdr["Rollno"].ToString();
                    lblDepartmentName.Text = StudentFeeHelper2.ConvertDepttIdToDepartmentName(rdr["DepttId"].ToString());
                    lblBatch.Text          = rdr["Batch"].ToString();
                    lblAmount.Text         = rdr["FeeAmount"].ToString();
                    lblStatus.Text         = rdr["Status"].ToString();
                    lblDatePaid.Text       = rdr["TimeStamp"].ToString();
                    lbltemp3.Text          = rdr["txn_id"].ToString();
                }
            }
        }
        protected void btnGetPdf_Click(object sender, EventArgs e)
        {
            try
            {
                SqlConnection con;
                if (ddlFeeType.Text == "Examination Fee")
                {
                    using (con = new SqlConnection(cs))
                    {
                        SqlCommand cmd = new SqlCommand("select ExaminationFeeAmount from dbo.MasterFee where YearOfAdmission=@yoa and SessionId=@sessionid and DepttId=@depttid", con);
                        cmd.Parameters.AddWithValue("@yoa", ddlBatch.Text);
                        cmd.Parameters.AddWithValue("@sessionid", FeeHelper.convertsessionnametoid(ddlSessionName.Text));
                        cmd.Parameters.AddWithValue("@depttid", FeeHelper2.ConvertDepartmentNameToId(ddlDepttName.Text));
                        con.Open();
                        SqlDataReader rdr = cmd.ExecuteReader();
                        if (rdr.Read())
                        {
                            lbltempfee.Text = rdr["ExaminationFeeAmount"].ToString();
                        }
                    }
                }
                if (ddlFeeType.Text == "Tution Fee")
                {
                    using (con = new SqlConnection(cs))
                    {
                        SqlCommand cmd = new SqlCommand("select TutionFeeAmount from dbo.MasterFee where YearOfAdmission=@yoa and SessionId=@sessionid and DepttId=@depttid", con);
                        cmd.Parameters.AddWithValue("@yoa", ddlBatch.Text);
                        cmd.Parameters.AddWithValue("@sessionid", FeeHelper.convertsessionnametoid(ddlSessionName.Text));
                        cmd.Parameters.AddWithValue("@depttid", FeeHelper2.ConvertDepartmentNameToId(ddlDepttName.Text));
                        con.Open();
                        SqlDataReader rdr = cmd.ExecuteReader();
                        if (rdr.Read())
                        {
                            lbltempfee.Text = rdr["TutionFeeAmount"].ToString();
                        }
                    }
                }
            }
            catch (Exception)
            {
            }

            try
            {
                using (SqlConnection con = new SqlConnection(cs))
                {
                    SqlCommand cmd = new SqlCommand("SELECT distinct StudentFeeStatus.txn_id as Id, Students.StudentFullName as Student_Name, Students.Rollno, Deptts.DepttShortName as Department, Students.Batch, Session.SessionName as Session, StudentFeeStatus.FeeAmount as Amount, StudentFeeStatus.Semester, StudentFeeStatus.TimeStamp as Date_Paid FROM StudentFeeStatus INNER JOIN Session ON StudentFeeStatus.SessionId = Session.SessionId INNER JOIN Students ON StudentFeeStatus.Rollno = Students.Rollno CROSS JOIN Deptts where Deptts.DepttID=@depttid and SessionName = @sessionName and Batch = @batch and StudentFeeStatus.Status = 'completed' and FeeAmount=@feeamount", con);
                    cmd.Parameters.AddWithValue("@depttid", FeeHelper2.ConvertDepartmentNameToId(ddlDepttName.Text));
                    cmd.Parameters.AddWithValue("@sessionName", ddlSessionName.Text);
                    cmd.Parameters.AddWithValue("@batch", ddlBatch.Text);
                    cmd.Parameters.AddWithValue("@feeamount", lbltempfee.Text);
                    con.Open();
                    SqlDataReader rdr = cmd.ExecuteReader();

                    gvStudentFeeRecieptAdmin.DataSource = rdr;
                    gvStudentFeeRecieptAdmin.DataBind();
                }
            }
            catch (Exception)
            {
            }
        }