Exemplo n.º 1
0
        public Permissoes()
        {
            InitializeComponent();
            this.Dock = DockStyle.Fill;

            DataTable tbUsuarios   = new SysUserDao().select();
            DataTable tbGrupos     = new UserGroupDao().select();
            DataTable tbRelatorios = new ReportDao().select();

            addOpcaoTodos(tbUsuarios, SysUserDao.DisplayMember, SysUserDao.ValueMember);
            addOpcaoTodos(tbGrupos, UserGroupDao.DisplayMember, UserGroupDao.ValueMember);
            addOpcaoTodos(tbRelatorios, ReportDao.DisplayMember, ReportDao.ValueMember);

            //Listando todos os usuários
            cmbUsuarios.DisplayMember = SysUserDao.DisplayMember;
            cmbUsuarios.ValueMember   = SysUserDao.ValueMember;
            cmbUsuarios.DataSource    = tbUsuarios;

            //Listando todos os Grupos de Usuários
            cmbGrupo.DisplayMember = UserGroupDao.DisplayMember;
            cmbGrupo.ValueMember   = UserGroupDao.ValueMember;
            cmbGrupo.DataSource    = tbGrupos;

            //Listando todos os relatórios
            cmbRelUsu.DisplayMember = ReportDao.DisplayMember;
            cmbRelUsu.ValueMember   = ReportDao.ValueMember;
            cmbRelUsu.DataSource    = tbRelatorios;

            cmbRelGrupo.DisplayMember = ReportDao.DisplayMember;
            cmbRelGrupo.ValueMember   = ReportDao.ValueMember;
            cmbRelGrupo.DataSource    = tbRelatorios;
        }
Exemplo n.º 2
0
        //private void BindStateRegion()
        //{
        //    ddlProvince.DataSource = _presenter.GetProvinces();
        //    ddlProvince.DataBind();
        //}

        //protected void BindFacilityType(string value)
        //{
        //    ddlFacilityType.DataSource = _presenter.GetFacilityTypeByFacilityType2(value);
        //    ddlFacilityType.DataBind();
        //}

        //protected void BindLaboratories()
        //{
        //    //ddlLab.DataSource = _presenter.GetLaboratories();
        //    //ddlLab.DataBind();

        //    if (CurrentUser.AppUserRoles[0].Role.Name == "Administrator")
        //    {
        //        ddlLab.DataSource = _presenter.GetLaboratories();
        //        ddlLab.DataValueField = "LabCode";
        //        ddlLab.DataTextField = "Description";
        //        ddlLab.DataBind();
        //    }
        //    else
        //    {
        //        ReportDao dao = new ReportDao();
        //        DataSet infoDS = dao.GetUserLocationsInfo(CurrentUser.Id);
        //        DataTable table = infoDS.Tables[0];

        //        ddlLab.DataSource = table;
        //        ddlLab.DataValueField = "LabCode";
        //        ddlLab.DataTextField = "LaboratoryName";
        //        ddlLab.DataBind();
        //    }
        //}

        protected void BindLaboratories()
        {
            //ddlLab.DataSource = _presenter.GetLaboratories();
            //ddlLab.DataBind();

            if (CurrentUser.AppUserRoles[0].Role.Name == "Administrator" ||
                CurrentUser.AppUserRoles[0].Role.Name == "SuperUser")
            {
                ddlLab.DataSource     = _presenter.GetLaboratories();
                ddlLab.DataValueField = "LabCode";
                ddlLab.DataTextField  = "Description";
                ddlLab.DataBind();
            }
            else
            {
                ReportDao dao    = new ReportDao();
                DataSet   infoDS = dao.GetUserLocationsInfo(CurrentUser.Id);
                DataTable table  = infoDS.Tables[0];

                ddlLab.DataSource     = table;
                ddlLab.DataValueField = "LabCode";
                ddlLab.DataTextField  = "LaboratoryName";
                ddlLab.DataBind();
            }
        }
        private void BindLocation()
        {
            if (CurrentUser.AppUserRoles[0].Role.Name == "Administrator")
            {
                ddlLocation.DataSource = _presenter.GetProvinces();
                ddlLocation.DataBind();
            }
            else
            {
                ReportDao dao    = new ReportDao();
                DataSet   infoDS = dao.GetUserLocationsInfo(CurrentUser.Id);
                DataTable table  = infoDS.Tables[0];

                var distinctValues = table.AsEnumerable()
                                     .Select(row => new
                {
                    attrib_name1 = row.Field <int>("ProvinceId"),
                    attrib_name2 = row.Field <string>("ProvinceName")
                })
                                     .Distinct();
                DataTable dt = new DataTable("Location");
                dt.Columns.Add("ProvinceId");
                dt.Columns.Add("ProvinceName");
                foreach (var row in distinctValues)
                {
                    ddlLocation.Items.Add(new ListItem(row.attrib_name2, row.attrib_name1.ToString()));
                }
            }
        }
        private void BindUserInfo()
        {
            dao = new ReportDao();
            DataSet   infoDS = dao.GetUserLocationsInfo(CurrentUser.Id);
            DataTable table  = infoDS.Tables[0];

            DataView dview = new DataView(table);

            dview.Sort = "FacilityName";        // for descending   "FacilityName DESC"
            table      = dview.ToTable();

            for (int i = 0; i < table.Rows.Count; i++)
            {
                //lbllocation.Text = table.Rows[0]["LaboratoryName"].ToString();
                LinkButton hyp = new LinkButton();
                hyp.ID = "hyp" + table.Rows[i]["FacilityId"].ToString();
                //hyp.NavigateUrl = "";
                hyp.Text     = table.Rows[i]["FacilityName"].ToString();
                hyp.ToolTip  = table.Rows[i]["FacilityName"].ToString();
                hyp.CssClass = "btn btn-info";
                //hyp.CssClass = "btn btn-link";
                hyp.Style.Add("margin-right", "5px");
                hyp.Style.Add("margin-bottom", "2px");
                //hyp.Target = "_new";
                //hyp.Click += (hypFacility_Click);

                //plhFacilities.Controls.Add(hyp);
            }
        }
