示例#1
0
        private void grid_Fee_List_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            int rowIndex = e.RowIndex;

            try
            {
                long   registration_No  = Convert.ToInt64(grid_Fee_List.Rows[rowIndex].Cells["col_Registration_No"].Value);
                long   student_ID       = Convert.ToInt64(grid_Fee_List.Rows[rowIndex].Cells["col_Student_ID"].Value);
                long   receiptNo        = Convert.ToInt64(grid_Fee_List.Rows[rowIndex].Cells["col_FeeReceiptNo"].Value);
                string fee_Deposit_Code = Convert.ToString(grid_Fee_List.Rows[rowIndex].Cells["col_Fee_Deposit_Code"].Value);

                #region Print Receipt
                if (e.ColumnIndex == 7)
                {
                    switch (fee_Deposit_Code)
                    {
                    case "MF":
                        Print_Monthly_Receipt(receiptNo);
                        break;

                    case "AAFP":
                        Admission_Report_Viewer_Form addFee = new Admission_Report_Viewer_Form(student_ID);
                        addFee.StartPosition = FormStartPosition.CenterParent;
                        addFee.ShowDialog(this);
                        break;

                    case "PF":
                        PurchasesFeeReportForm.instanceFrm = new PurchasesFeeReportForm(receiptNo, registration_No);
                        PurchasesFeeReportForm.instanceFrm.Show(UIParent.MDIForm.dockPanel);
                        break;

                    case "AFP":
                        Advance_Pay_Report_Viewer_Form report = new Advance_Pay_Report_Viewer_Form(student_ID, receiptNo);
                        report.StartPosition = FormStartPosition.CenterParent;
                        report.ShowDialog(this);
                        break;
                    }
                }
                #endregion
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error! Please Contact To Support Team.", "Fee Deposit List", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            finally
            {
                grid_Fee_List.ClearSelection();
            }
        }
        private void gridAdvancePay_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            int rowIndex = e.RowIndex;

            try
            {
                if (e.ColumnIndex == 0)
                {
                    long receipt_No = Convert.ToInt64(gridAdvancePay.Rows[rowIndex].Cells["col_AP_Receipt_No"].Value);
                    Student_Advance_Fee_View_Model model = Get_Advance_Pay_Details_By_Receipt_No(receipt_No);
                    if (model != null)
                    {
                        ConstructGrid(model.List_Advance_Pay);
                        Advance_Pay_Receipt_Months(model.List_Student_Fee_Info_Months);
                        lblReceiptNoLabel.Visible = true;
                        lblReceiptNo.Visible      = true;
                        lblReceiptNo.Text         = Convert.ToString(gridAdvancePay.Rows[rowIndex].Cells["col_AP_Receipt_No"].Value);
                        dtpDate.Value             = Convert.ToDateTime(gridAdvancePay.Rows[rowIndex].Cells["col_AP_Date"].Value);
                    }
                }
                if (e.ColumnIndex == 2)
                {
                    long receipt_No = Convert.ToInt64(gridAdvancePay.Rows[rowIndex].Cells["col_AP_Receipt_No"].Value);
                    Advance_Pay_Report_Viewer_Form report = new Advance_Pay_Report_Viewer_Form(_studentID, receipt_No);
                    report.StartPosition = FormStartPosition.CenterParent;
                    report.ShowDialog(this);
                }

                if (e.ColumnIndex == 3)
                {
                    long receipt_No = Convert.ToInt64(gridAdvancePay.Rows[rowIndex].Cells["col_AP_Receipt_No"].Value);
                    Delete_Records(receipt_No);
                }

                gridAdvancePay.ClearSelection();
            }
            catch (Exception ex)
            { }
            finally
            { }
        }