protected void txtEnrollNo_TextChanged(object sender, EventArgs e) { var getRec = new GetFlyRec(); var obj_ = new simsdb(); var row_ = new Student_EnrRow(); row_ = obj_.Student_EnrCollection.GetRow("FormNo='" + txtEnrollNo.Text.Trim() + "'"); txtStudentName.Text = row_.Student_Name.ToString(); txtFatherName.Text = row_.FatherName.ToString(); obj_.Dispose(); string GridQry_ = ""; GridQry_ = "SELECT dbo.StudentFeeCard.FeeGenID, dbo.Session.SessionName, dbo.Program.ProgramDesc, dbo.StudentFeeCard.EnrollNo, dbo.StudentFeeCard.StudentName, dbo.StudentFeeCard.FatherName," + "cast(dbo.StudentFeeCard.Month+'-'+cast(dbo.StudentFeeCard.Year as varchar) as varchar) as Month_Year, dbo.StudentFeeCard.CurrentClassEnrolled, dbo.StudentFeeCard.AdmissionFee, dbo.StudentFeeCard.AdmProcessFee, dbo.StudentFeeCard.OnlineFee, dbo.StudentFeeCard.BuildingFee," + "dbo.StudentFeeCard.TutionFee, dbo.StudentFeeCard.LibraryFee, dbo.StudentFeeCard.ScienceLabFee, dbo.StudentFeeCard.CSLabFee, dbo.StudentFeeCard.ExamFee, dbo.StudentFeeCard.CertificateIssueFee," + "dbo.StudentFeeCard.AnnualCharges, dbo.StudentFeeCard.Misc, dbo.StudentFeeCard.Desciption, dbo.StudentFeeCard.OtherFee, dbo.StudentFeeCard.Comments, dbo.StudentFeeCard.Note_Comments, " + "dbo.StudentFeeCard.Mood_Payment, dbo.StudentFeeCard.Chk_No, dbo.StudentFeeCard.Bank_Detail, dbo.StudentFeeCard.DateCreated, dbo.StudentFeeCard.SessionID, dbo.StudentFeeCard.ProgramID " + "FROM dbo.StudentFeeCard INNER JOIN " + "dbo.Session ON dbo.StudentFeeCard.SessionID = dbo.Session.SessionID INNER JOIN " + "dbo.Program ON dbo.StudentFeeCard.ProgramID = dbo.Program.ProgramID INNER JOIN " + "dbo.FlagSetter ON dbo.StudentFeeCard.FlagID = dbo.FlagSetter.FlagID " + "WHERE (dbo.StudentFeeCard.EnrollNo ='" + txtEnrollNo.Text + "') ORDER BY dbo.StudentFeeCard.StudentName"; DataTable dt_ = getRec.Getdt(GridQry_); _GetShowRecGrid(dt_); _gvList.DataBind(); }
protected void btnSave_Click(object sender, EventArgs e) { using (var obj_ = new simsdb()) { var row_ = new StudentFeeCardRow(); row_.SessionID = Convert.ToInt32(cmbSession.SelectedValue); row_.ProgramID = Convert.ToInt32(cmbProgram.SelectedValue); row_.FeeStructureID = Convert.ToInt32(cmbFeeStructure.SelectedValue); row_.EnrollNo = txtEnrollNo.Text.ToUpper(); row_.StudentName = txtStudentName.Text; row_.FatherName = txtFatherName.Text; row_.Year = Convert.ToInt32(cmbYear.SelectedItem.Text); row_.Month = cmbMonth.SelectedItem.Text; row_.AdmissionFee = Convert.ToInt32(txtAdmissionFee.Text); row_.AdmProcessFee = Convert.ToInt32(txtAdmissionFee.Text); row_.OnlineFee = Convert.ToInt32(txtBuildingFee.Text); row_.BuildingFee = Convert.ToInt32(txtBuildingFee.Text); row_.TutionFee = Convert.ToInt32(txtTutionFee.Text); row_.LibraryFee = Convert.ToInt32(txtLibraryFee.Text); row_.ScienceLabFee = Convert.ToInt32(txtScienceLabFee.Text); row_.CSLabFee = Convert.ToInt32(txtCSLabFee.Text); row_.ExamFee = Convert.ToInt32(txtExaminationFee.Text); row_.CertificateIssueFee = Convert.ToInt32(txtCertificateIssuanceFee.Text); row_.AnnualCharges = Convert.ToInt32(txtOtherAnualCharges.Text); row_.Misc = Convert.ToInt32(txtMicsFeeStructure.Text); row_.Desciption = txtCommentsDesc.Text; row_.OtherFee = Convert.ToInt32(txtOtherFee.Text); row_.Comments = txtComments_.Text; row_.Note_Comments = txtNote.Text; row_.Mood_Payment = cmbMoodofPayment.SelectedItem.Text; row_.Chk_No = txtChequeOtherNo.Text; row_.Bank_Detail = txtBankDetail.Text; row_.DateCreated = Convert.ToDateTime(System.DateTime.Now.ToLongDateString().ToString()); row_.DateModified = Convert.ToDateTime(System.DateTime.Now.ToLongDateString().ToString()); row_.ModifiedBy = "zaheer"; row_.IsDeleted = false; row_.FlagID = Convert.ToInt32(cmbFlag.SelectedValue); obj_.StudentFeeCardCollection.Insert(row_); // var getRec_ = new GetFlyRec(); string GridQry_ = ""; GridQry_ = "SELECT dbo.StudentFeeCard.FeeGenID, dbo.Session.SessionName, dbo.Program.ProgramDesc, dbo.StudentFeeCard.EnrollNo, dbo.StudentFeeCard.StudentName, dbo.StudentFeeCard.FatherName," + "cast(dbo.StudentFeeCard.Month+'-'+cast(dbo.StudentFeeCard.Year as varchar) as varchar) as Month_Year, dbo.StudentFeeCard.CurrentClassEnrolled, dbo.StudentFeeCard.AdmissionFee, dbo.StudentFeeCard.AdmProcessFee, dbo.StudentFeeCard.OnlineFee, dbo.StudentFeeCard.BuildingFee," + "dbo.StudentFeeCard.TutionFee, dbo.StudentFeeCard.LibraryFee, dbo.StudentFeeCard.ScienceLabFee, dbo.StudentFeeCard.CSLabFee, dbo.StudentFeeCard.ExamFee, dbo.StudentFeeCard.CertificateIssueFee," + "dbo.StudentFeeCard.AnnualCharges, dbo.StudentFeeCard.Misc, dbo.StudentFeeCard.Desciption, dbo.StudentFeeCard.OtherFee, dbo.StudentFeeCard.Comments, dbo.StudentFeeCard.Note_Comments, " + "dbo.StudentFeeCard.Mood_Payment, dbo.StudentFeeCard.Chk_No, dbo.StudentFeeCard.Bank_Detail, dbo.StudentFeeCard.DateCreated, dbo.StudentFeeCard.SessionID, dbo.StudentFeeCard.ProgramID " + "FROM dbo.StudentFeeCard INNER JOIN " + "dbo.Session ON dbo.StudentFeeCard.SessionID = dbo.Session.SessionID INNER JOIN " + "dbo.Program ON dbo.StudentFeeCard.ProgramID = dbo.Program.ProgramID INNER JOIN " + "dbo.FlagSetter ON dbo.StudentFeeCard.FlagID = dbo.FlagSetter.FlagID " + "WHERE (dbo.StudentFeeCard.EnrollNo ='" + txtEnrollNo.Text + "') AND (dbo.StudentFeeCard.SessionID = " + cmbSession.SelectedValue + ")" + " ORDER BY dbo.StudentFeeCard.StudentName"; DataTable dt_ = getRec_.Getdt(GridQry_); _GetShowRecGrid(dt_); } }