Exemplo n.º 5
0
        // GET: Report
        public ActionResult Index()
        {
            var dao = new ReportDao();
            IList <ReportDao.UsekOddeleniWithCount> useky = dao.GetLopCounts(ReportDao.StavUkolu.Vsechny, ReportDao.Tabulka.Lop);

            return(View(useky));
        }
Exemplo n.º 6
0
        public ActionResult Index()
        {
            var model = new ReportDao().Report_all();

            ViewBag.ImportReport  = TempData["import_report"];
            ViewBag.SellingReport = TempData["selling_report"];
            return(View(model));
        }
Exemplo n.º 7
0
        public ActionResult SellingReport()
        {
            DateTime start_date     = DateTime.Parse(Request.Form["SellingStartDate"].ToString());
            DateTime end_date       = DateTime.Parse(Request.Form["SellingEndDate"].ToString());
            var      selling_report = new ReportDao();

            TempData["selling_report"] = selling_report.Selling_Report(start_date, end_date);
            return(RedirectToAction("Index", "Report"));
        }
Exemplo n.º 8
0
        public ActionResult ImportReport()
        {
            DateTime start_date    = DateTime.Parse(Request.Form["ImportStartDate"].ToString());
            DateTime end_date      = DateTime.Parse(Request.Form["ImportEndDate"].ToString());
            var      import_report = new ReportDao();

            TempData["import_report"] = import_report.Import_Report(start_date, end_date);
            return(RedirectToAction("Index", "Report"));
        }
