public static TMSFeesAndPaymentDetails Get(System.Int64 sfpDetailsId) { DataSet ds; Database db; string sqlCommand; DbCommand dbCommand; TMSFeesAndPaymentDetails instance; instance = new TMSFeesAndPaymentDetails(); db = DatabaseFactory.CreateDatabase(); sqlCommand = "[dbo].gspTMSFeesAndPaymentDetails_SELECT"; dbCommand = db.GetStoredProcCommand(sqlCommand, sfpDetailsId); // Get results. ds = db.ExecuteDataSet(dbCommand); // Verification. if (ds == null || ds.Tables[0].Rows.Count == 0) { throw new ApplicationException("Could not get TMSFeesAndPaymentDetails ID:" + sfpDetailsId.ToString() + " from Database."); } // Return results. ds.Tables[0].TableName = TABLE_NAME; instance.MapFrom(ds.Tables[0].Rows[0]); return(instance); }
protected void grdFeesPayment_UpdateRow(object sendedr, GridViewUpdateEventArgs e) { try { // Int64 SD_loginId = Convert.ToInt64(grdFeesPayment.DataKeys[e.RowIndex].Value); GridViewRow row = grdFeesPayment.Rows[e.RowIndex] as GridViewRow; Label lblStudentLoginId = row.FindControl("lblStudentLoginId") as Label; Label ldlStudentDivisionId = row.FindControl("ldlStudentDivisionId") as Label; Label ldlStudentStandardId = row.FindControl("ldlStudentStandardId") as Label; Label lblDetailsId = row.FindControl("lblDetailsId") as Label; TextBox txtTotalFees = row.FindControl("txtTotalFees") as TextBox; TextBox txtFeesPaid = row.FindControl("txtFeesPaid") as TextBox; if (lblDetailsId.Text != "0") { TMSFeesAndPaymentDetails objfeesdetails = TMSFeesAndPaymentDetails.Get(Convert.ToInt64(lblDetailsId.Text)); objfeesdetails.SFPStudentLoginId = Convert.ToInt64(lblStudentLoginId.Text); objfeesdetails.SFTPaidFees = Convert.ToDouble(txtFeesPaid.Text); objfeesdetails.SFPTotalFees = Convert.ToDouble(txtTotalFees.Text); objfeesdetails.SFPRemainingFees = Convert.ToDouble(Convert.ToDouble(txtTotalFees.Text) - Convert.ToDouble(txtFeesPaid.Text)); objfeesdetails.Update(); } else { TMSFeesAndPaymentDetails objfees = new TMSFeesAndPaymentDetails(); objfees.SFPStudentLoginId = Convert.ToInt64(lblStudentLoginId.Text); if (ldlStudentStandardId.Text != "") { objfees.SFPStandardId = Convert.ToInt64(ldlStudentStandardId.Text); } if (ldlStudentDivisionId.Text != "") { objfees.SFPDivisionId = Convert.ToInt64(ldlStudentDivisionId.Text); } objfees.SFPTotalFees = Convert.ToDouble(txtTotalFees.Text); objfees.SFTPaidFees = Convert.ToDouble(txtFeesPaid.Text); objfees.SFPAddedById = Convert.ToInt64(Session["UserId"]); objfees.SFPRemainingFees = Convert.ToDouble(Convert.ToDouble(txtTotalFees.Text) - Convert.ToDouble(txtFeesPaid.Text)); objfees.SFPMonth = ddlMonth.SelectedValue; objfees.SFPYear = ddlYear.SelectedValue; objfees.SFPAddedByRemark = "Student Fees"; objfees.SFPTransactionDate = DateTime.Now; objfees.SFPStatus = 1; objfees.Insert(); } grdFeesPayment.EditIndex = -1; BindStudents(); } catch (Exception ex) { } }
public static TMSFeesAndPaymentDetails[] Search(System.Int64?sfpDetailsId, System.Int64?sfpStudentLoginId, System.Int64?sfpStandardId, System.Int64?sfpDivisionId, System.Double?sfpTotalFees, System.Double?sftPaidFees, System.Double?sfpRemainingFees, System.String sfpMonth, System.String sfpYear, System.DateTime?sfpTransactionDate, System.Int64?sfpAddedById, System.String sfpAddedByRemark, System.String sfpOtherRemark, System.DateTime?sfpDate, System.Int32?sfpStatus) { DataSet ds; Database db; string sqlCommand; DbCommand dbCommand; db = DatabaseFactory.CreateDatabase(); sqlCommand = "[dbo].gspTMSFeesAndPaymentDetails_SEARCH"; dbCommand = db.GetStoredProcCommand(sqlCommand, sfpDetailsId, sfpStudentLoginId, sfpStandardId, sfpDivisionId, sfpTotalFees, sftPaidFees, sfpRemainingFees, sfpMonth, sfpYear, sfpTransactionDate, sfpAddedById, sfpAddedByRemark, sfpOtherRemark, sfpDate, sfpStatus); ds = db.ExecuteDataSet(dbCommand); ds.Tables[0].TableName = TABLE_NAME; return(TMSFeesAndPaymentDetails.MapFrom(ds)); }
protected void BindStudents() { try { Int64? Standard = null; Int64? Division = null; string month = null, year = null; if (ddlStandard.SelectedValue != "-1") { Standard = Convert.ToInt64(ddlStandard.SelectedValue); } if (ddlDivision.SelectedValue != "-1") { Division = Convert.ToInt64(ddlDivision.SelectedValue); } if (ddlMonth.SelectedValue != "-1") { month = ddlMonth.SelectedValue; } if (ddlYear.SelectedValue != "-1") { year = ddlYear.SelectedValue; } if (HiddenType.Value == "All") { DataTable DtFeesDetails = TMSFeesAndPaymentDetails.GetStudentFeesDetails(null, Standard, Division, null, month, year, null).Tables[0]; grdFeesPayment.DataSource = DtFeesDetails; grdFeesPayment.DataBind(); } else { DataTable DtFeesDetails = TMSFeesAndPaymentDetails.GetStudentFeesDetails(null, Standard, Division, null, month, year, "ViewType").Tables[0]; grdFeesPayment.DataSource = DtFeesDetails; grdFeesPayment.DataBind(); } } catch (Exception ex) { } }
public static TMSFeesAndPaymentDetails[] MapFrom(DataSet ds) { List <TMSFeesAndPaymentDetails> objects; // Initialise Collection. objects = new List <TMSFeesAndPaymentDetails>(); // Validation. if (ds == null) { throw new ApplicationException("Cannot map to dataset null."); } else if (ds.Tables[TABLE_NAME].Rows.Count == 0) { return(objects.ToArray()); } if (ds.Tables[TABLE_NAME] == null) { throw new ApplicationException("Cannot find table [dbo].[TMS_FeesAndPaymentDetails] in DataSet."); } if (ds.Tables[TABLE_NAME].Rows.Count < 1) { throw new ApplicationException("Table [dbo].[TMS_FeesAndPaymentDetails] is empty."); } // Map DataSet to Instance. foreach (DataRow dr in ds.Tables[TABLE_NAME].Rows) { TMSFeesAndPaymentDetails instance = new TMSFeesAndPaymentDetails(); instance.MapFrom(dr); objects.Add(instance); } // Return collection. return(objects.ToArray()); }
public static void Update(TMSFeesAndPaymentDetails tMSFeesAndPaymentDetails, DbTransaction transaction) { tMSFeesAndPaymentDetails.Update(transaction); }
public static void Update(TMSFeesAndPaymentDetails tMSFeesAndPaymentDetails) { tMSFeesAndPaymentDetails.Update(); }
public static TMSFeesAndPaymentDetails[] Search(TMSFeesAndPaymentDetails searchObject) { return Search ( searchObject.SFPDetailsId, searchObject.SFPStudentLoginId, searchObject.SFPStandardId, searchObject.SFPDivisionId, searchObject.SFPTotalFees, searchObject.SFTPaidFees, searchObject.SFPRemainingFees, searchObject.SFPMonth, searchObject.SFPYear, searchObject.SFPTransactionDate, searchObject.SFPAddedById, searchObject.SFPAddedByRemark, searchObject.SFPOtherRemark, searchObject.SFPDate, searchObject.SFPStatus); }
public static TMSFeesAndPaymentDetails[] MapFrom(DataSet ds) { List<TMSFeesAndPaymentDetails> objects; // Initialise Collection. objects = new List<TMSFeesAndPaymentDetails>(); // Validation. if (ds == null) throw new ApplicationException("Cannot map to dataset null."); else if (ds.Tables[TABLE_NAME].Rows.Count == 0) return objects.ToArray(); if (ds.Tables[TABLE_NAME] == null) throw new ApplicationException("Cannot find table [dbo].[TMS_FeesAndPaymentDetails] in DataSet."); if (ds.Tables[TABLE_NAME].Rows.Count < 1) throw new ApplicationException("Table [dbo].[TMS_FeesAndPaymentDetails] is empty."); // Map DataSet to Instance. foreach (DataRow dr in ds.Tables[TABLE_NAME].Rows) { TMSFeesAndPaymentDetails instance = new TMSFeesAndPaymentDetails(); instance.MapFrom(dr); objects.Add(instance); } // Return collection. return objects.ToArray(); }
public static TMSFeesAndPaymentDetails Get(System.Int64 sfpDetailsId) { DataSet ds; Database db; string sqlCommand; DbCommand dbCommand; TMSFeesAndPaymentDetails instance; instance = new TMSFeesAndPaymentDetails(); db = DatabaseFactory.CreateDatabase(); sqlCommand = "[dbo].gspTMSFeesAndPaymentDetails_SELECT"; dbCommand = db.GetStoredProcCommand(sqlCommand, sfpDetailsId); // Get results. ds = db.ExecuteDataSet(dbCommand); // Verification. if (ds == null || ds.Tables[0].Rows.Count == 0) throw new ApplicationException("Could not get TMSFeesAndPaymentDetails ID:" + sfpDetailsId.ToString()+ " from Database."); // Return results. ds.Tables[0].TableName = TABLE_NAME; instance.MapFrom( ds.Tables[0].Rows[0] ); return instance; }
public static TMSFeesAndPaymentDetails[] Search(TMSFeesAndPaymentDetails searchObject) { return(Search(searchObject.SFPDetailsId, searchObject.SFPStudentLoginId, searchObject.SFPStandardId, searchObject.SFPDivisionId, searchObject.SFPTotalFees, searchObject.SFTPaidFees, searchObject.SFPRemainingFees, searchObject.SFPMonth, searchObject.SFPYear, searchObject.SFPTransactionDate, searchObject.SFPAddedById, searchObject.SFPAddedByRemark, searchObject.SFPOtherRemark, searchObject.SFPDate, searchObject.SFPStatus)); }