public void GetByProjectId(int ProjID) { var q1 = ProjectProfileCmd.GetProjectData(ProjID); var q = TheDonorsProjectCmd.GetAllDonorsByproID(ProjID); ReportDataSource rs = new ReportDataSource(); List<ProjectReportObj> ls = new List<ProjectReportObj>(); FrmMainUserPro Mainfrm = new FrmMainUserPro(); int counter = 0; foreach (var item in q) { counter++; ls.Add(new ProjectReportObj() { //// DonerID=counter, DonorsName=item.TheDonor.Name, Cost=item.TotalCost.Value, ProjectName=item.ProjectProfile.ProjectName, ProjectDescription=item.ProjectProfile.ProjectDescription, progress=item.ProjectProfile.progress.Value, TotalCost=item.ProjectProfile.TotalCost.Value, StartDate=item.ProjectProfile.StartDate.Value, EndDate=item.ProjectProfile.EndDate.Value, Coin=item.ProjectProfile.Coin, TotalExpenses=ProjectExpensesCmd.GetTotalExpensesByProject(ProjID), TotalSalay=SalariesCmd.GetTotalSalaryByProject(ProjID), AmountRecv=AmountsReceivedsCmd.GetTotalAmountsByProject(ProjID), }); } rs.Name = "ProjectDataSet"; rs.Value = ls; frmReportViewer frm = new frmReportViewer(); frm.reportViewer1.LocalReport.DataSources.Clear(); frm.reportViewer1.LocalReport.DataSources.Add(rs); frm.reportViewer1.LocalReport.ReportEmbeddedResource = "UcasProWindowsForm.Reports.rptProject.rdlc"; frm.ShowDialog(); }
private void radGridView1_CommandCellClick(object sender, EventArgs e) { Operation.BeginOperation(this); FrmMainUserPro frm = new FrmMainUserPro(); Ucas.Data.ProjectProfile db = (Ucas.Data.ProjectProfile)radGridView1.CurrentRow.DataBoundItem; if (InformationsClass.XUserType == "مدير") { frm.TragetProject = db; this.Hide(); frm.ShowDialog(); Operation.EndOperation(this); FrmAdmin_Load(null, null); return; } var c = db.ProjectControls.Where(p => p.ProjectID == db.ID).Take(1).SingleOrDefault(); if (c.Status == "غير فعال") { // message not have permession Operation.EndOperation(this); RadMessageBox.Show("غير مصرح لك بالدخول", "", MessageBoxButtons.OK, RadMessageIcon.Error); return; } if (db.Status == "غير فعال") { Operation.EndOperation(this); RadMessageBox.Show("المشروع غير فعال", "", MessageBoxButtons.OK, RadMessageIcon.Error); return; } else { Operation.BeginOperation(this); frm.TragetProject = db; this.Hide(); frm.ShowDialog(); Operation.EndOperation(this); FrmAdmin_Load(null, null); } FrmAdmin_Load(null, null); }