Exemplo n.º 9
0
 internal void setProfitPerItemRowsCount()
 {
     try {
         DataSet dataSet = ReportDao.getProfitPerItem((profitPerItem.datePicker_from.SelectedDate != null ? Convert.ToDateTime(profitPerItem.datePicker_from.SelectedDate).ToString("yyyy-MM-dd") : null),
                                                      (profitPerItem.datePicker_to.SelectedDate != null ? Convert.ToDateTime(profitPerItem.datePicker_to.SelectedDate).ToString("yyyy-MM-dd") : null),
                                                      Convert.ToInt32(profitPerItem.comboBox_categoryId.SelectedValue), Convert.ToInt32(profitPerItem.comboBox_companyId.SelectedValue), profitPerItem.textBox_itemName.TrimedText, profitPerItem.textBox_itemCode.TrimedText, true, profitPerItem.Pagination.LimitStart, profitPerItem.Pagination.LimitCount);
         profitPerItem.Pagination.RowsCount = Convert.ToInt32(dataSet.Tables[0].Rows[0][0]);
     } catch (Exception) {
     }
 }
Exemplo n.º 10
0
 internal void setDailyProfitRowsCount()
 {
     try {
         DataSet dataSet = ReportDao.getDailyProfit((dailyProfit.datePicker_from.SelectedDate != null ? Convert.ToDateTime(dailyProfit.datePicker_from.SelectedDate).ToString("yyyy-MM-dd") : null),
                                                    (dailyProfit.datePicker_to.SelectedDate != null ? Convert.ToDateTime(dailyProfit.datePicker_to.SelectedDate).ToString("yyyy-MM-dd") : null),
                                                    true, dailyProfit.Pagination.LimitStart, dailyProfit.Pagination.LimitCount);
         dailyProfit.Pagination.RowsCount = Convert.ToInt32(dataSet.Tables[0].Rows[0][0]);
     } catch (Exception) {
     }
 }
Exemplo n.º 11
0
        public ActionResult XoaBaoCao()
        {
            string id = RouteData.Values["id"].ToString();
            // Trước khi xóa bài viết sau đó xóa nhà trọ
            var bc    = db.BaoCaos.Find(Int32.Parse(id));
            var bv    = db.BaiViets.Find(bc.idBV);
            var nt    = db.NhaTroes.Find(bv.idNT);
            var HamP  = new FunctionPosts();
            var HamNT = new FunctionNhaTro();
            var HamBC = new ReportDao();

            HamBC.Delete(Int32.Parse(id));

            return(RedirectToAction("QLBC", "Home"));
        }
Exemplo n.º 12
0
 internal void filterProfitPerItem()
 {
     try {
         DataSet dataSet = ReportDao.getProfitPerItem((profitPerItem.datePicker_from.SelectedDate != null ? Convert.ToDateTime(profitPerItem.datePicker_from.SelectedDate).ToString("yyyy-MM-dd") : null),
                                                      (profitPerItem.datePicker_to.SelectedDate != null ? Convert.ToDateTime(profitPerItem.datePicker_to.SelectedDate).ToString("yyyy-MM-dd") : null),
                                                      Convert.ToInt32(profitPerItem.comboBox_categoryId.SelectedValue), Convert.ToInt32(profitPerItem.comboBox_companyId.SelectedValue), profitPerItem.textBox_itemName.TrimedText, profitPerItem.textBox_itemCode.TrimedText, false, profitPerItem.Pagination.LimitStart, profitPerItem.Pagination.LimitCount);
         profitPerItem.DataTable.Rows.Clear();
         foreach (DataRow row in dataSet.Tables[0].Rows)
         {
             profitPerItem.DataTable.Rows.Add(0, row[0], row[1], row[2], row[3],
                                              Convert.ToDouble(row[4]).ToString("#,##0.00"));
         }
     } catch (Exception) {
     }
 }
Exemplo n.º 13
0
        public ActionResult Report(string tieude, string mota, string idbv)
        {
            var    session = (DACN.Common.UserLogin)Session[DACN.Common.CommonConstants.USER_SESSION];
            BaoCao bc      = new BaoCao();
            var    bcdao   = new ReportDao();

            bc.TieuDe    = tieude;
            bc.TenBaoCao = mota;
            DateTime now = DateTime.Now;

            bc.NgayBC    = now;
            bc.TrangThai = false;
            bc.idBV      = Int32.Parse(idbv);
            bcdao.Insert(bc);
            return(Json(new { Message = "success", JsonRequestBehavior = JsonRequestBehavior.AllowGet }));
        }
