private void btnSave_Click(object sender, EventArgs e) { try { if (Validate_Controls()) { string setting_Code = Convert.ToString(ddlSettingType.SelectedValue); Int32 academic_Year = Convert.ToInt32(ddlAcademicYear.SelectedValue); Int32? Half_Tution_Fee = null; if (!String.IsNullOrEmpty(txtAmount.Text)) { Half_Tution_Fee = Convert.ToInt32(txtAmount.Text); } _repository_Object = new Student_Fee_Setting(); short result = _repository_Object.Save_Student_Fee_Info((long)_student_Id, _receipt_No, setting_Code, academic_Year, Comma_Seprated_Months_Value(), Half_Tution_Fee); if (result == 1) { MessageBox.Show("Student setting has been saved.", "Student Fee Setting", MessageBoxButtons.OK, MessageBoxIcon.Information); Clear_Control(); } } } catch (Exception ex) { MessageBox.Show("Error: Please contact to support team.", "Student Fee Setting", MessageBoxButtons.OK, MessageBoxIcon.Information); } finally { } }
/// <summary> /// Get All Applicable Months From DB & Disable CheckBox /// </summary> private void Get_All_Appllicable_Months() { _repository_Object = new Student_Fee_Setting(); List <Student_Fee_Info_Months_Model> listCheckedMonths = _repository_Object.Get_Student_Fee_Setting_Months((long)_student_Id, Convert.ToInt32(ddlAcademicYear.SelectedValue)); if (listCheckedMonths != null) { foreach (Student_Fee_Info_Months_Model item in listCheckedMonths) { listMonthCkheckBoxList.Where(x => x.Value == item.MonthValue) .Select(x => { x.CheckBox.Enabled = false; return(x); }).ToList(); } } Check_Is_Fee_Generated_For_Current_Month(); }
/// <summary> /// Bind Fee Info Type Drrop Down /// </summary> private void Bind_Student_Fee_Info_Type_Drop_Down() { List <Student_Fee_Info_Type> list_Student_Info = new List <Student_Fee_Info_Type>(); list_Student_Info.Add(new Student_Fee_Info_Type { Fee_Info_Code = "0", Fee_Info_Type = "Select" }); _repository_Object = new Student_Fee_Setting(); List <Student_Fee_Info_Type> list_Student_Info_Output = _repository_Object.Get_Student_Fee_Info_Type(false); if (list_Student_Info_Output != null) { list_Student_Info.AddRange(list_Student_Info_Output); } ddlSettingType.DataSource = list_Student_Info; ddlSettingType.DisplayMember = "Fee_Info_Type"; ddlSettingType.ValueMember = "Fee_Info_Code"; }
/// <summary> /// Get Receipt No By Setting Type If Already Saved /// </summary> private void Get_Student_Fee_Info_Receipt_No() { Int32 academic_Year = Convert.ToInt32(ddlAcademicYear.SelectedValue); string setting_Code = Convert.ToString(ddlSettingType.SelectedValue); _repository_Object = new Student_Fee_Setting(); Student_Fee_Info_Receipt_Model model = _repository_Object.Get_Student_Fee_Info_Receipt_No((long)_student_Id, academic_Year, setting_Code); if (model != null) { _receipt_No = model.Receipt_No; lblReceipt_No.Text = Convert.ToString(_receipt_No); txtAmount.Text = model.Half_Tution_Fee == null ? string.Empty : Convert.ToString(model.Half_Tution_Fee); } else { _receipt_No = null; lblReceipt_No.Text = String.Empty; } }
private void Get_Student_Fee_Info_Report() { try { _student_Fee_Setting = new Student_Fee_Setting(); string setting_Code = Convert.ToString(ddlSettingType.SelectedValue); Int32 academic_Year = Convert.ToInt32(ddlAcademicYear.SelectedValue); DataSet dsPartialReport = _student_Fee_Setting.Get_Student_Fee_Info_Report(academic_Year, setting_Code); if (dsPartialReport != null && dsPartialReport.Tables[1].Rows.Count > 0) { dsPartialReport.Tables[0].TableName = "DT_Student_Fee_Info"; dsPartialReport.Tables[1].TableName = "DT_School"; ReportDocument rdoc = new ReportDocument(); rdoc.Load(_appPath + "Reports\\Student_Fee_Info_Report.rpt"); rdoc.SetDataSource(dsPartialReport); //rdoc.SetParameterValue("Heading_Text", ddlSettingType.SelectedText); //rdoc.SetParameterValue("Fee_Code", Convert.ToString(ddlSettingType.SelectedValue)); //crystalReportViewer.ParameterFieldInfo.Clear(); crystalReportViewer.ReportSource = rdoc; rdoc.Refresh(); crystalReportViewer.Refresh(); crystalReportViewer.Show(); crystalReportViewer.Visible = true; } else { crystalReportViewer.Visible = false; MessageBox.Show("No Result Found.", "Partial Fee", MessageBoxButtons.OK, MessageBoxIcon.Information); } } catch (Exception ex) { } }