public static TMSFeesSetup Get(System.Int64 feesSetupID) { DataSet ds; Database db; string sqlCommand; DbCommand dbCommand; TMSFeesSetup instance; instance = new TMSFeesSetup(); db = DatabaseFactory.CreateDatabase(); sqlCommand = "[dbo].gspTMSFeesSetup_SELECT"; dbCommand = db.GetStoredProcCommand(sqlCommand, feesSetupID); // Get results. ds = db.ExecuteDataSet(dbCommand); // Verification. if (ds == null || ds.Tables[0].Rows.Count == 0) { throw new ApplicationException("Could not get TMSFeesSetup ID:" + feesSetupID.ToString() + " from Database."); } // Return results. ds.Tables[0].TableName = TABLE_NAME; instance.MapFrom(ds.Tables[0].Rows[0]); return(instance); }
public static TMSFeesSetup[] Search(System.Int64?feesSetupID, System.Int32?schoolCategoryID, System.Int32?schoolSubcategoryID, System.Int32?feesCategoryID, System.Int64?feesTermID, System.Int32?feesHeadID, System.Int32?studentTypeID, System.Decimal?feesAmount, System.DateTime?createdDate, System.Boolean?isDelete) { DataSet ds; Database db; string sqlCommand; DbCommand dbCommand; db = DatabaseFactory.CreateDatabase(); sqlCommand = "[dbo].gspTMSFeesSetup_SEARCH"; dbCommand = db.GetStoredProcCommand(sqlCommand, feesSetupID, schoolCategoryID, schoolSubcategoryID, feesCategoryID, feesTermID, feesHeadID, studentTypeID, feesAmount, createdDate, isDelete); ds = db.ExecuteDataSet(dbCommand); ds.Tables[0].TableName = TABLE_NAME; return(TMSFeesSetup.MapFrom(ds)); }
protected void grdFeesSetup_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName.Equals("AddNew")) { TMSFeesSetup objFeesSetup = new TMSFeesSetup(); objFeesSetup.FeesAmount = Convert.ToDecimal(((TextBox)grdFeesSetup.FooterRow.FindControl("txtNewFeesAmount")).Text); objFeesSetup.SchoolCategoryID = Convert.ToInt32(((DropDownList)grdFeesSetup.FooterRow.FindControl("drpNewdrpSchoolCategory")).SelectedValue); objFeesSetup.SchoolSubcategoryID = Convert.ToInt32(((DropDownList)grdFeesSetup.FooterRow.FindControl("drpNewSchoolSubCategoryName")).SelectedValue); objFeesSetup.FeesCategoryID = Convert.ToInt32(((DropDownList)grdFeesSetup.FooterRow.FindControl("drpNewFeeCategoryName")).SelectedValue); objFeesSetup.FeesHeadID = Convert.ToInt32(((DropDownList)grdFeesSetup.FooterRow.FindControl("drpNewFeeHeadName")).SelectedValue); objFeesSetup.FeesTermID = Convert.ToInt32(((DropDownList)grdFeesSetup.FooterRow.FindControl("drpNewFeeTerm")).SelectedValue); objFeesSetup.CreatedDate = DateTime.Now; objFeesSetup.IsDelete = false; objFeesSetup.Insert(); grdFeesSetup.EditIndex = -1; BindFeesSetup(); } }
private void BindFeesSetup() { var dsFeesSetup = TMSFeesSetup.GetAllFeesSetup(); if (dsFeesSetup.Tables[0].Rows.Count < 1) { DataRow rw = dsFeesSetup.Tables[0].NewRow(); rw["SC_CategoryName"] = rw["SSC_SubCategoryName"] = rw["FeeCategoryName"] = rw["FeeHeadName"] = rw["FeesTerm"] = ""; rw["FeesHeadID"] = rw["FeesCategoryID"] = rw["SchoolCategoryID"] = 0; dsFeesSetup.Tables[0].Rows.InsertAt(rw, 0); grdFeesSetup.DataSource = dsFeesSetup.Tables[0]; grdFeesSetup.DataBind(); grdFeesSetup.Rows[0].Visible = false; } else { grdFeesSetup.DataSource = dsFeesSetup.Tables[0]; grdFeesSetup.DataBind(); } }
protected void grdFeesSetup_UpdateRow(object sendedr, GridViewUpdateEventArgs e) { int feeHeadID = Convert.ToInt32(grdFeesSetup.DataKeys[e.RowIndex].Value.ToString()); GridViewRow row = grdFeesSetup.Rows[e.RowIndex] as GridViewRow; if (feeHeadID != 0) { TMSFeesSetup objFeesSetup = new TMSFeesSetup(); objFeesSetup.FeesAmount = Convert.ToDecimal(((TextBox)grdFeesSetup.FooterRow.FindControl("txtFeesAmount")).Text); objFeesSetup.SchoolCategoryID = Convert.ToInt32(((DropDownList)grdFeesSetup.FooterRow.FindControl("drpdrpSchoolCategory")).SelectedValue); objFeesSetup.SchoolSubcategoryID = Convert.ToInt32(((DropDownList)grdFeesSetup.FooterRow.FindControl("drpSchoolSubCategoryName")).SelectedValue); objFeesSetup.FeesCategoryID = Convert.ToInt32(((DropDownList)grdFeesSetup.FooterRow.FindControl("drpFeeCategoryName")).SelectedValue); objFeesSetup.FeesHeadID = Convert.ToInt32(((DropDownList)grdFeesSetup.FooterRow.FindControl("drpFeeHeadName")).SelectedValue); objFeesSetup.FeesTermID = Convert.ToInt32(((DropDownList)grdFeesSetup.FooterRow.FindControl("drpFeeTerm")).SelectedValue); objFeesSetup.Update(); } grdFeesSetup.EditIndex = -1; BindFeesSetup(); }
public static TMSFeesSetup[] MapFrom(DataSet ds) { List <TMSFeesSetup> objects; // Initialise Collection. objects = new List <TMSFeesSetup>(); // 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_FeesSetup] in DataSet."); } if (ds.Tables[TABLE_NAME].Rows.Count < 1) { throw new ApplicationException("Table [dbo].[TMS_FeesSetup] is empty."); } // Map DataSet to Instance. foreach (DataRow dr in ds.Tables[TABLE_NAME].Rows) { TMSFeesSetup instance = new TMSFeesSetup(); instance.MapFrom(dr); objects.Add(instance); } // Return collection. return(objects.ToArray()); }
public static void Update(TMSFeesSetup tMSFeesSetup, DbTransaction transaction) { tMSFeesSetup.Update(transaction); }
public static void Update(TMSFeesSetup tMSFeesSetup) { tMSFeesSetup.Update(); }
public static TMSFeesSetup[] Search(TMSFeesSetup searchObject) { return Search ( searchObject.FeesSetupID, searchObject.SchoolCategoryID, searchObject.SchoolSubcategoryID, searchObject.FeesCategoryID, searchObject.FeesTermID, searchObject.FeesHeadID, searchObject.StudentTypeID, searchObject.FeesAmount, searchObject.CreatedDate, searchObject.IsDelete); }
public static TMSFeesSetup[] MapFrom(DataSet ds) { List<TMSFeesSetup> objects; // Initialise Collection. objects = new List<TMSFeesSetup>(); // 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_FeesSetup] in DataSet."); if (ds.Tables[TABLE_NAME].Rows.Count < 1) throw new ApplicationException("Table [dbo].[TMS_FeesSetup] is empty."); // Map DataSet to Instance. foreach (DataRow dr in ds.Tables[TABLE_NAME].Rows) { TMSFeesSetup instance = new TMSFeesSetup(); instance.MapFrom(dr); objects.Add(instance); } // Return collection. return objects.ToArray(); }
public static TMSFeesSetup Get(System.Int64 feesSetupID) { DataSet ds; Database db; string sqlCommand; DbCommand dbCommand; TMSFeesSetup instance; instance = new TMSFeesSetup(); db = DatabaseFactory.CreateDatabase(); sqlCommand = "[dbo].gspTMSFeesSetup_SELECT"; dbCommand = db.GetStoredProcCommand(sqlCommand, feesSetupID); // Get results. ds = db.ExecuteDataSet(dbCommand); // Verification. if (ds == null || ds.Tables[0].Rows.Count == 0) throw new ApplicationException("Could not get TMSFeesSetup ID:" + feesSetupID.ToString()+ " from Database."); // Return results. ds.Tables[0].TableName = TABLE_NAME; instance.MapFrom( ds.Tables[0].Rows[0] ); return instance; }
public static TMSFeesSetup[] Search(TMSFeesSetup searchObject) { return(Search(searchObject.FeesSetupID, searchObject.SchoolCategoryID, searchObject.SchoolSubcategoryID, searchObject.FeesCategoryID, searchObject.FeesTermID, searchObject.FeesHeadID, searchObject.StudentTypeID, searchObject.FeesAmount, searchObject.CreatedDate, searchObject.IsDelete)); }