Exemplo n.º 14
0
 internal void setDailyItemSaleRowsCount()
 {
     try {
         if (String.IsNullOrWhiteSpace(dailyItemSale.textBox_itemId.Text))
         {
             dailyItemSale.label_selectedItemName.Content = null;
         }
         DataSet dataSet = ReportDao.getDailyItemSale((!String.IsNullOrWhiteSpace(dailyItemSale.textBox_categoryId.Text) ? Convert.ToInt32(dailyItemSale.textBox_categoryId.Text) : 0),
                                                      (!String.IsNullOrWhiteSpace(dailyItemSale.textBox_companyId.Text) ? Convert.ToInt32(dailyItemSale.textBox_companyId.Text) : 0), (!String.IsNullOrWhiteSpace(dailyItemSale.textBox_itemId.Text) ? Convert.ToInt32(dailyItemSale.textBox_itemId.Text) : 0),
                                                      (dailyItemSale.datePicker_from.SelectedDate != null ? Convert.ToDateTime(dailyItemSale.datePicker_from.SelectedDate).ToString("yyyy-MM-dd") : null),
                                                      (dailyItemSale.datePicker_to.SelectedDate != null ? Convert.ToDateTime(dailyItemSale.datePicker_to.SelectedDate).ToString("yyyy-MM-dd") : null),
                                                      true, dailyItemSale.Pagination.LimitStart, dailyItemSale.Pagination.LimitCount);
         dailyItemSale.Pagination.RowsCount = Convert.ToInt32(dataSet.Tables[0].Rows[0][0]);
     } catch (Exception) {
     }
 }
Exemplo n.º 15
0
 internal void filterDailyProfit()
 {
     try {
         DataSet dataSet = ReportDao.getDailyProfit((dailyProfit.datePicker_from.SelectedDate != null ? Convert.ToDateTime(dailyProfit.datePicker_from.SelectedDate).ToString("yyyy-MM-dd") : null),
                                                    (dailyProfit.datePicker_to.SelectedDate != null ? Convert.ToDateTime(dailyProfit.datePicker_to.SelectedDate).ToString("yyyy-MM-dd") : null),
                                                    false, dailyProfit.Pagination.LimitStart, dailyProfit.Pagination.LimitCount);
         dailyProfit.DataTable.Rows.Clear();
         foreach (DataRow row in dataSet.Tables[0].Rows)
         {
             dailyProfit.DataTable.Rows.Add(0, Convert.ToDateTime(row[0]).ToString("yyyy-MM-dd"),
                                            Convert.ToDouble(row[1]).ToString("#,##0.00"), Convert.ToDouble(row[2]).ToString("#,##0.00"),
                                            Convert.ToDouble(row[3]).ToString("#,##0.00"));
         }
     } catch (Exception) {
     }
 }
Exemplo n.º 16
0
        //신고글 조회 기능(함수)
        public void After_Report()
        {
            ReportDao reportdao   = new ReportDao();
            Report    report      = new Report();
            Report    inputReport = new Report();

            DataSet ds = reportdao.SelectReport();

            dataGridView1.DataSource = ds.Tables[0];

            //rep_no, trv_no, rep_timestap, rep_mem_id, rep_reason
            dataGridView1.Columns[0].HeaderCell.Value = "신고 번호";
            dataGridView1.Columns[1].HeaderCell.Value = "게시글 번호";
            dataGridView1.Columns[2].HeaderCell.Value = "신고 일시";
            dataGridView1.Columns[3].HeaderCell.Value = "신고인";
            dataGridView1.Columns[4].HeaderCell.Value = "신고 사유";
        }
