private void Delete_Records(long receipt_No) { try { Advance_Deposit_Fee advance_Deposit_Fee = new Advance_Deposit_Fee(); short output = advance_Deposit_Fee.Delete_Advance_Pay(receipt_No); if (output == 1) { MessageBox.Show("Record Deleted.", "Advance Fee", MessageBoxButtons.OK, MessageBoxIcon.Information); } } catch (Exception ex) { MessageBox.Show("Error! Please contact to admin.", "Advance Fee", MessageBoxButtons.OK, MessageBoxIcon.Error); } finally { txtRegistrationNo.Text = String.Empty; Reset_Control_On_DropDown_Change(); Clear_Control(); } }
private void btnSave_Click(object sender, EventArgs e) { try { #region Check Validation For Calculate Fee if (gridAdvancePay.Rows.Count >= 1 && lblReceiptNo.Visible == false) { MessageBox.Show("Please Click On Receipt No Link To Modify.", "Advance Pay", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } int checkedMonthCount = listMonthCkheckBoxList.Where(x => x.CheckBox.Checked == true && x.CheckBox.Enabled == true).Count(); if (checkedMonthCount >= 1) { if (gridAdmissionFeeType.Rows.Count == 0) { MessageBox.Show("\u2022 Please click on calculate button to calculate advance fee.\n", "Advance Pay", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } } #endregion if (Validate_Controls()) { long?_receipt_No = null; if (lblReceiptNo.Visible == true && !string.IsNullOrEmpty(lblReceiptNo.Text)) { _receipt_No = Convert.ToInt64(lblReceiptNo.Text); } List <Advance_Pay_Model> listGridData = ConvertGridToList(); //Update Student ID listGridData.Select(x => { x.Student_ID = _studentID; return(x); }).ToList(); string Addvance_Fee_XML = ConvertGridToXML(listGridData); Advance_Deposit_Fee _advance_Pay = new Advance_Deposit_Fee(); short result = _advance_Pay.Save_Advance_Pay_Fee(_studentID, _receipt_No, Addvance_Fee_XML, (Int32)ddlAcademicYear.SelectedValue, Comma_Seprated_Months_Value(), Common.Convert_String_To_Date(dtpDate.Text)); if (result == 1) { MessageBox.Show("Record Successfully Saved.", "Advance Pay", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("Error! Please contact to admin.", "Advance Pay", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } catch (Exception ex) { MessageBox.Show("Error! Please contact to admin.", "Advance Pay", MessageBoxButtons.OK, MessageBoxIcon.Error); } finally { Get_All_Appllicable_Months(); Get_Advance_Pay_Receipt_No(); } }