public static TMSBusMaintananceDetails Get(System.Int64 bsmMentananceID) { DataSet ds; Database db; string sqlCommand; DbCommand dbCommand; TMSBusMaintananceDetails instance; instance = new TMSBusMaintananceDetails(); db = DatabaseFactory.CreateDatabase(); sqlCommand = "[dbo].gspTMSBusMaintananceDetails_SELECT"; dbCommand = db.GetStoredProcCommand(sqlCommand, bsmMentananceID); // Get results. ds = db.ExecuteDataSet(dbCommand); // Verification. if (ds == null || ds.Tables[0].Rows.Count == 0) { throw new ApplicationException("Could not get TMSBusMaintananceDetails ID:" + bsmMentananceID.ToString() + " from Database."); } // Return results. ds.Tables[0].TableName = TABLE_NAME; instance.MapFrom(ds.Tables[0].Rows[0]); return(instance); }
public static TMSBusMaintananceDetails[] Search(System.Int64?bsmMentananceID, System.String bsmBusID, System.Int64?bsmBusDetailsId, System.String bsmBusNumber, System.String bsmBusTravels, System.String bsmBusMilage, System.String bsmMonth, System.String bsmYear, System.Int64?bsmBusRootID, System.String bsmMonthlyMaintenancecost, System.String bsmStartPoint, System.String bsmEndPoint, System.String bsmExtra, System.DateTime?bsmDate, System.Int32?bsmStatus) { DataSet ds; Database db; string sqlCommand; DbCommand dbCommand; db = DatabaseFactory.CreateDatabase(); sqlCommand = "[dbo].gspTMSBusMaintananceDetails_SEARCH"; dbCommand = db.GetStoredProcCommand(sqlCommand, bsmMentananceID, bsmBusID, bsmBusDetailsId, bsmBusNumber, bsmBusTravels, bsmBusMilage, bsmMonth, bsmYear, bsmBusRootID, bsmMonthlyMaintenancecost, bsmStartPoint, bsmEndPoint, bsmExtra, bsmDate, bsmStatus); ds = db.ExecuteDataSet(dbCommand); ds.Tables[0].TableName = TABLE_NAME; return(TMSBusMaintananceDetails.MapFrom(ds)); }
protected void FillBusDriverSalaryDetails() { string Month = null; string Year = null; if (ddlMonth.SelectedValue != "-1") { Month = ddlMonth.SelectedValue; } if (ddlYear.SelectedValue != "-1") { Year = ddlYear.SelectedValue; } DataTable dt = TMSBusMaintananceDetails.GetStaffSalaryDetails(null, Convert.ToInt64(Session["UserId"]), "Driver", null, Month, Year, "4").Tables[0]; GriedViewDriver.DataSource = dt; GriedViewDriver.DataBind(); }
protected void lnkViewSalarySlip_Details(object sender, EventArgs e) { try { PanSalarySection.Visible = true; LinkButton lnk = (LinkButton)sender; GridViewRow lml = (GridViewRow)lnk.NamingContainer; Label lblSalaryDetailsId = lml.FindControl("lblsalDetailsId") as Label; DataTable dt = TMSBusMaintananceDetails.GetStaffSalaryDetails(Convert.ToInt64(lblSalaryDetailsId.Text), Convert.ToInt64(Session["UserId"]), "Driver", null, null, null, "4").Tables[0]; // TMSSalaryDetails objSalary = TMSSalaryDetails.Get(SalaryDetailsId); if (dt.Rows.Count > 0) { lblMonthName.Text = dt.Rows[0]["SI_Month"].ToString(); lblYearName.Text = dt.Rows[0]["SI_Year"].ToString(); Decimal GrossSalary = Convert.ToDecimal(dt.Rows[0]["SI_GrossSalary"].ToString()); Decimal DeductionAmt = Convert.ToDecimal(dt.Rows[0]["SI_LeaveDeductionAmount"].ToString()); Decimal NetSal = GrossSalary - DeductionAmt; lblNetSalary.Text = Convert.ToString(NetSal); lblNetSalWord.Text = NumberToWords(Convert.ToInt32(lblNetSalary.Text)).ToUpper(); grdSalarySlip.DataSource = dt; grdSalarySlip.DataBind(); lblEmployeeNmae.Text = Convert.ToString(dt.Rows[0]["BSD_StaffName"].ToString()); lblJoiningDtae.Text = String.Format("{0:dd MMM yyyy}", dt.Rows[0]["BSD_DateOfJoining"]); //lblDept.Text = Convert.ToString(dtFacultyDetails.Rows[0]["FD_SpecificExpertise"]); lblDesignation.Text = Convert.ToString(dt.Rows[0]["BSD_StaffType"]); //lblEmpCode.Text = Convert.ToString(dtFacultyDetails.Rows[0][""]); //lblLocation.Text = Convert.ToString(dtFacultyDetails.Rows[0]["FacultyCity"]); } Control p = lnk.Parent; AjaxControlToolkit.ModalPopupExtender SalarySlipPopUp = (AjaxControlToolkit.ModalPopupExtender)p.FindControl("SalarySlipPopUp"); SalarySlipPopUp.Show(); } catch (Exception ex) { } }
public static TMSBusMaintananceDetails[] MapFrom(DataSet ds) { List <TMSBusMaintananceDetails> objects; // Initialise Collection. objects = new List <TMSBusMaintananceDetails>(); // 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_BusMaintananceDetails] in DataSet."); } if (ds.Tables[TABLE_NAME].Rows.Count < 1) { throw new ApplicationException("Table [dbo].[TMS_BusMaintananceDetails] is empty."); } // Map DataSet to Instance. foreach (DataRow dr in ds.Tables[TABLE_NAME].Rows) { TMSBusMaintananceDetails instance = new TMSBusMaintananceDetails(); instance.MapFrom(dr); objects.Add(instance); } // Return collection. return(objects.ToArray()); }
public static void Update(TMSBusMaintananceDetails tMSBusMaintananceDetails, DbTransaction transaction) { tMSBusMaintananceDetails.Update(transaction); }
public static void Update(TMSBusMaintananceDetails tMSBusMaintananceDetails) { tMSBusMaintananceDetails.Update(); }
public static TMSBusMaintananceDetails[] Search(TMSBusMaintananceDetails searchObject) { return Search ( searchObject.BSMMentananceID, searchObject.BSMBusID, searchObject.BSMBusDetailsId, searchObject.BSMBusNumber, searchObject.BSMBusTravels, searchObject.BSMBusMilage, searchObject.BSMMonth, searchObject.BSMYear, searchObject.BSMBusRootID, searchObject.BSMMonthlyMaintenancecost, searchObject.BSMStartPoint, searchObject.BSMEndPoint, searchObject.BSMExtra, searchObject.BSMDate, searchObject.BSMStatus); }
public static TMSBusMaintananceDetails[] MapFrom(DataSet ds) { List<TMSBusMaintananceDetails> objects; // Initialise Collection. objects = new List<TMSBusMaintananceDetails>(); // 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_BusMaintananceDetails] in DataSet."); if (ds.Tables[TABLE_NAME].Rows.Count < 1) throw new ApplicationException("Table [dbo].[TMS_BusMaintananceDetails] is empty."); // Map DataSet to Instance. foreach (DataRow dr in ds.Tables[TABLE_NAME].Rows) { TMSBusMaintananceDetails instance = new TMSBusMaintananceDetails(); instance.MapFrom(dr); objects.Add(instance); } // Return collection. return objects.ToArray(); }
public static TMSBusMaintananceDetails Get(System.Int64 bsmMentananceID) { DataSet ds; Database db; string sqlCommand; DbCommand dbCommand; TMSBusMaintananceDetails instance; instance = new TMSBusMaintananceDetails(); db = DatabaseFactory.CreateDatabase(); sqlCommand = "[dbo].gspTMSBusMaintananceDetails_SELECT"; dbCommand = db.GetStoredProcCommand(sqlCommand, bsmMentananceID); // Get results. ds = db.ExecuteDataSet(dbCommand); // Verification. if (ds == null || ds.Tables[0].Rows.Count == 0) throw new ApplicationException("Could not get TMSBusMaintananceDetails ID:" + bsmMentananceID.ToString()+ " from Database."); // Return results. ds.Tables[0].TableName = TABLE_NAME; instance.MapFrom( ds.Tables[0].Rows[0] ); return instance; }
public static DataSet GetSearch(TMSBusMaintananceDetails searchObject) { return(GetSearch(searchObject.BSMMentananceID, searchObject.BSMBusID, searchObject.BSMBusDetailsId, searchObject.BSMBusNumber, searchObject.BSMBusTravels, searchObject.BSMBusMilage, searchObject.BSMMonth, searchObject.BSMYear, searchObject.BSMBusRootID, searchObject.BSMMonthlyMaintenancecost, searchObject.BSMStartPoint, searchObject.BSMEndPoint, searchObject.BSMExtra, searchObject.BSMDate, searchObject.BSMStatus)); }