Exemplo n.º 17
0
        private void PopulateLabs()
        {
            ReportDao reportDao = new ReportDao();
            var       LabList   = reportDao.GetLaboratories();

            for (int i = 0; i < LabList.Count; i++)
            {
                ArrayList row = (ArrayList)LabList[i];
                ddlLab.Items.Add(new ListItem(row[3].ToString(), row[1].ToString()));

                ddlLab2.Items.Add(new ListItem(row[3].ToString(), row[1].ToString()));
            }

            //ddlLab.DataSource = reportDao.GetLaboratories();
            //ddlLab.DataTextField = "LabCode";
            //ddlLab.DataValueField = "Id";
            ////ddlLab.DataBind();
        }
Exemplo n.º 18
0
 internal void filterDailyItemSale()
 {
     try {
         DataSet dataSet = ReportDao.getDailyItemSale((!String.IsNullOrWhiteSpace(dailyItemSale.textBox_categoryId.Text) ? Convert.ToInt32(dailyItemSale.textBox_categoryId.Text) : 0),
                                                      (!String.IsNullOrWhiteSpace(dailyItemSale.textBox_companyId.Text) ? Convert.ToInt32(dailyItemSale.textBox_companyId.Text) : 0), (!String.IsNullOrWhiteSpace(dailyItemSale.textBox_itemId.Text) ? Convert.ToInt32(dailyItemSale.textBox_itemId.Text) : 0),
                                                      (dailyItemSale.datePicker_from.SelectedDate != null ? Convert.ToDateTime(dailyItemSale.datePicker_from.SelectedDate).ToString("yyyy-MM-dd") : null),
                                                      (dailyItemSale.datePicker_to.SelectedDate != null ? Convert.ToDateTime(dailyItemSale.datePicker_to.SelectedDate).ToString("yyyy-MM-dd") : null),
                                                      false, dailyItemSale.Pagination.LimitStart, dailyItemSale.Pagination.LimitCount);
         dailyItemSale.DataTable.Rows.Clear();
         foreach (DataRow row in dataSet.Tables[0].Rows)
         {
             dailyItemSale.DataTable.Rows.Add(0, Convert.ToDateTime(row[0]).ToString("yyyy-MM-dd"), row[1], Convert.ToDouble(row[2]).ToString("#,##0.00"), Convert.ToDouble(row[3]).ToString("#,##0.00"),
                                              Convert.ToDouble(row[4]).ToString("#,##0.00"), Convert.ToDouble(row[5]).ToString("#,##0.00"),
                                              Convert.ToDouble(row[6]).ToString("#,##0.00"), Convert.ToDouble(row[7]).ToString("#,##0.00"),
                                              Convert.ToDouble(row[8]).ToString("#,##0.00"), Convert.ToDouble(row[9]).ToString("#,##0.00"));
         }
     } catch (Exception) {
     }
 }
Exemplo n.º 19
0
        internal void printDailyProfit()
        {
            try {
                PrepareReport prepareReport = new PrepareReport();
                prepareReport.addParameter("reportType", "Daily Profit");
                prepareReport.addParameter("reportDescription", "");

                prepareReport.addCommon();

                DataTable dt = new DataTable();
                dt.Columns.Add("ID", typeof(int));
                dt.Columns.Add("Date", typeof(String));
                dt.Columns.Add("Amount", typeof(String));
                dt.Columns.Add("Expenses", typeof(String));
                dt.Columns.Add("Total", typeof(String));

                DataSet dataSet = ReportDao.getDailyProfit((dailyProfit.datePicker_from.SelectedDate != null ? Convert.ToDateTime(dailyProfit.datePicker_from.SelectedDate).ToString("yyyy-MM-dd") : null),
                                                           (dailyProfit.datePicker_to.SelectedDate != null ? Convert.ToDateTime(dailyProfit.datePicker_to.SelectedDate).ToString("yyyy-MM-dd") : null),
                                                           false, dailyProfit.Pagination.LimitStart, dailyProfit.Pagination.LimitCount);

                double profit   = 0;
                double expenses = 0;
                double total    = 0;

                foreach (DataRow row in dataSet.Tables[0].Rows)
                {
                    profit   += Convert.ToDouble(row[1]);
                    expenses += Convert.ToDouble(row[2]);
                    total    += Convert.ToDouble(row[3]);
                    dt.Rows.Add(0, Convert.ToDateTime(row[0]).ToString("yyyy-MM-dd"),
                                Convert.ToDouble(row[1]).ToString("#,##0.00"), Convert.ToDouble(row[2]).ToString("#,##0.00"),
                                Convert.ToDouble(row[3]).ToString("#,##0.00"));
                }

                prepareReport.addParameter("totalProfit", profit.ToString("#,##0.00"));
                prepareReport.addParameter("reportExpenses", expenses.ToString("#,##0.00"));
                prepareReport.addParameter("reportTotal", total.ToString("#,##0.00"));                /**/

                new ReportViewer(dt, "DailyProfit", prepareReport.getParameters()).Show();
            } catch (Exception) {
            }
        }
