public SelectChildPopupView(BasicReportViewModel basicReportViewModel, FullReportViewModel fullReportViewModel) { InitializeComponent(); if (basicReportViewModel != null) { ReportViewModel = basicReportViewModel; BindingContext = basicReportViewModel; this.CloseWhenBackgroundIsClicked = true; this.BackgroundClicked += BasicReportPopupView_BackgroundClicked; } else if (fullReportViewModel != null) { FullReportViewModel = fullReportViewModel; BindingContext = fullReportViewModel; this.CloseWhenBackgroundIsClicked = true; this.BackgroundClicked += FullReportPopupView_BackgroundClicked; if (Device.RuntimePlatform == Device.iOS) { ChildPopupView.Margin = new Thickness(0, 10, 0, 0); } } if (Device.RuntimePlatform != Device.Android) { Frame1.IsVisible = childListview.IsVisible = true; childListview.ItemTapped += ChildItemTapped; AndroidFrame.IsVisible = childCollectionView.IsVisible = false; } else { Frame1.IsVisible = childListview.IsVisible = false; AndroidFrame.IsVisible = childCollectionView.IsVisible = true; } }
public SelectRecordFormPopupView(BasicReportViewModel basicReportViewModel, FullReportViewModel fullReportViewModel) { InitializeComponent(); if (basicReportViewModel != null) { ReportViewModel = basicReportViewModel; BindingContext = basicReportViewModel; this.CloseWhenBackgroundIsClicked = true; this.BackgroundClicked += BasicReportPopupView_BackgroundClicked; recordFormListview.ItemTapped += RecordFormItemTapped; if (Device.RuntimePlatform == Device.Android || Device.RuntimePlatform == Device.iOS) { recordFormListview.RowHeight = 52; } } else { FullReportViewModel = fullReportViewModel; BindingContext = fullReportViewModel; this.CloseWhenBackgroundIsClicked = true; this.BackgroundClicked += FullReportPopupView_BackgroundClicked; recordFormListview.ItemTapped += RecordFormItemTapped; if (Device.RuntimePlatform == Device.Android || Device.RuntimePlatform == Device.iOS) { recordFormListview.RowHeight = 50; } } }
public ActionResult GetReport(int id) { var reportInfo = ReportService.GetReportInfoById(id); BaseReportViewModel viewModel = null; var viewModelType = reportInfo == null ? null : Type.GetType(reportInfo.ViewModelName); if (viewModelType != null && viewModelType == typeof(StatisticalReportViewModel)) { var reportData = ReportService.GetReportById(reportInfo.ReportId, new ReportParameter { TableName = reportInfo.TableName, ColumnList = reportInfo.ColumnList ?? "a.*" }); viewModel = new StatisticalReportViewModel(reportInfo.ReportId, (StandardReport)reportData, (StandardReport) ReportService.GetReportById(reportInfo.ReportId, new ReportParameter { RowName = "1", TableName = reportInfo.TableName, ColumnList = reportInfo.ColumnList })); } else { viewModel = new BasicReportViewModel(reportInfo.ReportId, new StandardReport(id)); } viewModel.Name = reportInfo.DisplayName; viewModel.Initialization(); if (viewModel is StatisticalReportViewModel) { ViewData["IsStatisticReport_" + reportInfo.ReportId] = false; var themeName = ThemeHelper.GetTheme(Request); ((StatisticalReportViewModel)viewModel).TopChartModel.Theme = themeName; ((StatisticalReportViewModel)viewModel).BottomChartModel.Theme = themeName; } return(View(reportInfo == null ? "BasicReport" : reportInfo.ViewName, viewModel)); }
public BasicReport() { InitializeComponent(); this.CloseWhenBackgroundIsClicked = true; MyBasicReportViewModel = new BasicReportViewModel(); BindingContext = MyBasicReportViewModel; MyBasicReportViewModel.RunReport = false; }
public SelectBatteryTypePopupView(BasicReportViewModel basicReportViewModel, FullReportViewModel fullReportViewModel) { InitializeComponent(); if (basicReportViewModel != null) { ReportViewModel = basicReportViewModel; BindingContext = basicReportViewModel; this.CloseWhenBackgroundIsClicked = true; this.BackgroundClicked += BasicReportPopupView_BackgroundClicked; assesmentTypeListview.ItemTapped += AssessmentItemTapped; if (Device.RuntimePlatform == Device.Android || Device.RuntimePlatform == Device.iOS) { assesmentTypeListview.RowHeight = 52; } } else { FullReportViewModel = fullReportViewModel; BindingContext = fullReportViewModel; this.CloseWhenBackgroundIsClicked = true; this.BackgroundClicked += FullReportPopupView_BackgroundClicked; assesmentTypeListview.ItemTapped += AssessmentItemTapped; if (Device.RuntimePlatform == Device.Android || Device.RuntimePlatform == Device.iOS) { assesmentTypeListview.RowHeight = 50; } if (Device.RuntimePlatform == Device.iOS) { BatteryTypePopupView.Margin = new Thickness(0, 10, 0, 0); } } if (Device.RuntimePlatform != Device.Android) { Frame1.IsVisible = assesmentTypeListview.IsVisible = true; AndroidFrame.IsVisible = assesmentTypeCollectionView.IsVisible = false; } else { Frame1.IsVisible = assesmentTypeListview.IsVisible = false; AndroidFrame.IsVisible = assesmentTypeCollectionView.IsVisible = true; } }
public SelectLocationPopupView(BasicReportViewModel basicReportViewModel = null, FullReportViewModel fullReportViewModel = null, List <string> SelectedLocations = null) { InitializeComponent(); if (basicReportViewModel != null) { ReportViewModel = basicReportViewModel; BindingContext = basicReportViewModel; this.CloseWhenBackgroundIsClicked = true; LocationPopupView.Margin = new Thickness(0, 0, 0, 0); LocationPopupView.VerticalOptions = LayoutOptions.Center; LocationPopupView.HorizontalOptions = LayoutOptions.Center; this.BackgroundClicked += BasicReportPopupView_BackgroundClicked; ReportViewModel.SelectedLocations = new List <string>(); if (SelectedLocations != null) { ReportViewModel.SelectedLocations = SelectedLocations; } } else if (fullReportViewModel != null) { FullReportViewModel = fullReportViewModel; BindingContext = fullReportViewModel; this.CloseWhenBackgroundIsClicked = true; this.BackgroundClicked += FullReportPopupView_BackgroundClicked; FullReportViewModel.SelectedLocations = new List <string>(); if (SelectedLocations != null) { FullReportViewModel.SelectedLocations = SelectedLocations; } LocationPopupView.Margin = new Thickness(0, 0, 0, 0); LocationPopupView.VerticalOptions = LayoutOptions.Center; LocationPopupView.HorizontalOptions = LayoutOptions.Center; if (Device.RuntimePlatform == Device.iOS) { LocationPopupView.Margin = new Thickness(0, 10, 0, 0); } } }
//By : Mudit Juneja //Date : 19/12/2015 //Refer: BasicReportViewModel public List<BasicReportViewModel> GetDataForBasicReport(DateTime date) { List<BasicReportViewModel> lst_basic = new List<BasicReportViewModel>(); DataTable dt, dtShifts; DBDataHelper.ConnectionString = ConfigurationManager.ConnectionStrings["CSBiometricAttendance"].ConnectionString; List<SqlParameter> list_params = new List<SqlParameter>() { new SqlParameter("@date", date) }; try { using (DBDataHelper helper = new DBDataHelper()) { dt = helper.GetDataTable("spGetEmployeesForBasicReport", SQLTextType.Stored_Proc, list_params); dtShifts = helper.GetDataTable("spGetActiveShift", SQLTextType.Stored_Proc); foreach (DataRow row in dt.Rows) { BasicReportViewModel model = new BasicReportViewModel(); model.EmployeeCode = Int32.Parse(row[1].ToString()); model.Name = row[0].ToString(); if (row[2] != DBNull.Value) { model.InTime = row[2].ToString(); model.OutTime = row[3] == DBNull.Value ? dtShifts.Rows[0]["SecondHalfEnd"].ToString() : row[3].ToString(); if (row[3] != DBNull.Value) model.Status = "Present"; else model.Status = "PresentWithNoOutPunch"; } else { model.InTime = "00:00:00.0000000"; model.OutTime = "00:00:00.0000000"; ManageLeaves objManageLeaves = new ManageLeaves(); string TypeOfLeave;// For Later Use if (objManageLeaves.IsEmployeeOnLeave(model.EmployeeCode, date, out TypeOfLeave)) model.Status = TypeOfLeave; else model.Status = "Absent"; } model.InTime = row[2].ToString(); model.OutTime = row[3] == DBNull.Value ? "00:00:00.0000000" : row[3].ToString(); model.TotalDuration = model.Duration.ToString(); model.SecondHalfStartTime = dtShifts.Rows[0]["SecondHalfStart"].ToString(); lst_basic.Add(model); } } } catch (Exception) { // } return lst_basic; }