Exemplo n.º 20
0
        private void btnPrintTakeIn_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (lstTakeIn.SelectedIndex == -1)
            {
                return;
            }
            int       _idMaster = -1;
            DataTable tbTmp     = (DataTable)lstTakeIn.DataSource;

            if (tbTmp.Rows.Count > 0)
            {
                DataRow dr = tbTmp.Rows[lstTakeIn.SelectedIndex];
                _idMaster = CnvToInt32(dr["Id"]);
            }
            if (_idMaster == -1)
            {
                return;
            }
            FORM.BAOCAO.NHAPXUAT.rptTakeIns frp = new FORM.BAOCAO.NHAPXUAT.rptTakeIns();
            FORM.BAOCAO.frmBaoCao           f   = new FORM.BAOCAO.frmBaoCao();
            f.ShowBaoCao(frp, ReportDao.GetListTakeIn(_idMaster, _ConfigItem), this.ParentForm);
        }
Exemplo n.º 21
0
        public DataSet ExportTravelAdvance(string datefrom, string dateto, string ExportType)
        {
            ReportDao re = new ReportDao();

            return(re.ExportTravelAdvance(datefrom, dateto, ExportType));
        }
Exemplo n.º 22
0
        public DataSet ExportCostSharingPayment(string datefrom, string dateto, string ExportType)
        {
            ReportDao re = new ReportDao();

            return(re.ExportCostSharingPayment(datefrom, dateto, ExportType));
        }
Exemplo n.º 23
0
        public DataSet GetCostSharingPaymentReport(string datefrom, string dateto)
        {
            ReportDao re = new ReportDao();

            return(re.CostSharingPaymentReport(datefrom, dateto));
        }
Exemplo n.º 24
0
        public DataSet GetBankPaymentReport(string datefrom, string dateto)
        {
            ReportDao re = new ReportDao();

            return(re.BankPaymentPaymentReport(datefrom, dateto));
        }
Exemplo n.º 25
0
        public DataSet GetTravelAdvancenReport(string datefrom, string dateto)
        {
            ReportDao re = new ReportDao();

            return(re.TravelAdvanceReport(datefrom, dateto));
        }
Exemplo n.º 26
0
        public DataSet GetLiquidationReport(string datefrom, string dateto)
        {
            ReportDao re = new ReportDao();

            return(re.LiquidationReport(datefrom, dateto));
        }
Exemplo n.º 27
0
        public DataSet GetVehicleReport(string datefrom, string dateto)
        {
            ReportDao re = new ReportDao();

            return(re.VehicleReport(datefrom, dateto));
        }
Exemplo n.º 28
0
        public DataSet GetPurchaseReport(string datefrom, string dateto)
        {
            ReportDao re = new ReportDao();

            return(re.PurchaseReport(datefrom, dateto));
        }
Exemplo n.º 29
0
        public DataSet GetLeaveReport(int EmployeeName, int LeaveType)
        {
            ReportDao re = new ReportDao();

            return(re.LeaveReport(EmployeeName, LeaveType));
        }
Exemplo n.º 30
0
        public DataSet EmployeeBirthReport(string month)
        {
            ReportDao re = new ReportDao();

            return(re.EmployeeBirthReport(month));
        }