• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# CustomClass.QueryBuilder类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中WMS.CustomClass.QueryBuilder的典型用法代码示例。如果您正苦于以下问题:C# QueryBuilder类的具体用法?C# QueryBuilder怎么用?C# QueryBuilder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



QueryBuilder类属于WMS.CustomClass命名空间,在下文中一共展示了QueryBuilder类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Create

        //
        // GET: /AttProcessors/Create
        public ActionResult Create()
        {
            TAS2013Entities db = new TAS2013Entities();
            User LoggedInUser = Session["LoggedUser"] as User;
            QueryBuilder qb = new QueryBuilder();
            String query = qb.QueryForCompanyViewLinq(LoggedInUser);
            ViewBag.PeriodTag = new SelectList(new List<SelectListItem>
            {
                new SelectListItem { Selected = true, Text = "Daily", Value = "D"},
                new SelectListItem { Selected = false, Text = "Monthly", Value = "M"},
                new SelectListItem { Selected = false, Text = "Summary", Value = "S"},

            }, "Value" , "Text",1);
            ViewBag.CriteriaID = new SelectList(new List<SelectListItem>
            {
                new SelectListItem { Selected = true, Text = "Company", Value = "C"},
                new SelectListItem { Selected = false, Text = "Location", Value = "L"},

            }, "Value", "Text", 1);
            ViewBag.ProcessCats = new SelectList(new List<SelectListItem>
            {
                new SelectListItem { Selected = true, Text = "Yes", Value = "1"},
                new SelectListItem { Selected = false, Text = "No", Value = "0"},

            }, "Value", "Text", 1);
            ViewBag.CompanyID = new SelectList(db.Companies.Where(query).OrderBy(s=>s.CompName), "CompID", "CompName");
            query = qb.QueryForLocationTableSegerationForLinq(LoggedInUser);
            ViewBag.LocationID = new SelectList(db.Locations.Where(query).OrderBy(s=>s.LocName), "LocID", "LocName");

            ViewBag.CatID = new SelectList(db.Categories.OrderBy(s=>s.CatName), "CatID", "CatName");
             return View();
        }
开发者ID:engrawais,项目名称:AirBlue,代码行数:34,代码来源:AttProcessorsController.cs


示例2: Create

        public ActionResult Create()
        {
            ViewBag.DayOff1 = new SelectList(db.DaysNames.OrderBy(s=>s.Name), "ID", "Name");
            ViewBag.DayOff2 = new SelectList(db.DaysNames.OrderBy(s=>s.Name), "ID", "Name");
            QueryBuilder qb = new QueryBuilder();
            User LoggedInUser = Session["LoggedUser"] as User;
            string query = qb.QueryForLocationTableSegerationForLinq(LoggedInUser);

            ViewBag.LocationID = new SelectList(db.Locations.Where(query).OrderBy(s=>s.LocName), "LocID", "LocName");
            ViewBag.RosterType = new SelectList(db.RosterTypes.OrderBy(s=>s.Name), "ID", "Name");
            return View();
        }
开发者ID:engrawais,项目名称:AirBlue,代码行数:12,代码来源:ShiftController.cs


示例3: Page_Load

 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         String reportName = Request.QueryString["reportname"];
         List<string> list = Session["ReportSession"] as List<string>;
         FiltersModel fm = Session["FiltersModel"] as FiltersModel;
         User LoggedInUser = HttpContext.Current.Session["LoggedUser"] as User;
         QueryBuilder qb = new QueryBuilder();
         string query = qb.MakeCustomizeQuery(LoggedInUser);
         _dateFrom = list[0];
         string _dateTo = list[1];
         DateTime DateFrom = Convert.ToDateTime(list[0]);
         DateTime DateTo = Convert.ToDateTime(list[1]);
         string PathString = "";
         string consolidatedMonth = "";
         switch (reportName)
         {
             case "Strength":
                 List<DailySummary> _BadliList = contex.DailySummaries.Where(aa => aa.Date >= DateFrom && aa.Date <= DateTo).ToList();
                 List<DailySummary> _TempBadliList = new List<DailySummary>();
                 title = "Badli Report";
                 if (GlobalVariables.DeploymentType == false)
                     PathString = "/Reports/RDLC/DSEmpStrength.rdlc";
                 else
                     PathString = "/WMS/Reports/RDLC/DSEmpStrength.rdlc";
                 LoadReport(PathString, ReportsFilterImplementation(fm, _TempBadliList, _BadliList),_dateFrom+" TO "+_dateTo);
                 break;
             case "WorkTime":
                 _BadliList = contex.DailySummaries.Where(aa => aa.Date >= DateFrom && aa.Date <= DateTo).ToList();
                 _TempBadliList = new List<DailySummary>();
                 title = "Badli Report";
                 if (GlobalVariables.DeploymentType == false)
                     PathString = "/Reports/RDLC/DSWorkSummary.rdlc";
                 else
                     PathString = "/WMS/Reports/RDLC/DSWorkSummary.rdlc";
                 LoadReport(PathString, ReportsFilterImplementation(fm, _TempBadliList, _BadliList), _dateFrom + " TO " + _dateTo);
                 break;
             case "Consolidated":
                 _BadliList = contex.DailySummaries.Where(aa => aa.Date >= DateFrom && aa.Date <= DateTo).ToList();
                 _TempBadliList = new List<DailySummary>();
                 title = "Badli Report";
                 if (GlobalVariables.DeploymentType == false)
                     PathString = "/Reports/RDLC/DSConsolidated.rdlc";
                 else
                     PathString = "/WMS/Reports/RDLC/DSConsolidated.rdlc";
                 LoadReport(PathString, ReportsFilterImplementation(fm, _TempBadliList, _BadliList), _dateFrom + " TO " + _dateTo);
                 break;
         }
     }
 }
开发者ID:qq5013,项目名称:WMS-Fatima,代码行数:51,代码来源:SummaryReports.aspx.cs


示例4: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            String reportName = Request.QueryString["reportname"];
            String type = Request.QueryString["type"];
            if (!Page.IsPostBack)
            {
                List<string> list = Session["ReportSession"] as List<string>;
                FiltersModel fm = Session["FiltersModel"] as FiltersModel;
                CreateDataTable();
                User LoggedInUser = HttpContext.Current.Session["LoggedUser"] as User;
                QueryBuilder qb = new QueryBuilder();
                string query = qb.MakeCustomizeQuery(LoggedInUser);
                _dateFrom = list[0];
                string _dateTo = list[1];
                companyimage = GetCompanyImages(fm);
                string PathString = "";
                string consolidatedMonth = "";
                switch (reportName)
                {
                    case "badli_report":
                        DataTable badlidt = qb.GetValuesfromDB("select * from ViewBadli where (AttDate >= " + "'" + _dateFrom + "'" + " and AttDate <= " + "'" + _dateTo + "'" + " )");
                        List<ViewBadli> _BadliList = badlidt.ToList<ViewBadli>();
                        List<ViewBadli> _TempBadliList = new List<ViewBadli>();
                        title = "Badli Report";
                        if (GlobalVariables.DeploymentType == false)
                            PathString = "/Reports/RDLC/BadliReport.rdlc";
                        else
                            PathString = "/WMS/Reports/RDLC/BadliReport.rdlc";
                        LoadReport(PathString, ReportsFilterImplementation(fm, _TempBadliList, _BadliList), _dateFrom + " TO " + _dateTo);
                        break;
                    //please modify the first case
                    case "summarized_monthly_report":
                        List<TASReportDataSet.SummarizedMonthlyReportDataTable> AttDeptdummy = new List<TASReportDataSet.SummarizedMonthlyReportDataTable>().ToList();
                        title = "Department Attendace Summary";
                        if (GlobalVariables.DeploymentType == false)
                            PathString = "/Reports/RDLC/SummarizedMonthlyReport.rdlc";
                        else
                            PathString = "/WMS/Reports/RDLC/SummarizedMonthlyReport.rdlc";

                        LoadReport(PathString, AttDeptdummy, _dateFrom + " TO " + _dateTo);

                        break;
                    case "Employee_Att_Summary_New_report": DataTable dt4  = qb.GetValuesfromDB("select * from ViewAttData " + query + " and Status=1" + " and (AttDate >= " + "'" + _dateFrom + "'" + " and AttDate <= " + "'" + _dateTo + "'" + " )");
                        List<ViewAttData> ListOfAttDate = new List<ViewAttData>();
                        List<ViewAttData> TempList = new List<ViewAttData>();
                        title = "Employee Attendace Summary New";
                        if (GlobalVariables.DeploymentType == false)
                            PathString = "/Reports/RDLC/EmpAttSummaryNew.rdlc";
                        else
                            PathString = "/WMS/Reports/RDLC/EmpAttSummaryNew.rdlc";
                        ListOfAttDate = dt4.ToList<ViewAttData>();
                        TempList = new List<ViewAttData>();

                        LoadReport(PathString, ReportsFilterImplementation(fm, TempList, ListOfAttDate), _dateFrom + " TO " + _dateTo);

                        break;
                    //case "department_attendance_summary": HRReportsMaker hrm = new HRReportsMaker();
                    //    List<AttDeptSummary> AttDept = hrm.GetListForAttDepartmentsSummary(Session["FiltersModel"] as FiltersModel, _dateFrom, _dateTo);
                    //    title = "Department Attendace Summary";
                    //    if (GlobalVariables.DeploymentType == false)
                    //        PathString = "/Reports/RDLC/AttDepartmentSummary.rdlc";
                    //    else
                    //        PathString = "/WMS/Reports/RDLC/AttDepartmentSummary.rdlc";

                    //    LoadReport(PathString, AttDept, _dateFrom + " TO " + _dateTo);

                    //    break;
                    case "emp_record": DataTable dt = qb.GetValuesfromDB("select * from EmpView " + query + " and Status=1 ");
                        List<EmpView> _ViewList = dt.ToList<EmpView>();
                        List<EmpView> _TempViewList = new List<EmpView>();
                        title = "Employee Record Report";
                        if (GlobalVariables.DeploymentType == false)
                            PathString = "/Reports/RDLC/Employee.rdlc";
                        else
                            PathString = "/WMS/Reports/RDLC/Employee.rdlc";

                        LoadReport(PathString, ReportsFilterImplementation(fm, _TempViewList, _ViewList), _dateFrom + " TO " + _dateTo);

                        break;
                    case "emp_record_active": dt = qb.GetValuesfromDB("select * from EmpView " + query+ " and Status=1 ");
                        _ViewList = dt.ToList<EmpView>();
                        _TempViewList = new List<EmpView>();
                        title = "Active Employees Record Report";
                        if (GlobalVariables.DeploymentType == false)
                            PathString = "/Reports/RDLC/Employee.rdlc";
                        else
                            PathString = "/WMS/Reports/RDLC/Employee.rdlc";

                        LoadReport(PathString, ReportsFilterImplementation(fm, _TempViewList, _ViewList), _dateFrom + " TO " + _dateTo);

                        break;
                    case "emp_record_inactive": dt = qb.GetValuesfromDB("select * from EmpView " + query + " and Status=0 ");
                        _ViewList = dt.ToList<EmpView>();
                        _TempViewList = new List<EmpView>();
                        title = "Inactive Employees Record Report";
                        if (GlobalVariables.DeploymentType == false)
                            PathString = "/Reports/RDLC/Employee.rdlc";
                        else
                            PathString = "/WMS/Reports/RDLC/Employee.rdlc";

//.........这里部分代码省略.........
开发者ID:ahsinanwar,项目名称:SingleCompany,代码行数:101,代码来源:ReportContainer.aspx.cs


示例5: GetListForAttDepartmentsSummary

        /// <summary>
        ///  This function takes FiltersModel and an empty list of AttDeptSummary as input and 
        ///  gives a populated AttDeptSummary as output. If there is any dept selected in the filter
        ///  it will iterate through all the departments if there is no dept selected it will try to
        ///  find all the depts of the company.
        /// </summary>
        /// <param name="fm"> FiltersModel </param>
        /// <param name="attDeptList">Empty List of AttDeptSummary</param>
        /// <returns>Populated List of AttDeptSummary</returns>
        public List<AttDeptSummary> GetListForAttDepartmentsSummary(FiltersModel fm, string _dateFrom,string _dateTo)
        {
            List<AttDeptSummary> attDeptList = new List<AttDeptSummary>();
            TAS2013Entities db = new TAS2013Entities();
               //To get the query from the db
            QueryBuilder qb = new QueryBuilder();
            //Get the Department filters
            List<FiltersAttributes> departments = new List<FiltersAttributes>();

            departments = fm.DepartmentFilter;
            //if more then 0 it means some departments are selected now we iterate over them and see
            //how many employee does one dept has. The table empView is the most suitable db for this case.
            if (departments.Count > 0)
            {
            //do nothing still cater for it in future there might be a need
            }
            //if there is no department list in the filter then first get the company's department and then do the same as above.
            else
            {
            foreach (var comp in fm.CompanyFilter)
            {
            int compID = Convert.ToInt16(comp.ID);
            List<Department> depts = db.Departments.Where(aa => aa.CompanyID == compID).ToList();
            foreach (var dept in depts)
                departments.Add(new FiltersAttributes() { ID=dept.DeptID + "", FilterName=dept.DeptName });

            }
            }
            //NOw run the departments if they are from the department filter or from the company itself

            foreach (var dept in departments)
            {

            DataTable dt = qb.GetValuesfromDB("select * from EmpView where DeptID=" + dept.ID);
            List<EmpView> EmView = dt.ToList<EmpView>();

            //2015-01-24

            foreach (DateTime day in EachDay(Convert.ToDateTime(_dateFrom), Convert.ToDateTime(_dateTo)))
            {
                AttDeptSummary singleInstance = new AttDeptSummary();
                singleInstance.Department = dept.FilterName;
                singleInstance.TotalStrength = EmView.Count();
                singleInstance.Total = singleInstance.TotalStrength;
                singleInstance.Location = EmView.FirstOrDefault().LocName;
                singleInstance.Section = EmView.FirstOrDefault().SectionName;
                singleInstance.Company = EmView.FirstOrDefault().CompName;
                singleInstance.CardSwapped = 0;
                singleInstance.Absent = 0;
                singleInstance.OnLeave = 0;
                string dynamicQueryForEmps = GetDynamicQueryForEmps(EmView);
                string queryForCardSwapped = "select * from AttData where (TimeIn is not null AND AttDate = '" + day + "') AND ";
                string queryForAbsent = "select * from AttData where (StatusAB = 1 AND AttDate = '" + day + "') AND ";
                string queryOnLeave = "select * from AttData where (StatusHL = 1 OR StatusLeave =1  AND StatusSL=1 AND AttDate = '" + day + "') AND ";

                queryForCardSwapped = queryForCardSwapped + dynamicQueryForEmps;

                singleInstance.CardSwapped = qb.GetValuesfromDB(queryForCardSwapped).ToList<AttData>().Count();
                queryForAbsent = queryForAbsent + dynamicQueryForEmps;
                singleInstance.Absent = qb.GetValuesfromDB(queryForAbsent).ToList<AttData>().Count(); queryOnLeave = queryOnLeave + dynamicQueryForEmps;
                singleInstance.OnLeave = qb.GetValuesfromDB(queryOnLeave).ToList<AttData>().Count();

                //foreach (var emp in EmView)
                //{

                //s= singleInstance.CardSwapped + db.AttDatas.Where(aa => aa.TimeIn != null && aa.AttDate == day && aa.EmpID == emp.EmpID).Count();
                //singleInstance.Absent = singleInstance.Absent+ db.AttDatas.Where(aa => aa.StatusAB == true && aa.AttDate == day && aa.EmpID == emp.EmpID).Count();
                //singleInstance.OnLeave = singleInstance.OnLeave + db.AttDatas.Where(aa => (aa.StatusHL == true || aa.StatusLeave == true || aa.StatusSL == true) && aa.AttDate == day && aa.EmpID == emp.EmpID).Count();

                //}
                singleInstance.date = day;
                attDeptList.Add(singleInstance);
            }

            }
            return attDeptList;
        }
开发者ID:qq5013,项目名称:WMS-Fatima,代码行数:86,代码来源:HRReportsMaker.cs


示例6: JobCardList

        public ActionResult JobCardList(string sortOrder, string searchString, string currentFilter, int? page)
        {
            ViewBag.CurrentSort = sortOrder;
            ViewBag.NameSortParm = String.IsNullOrEmpty(sortOrder) ? "name_desc" : "";
            ViewBag.DesigSortParm = sortOrder == "designation" ? "designation_desc" : "designation";
            ViewBag.SectionSortParm = sortOrder == "section" ? "section_desc" : "section";
            //List<EmpView> emps = new List<EmpView>();
            if (searchString != null)
            {
                page = 1;
            }
            else
            {
                searchString = currentFilter;
            }
            User LoggedInUser = Session["LoggedUser"] as User;
            QueryBuilder qb = new QueryBuilder();
            string query = qb.MakeCustomizeQuery(LoggedInUser);
            DataTable dt = qb.GetValuesfromDB("select * from ViewJobCardApp " + query);
            List<ViewJobCardApp> jobCardsApps = dt.ToList<ViewJobCardApp>();

            // List<EmpView> emps = db.EmpViews.ToList();
            ViewBag.CurrentFilter = searchString;

            if (!String.IsNullOrEmpty(searchString))
            {
                try
                {

                    jobCardsApps = jobCardsApps.Where(s => s.EmpName.ToUpper().Contains(searchString.ToUpper())
                        || s.EmpNo.ToUpper().Contains(searchString.ToUpper()) || s.DesignationName.ToString().Contains(searchString)
                    ).OrderByDescending(aa=>aa.DateCreated).ToList();
                }
                catch (Exception ex)
                {

                    }
            }

            switch (sortOrder)
            {
                case "name_desc":
                    jobCardsApps = jobCardsApps.OrderByDescending(s => s.EmpName).ToList();
                    break;
                case "designation_desc":
                    jobCardsApps = jobCardsApps.OrderByDescending(s => s.DesignationName).ToList();
                    break;
                case "designation":
                    jobCardsApps = jobCardsApps.OrderBy(s => s.DesignationName).ToList();
                    break;
                case "section_desc":
                    jobCardsApps = jobCardsApps.OrderByDescending(s => s.SectionName).ToList();
                    break;
                case "section":
                    jobCardsApps = jobCardsApps.OrderBy(s => s.SectionName).ToList();
                    break;
                default:
                    jobCardsApps = jobCardsApps.OrderBy(s => s.EmpName).ToList();
                    break;
            }
            int pageSize = 10;
            int pageNumber = (page ?? 1);
            return View(jobCardsApps.ToPagedList(pageNumber, pageSize));
        }
开发者ID:linkstatic12,项目名称:NHAWMS,代码行数:64,代码来源:JobCardController.cs


示例7: Index

        // GET: /Designation/
        public ActionResult Index(string sortOrder, string searchString, string currentFilter, int? page)
        {
            if (Session["LogedUserFullname"].ToString() != "")
            {
            ViewBag.CurrentSort = sortOrder;
            ViewBag.NameSortParm = String.IsNullOrEmpty(sortOrder) ? "name_desc" : "";
            if (searchString != null)
            {
                page = 1;
            }
            else
            {
                searchString = currentFilter;
            }

            ViewBag.CurrentFilter = searchString;
            QueryBuilder qb = new QueryBuilder();

            var designation = db.Designations.AsQueryable();
            if (!String.IsNullOrEmpty(searchString))
            {
                designation = designation.Where(s => s.DesignationName.ToUpper().Contains(searchString.ToUpper()));
            }

            switch (sortOrder)
            {
                case "name_desc":
                    designation = designation.OrderByDescending(s => s.DesignationName);
                    break;
                default:
                    designation = designation.OrderBy(s => s.DesignationName);
                    break;
            }
            int pageSize = 8;
            int pageNumber = (page ?? 1);
            return View(designation.ToPagedList(pageNumber, pageSize));
            }
             else
                 return Redirect(Request.UrlReferrer.ToString());
        }
开发者ID:qq5013,项目名称:WMS-Fatima,代码行数:41,代码来源:DesignationController.cs


示例8: BindGridViewLocation

 private void BindGridViewLocation(string search)
 {
     User LoggedInUser = HttpContext.Current.Session["LoggedUser"] as User;
     QueryBuilder qb = new QueryBuilder();
     string query = qb.QueryForLocationTableSegerationForLinq(LoggedInUser);
     List<Location> _View = da.Locations.Where(query).ToList();
     GridViewLocation.DataSource = _View.Where(aa => aa.LocName.ToUpper().Contains(search.ToUpper())).ToList();
     GridViewLocation.DataBind();
 }
开发者ID:qq5013,项目名称:WMS-Fatima,代码行数:9,代码来源:StepOneFilter.aspx.cs


示例9: EditAttJobCard

 public ActionResult EditAttJobCard()
 {
     User LoggedInUser = Session["LoggedUser"] as User;
     string Message = "";
     QueryBuilder qb = new QueryBuilder();
     string query = qb.MakeCustomizeQuery(LoggedInUser);
     DataTable dt = qb.GetValuesfromDB("select * from EmpView " + query);
     List<EmpView> emps = dt.ToList<EmpView>();
     try
     {
         string _EmpNo = "";
         // int CompID = Convert.ToInt16(Request.Form["CompanyID"].ToString());
         List<EmpView> _Emp = new List<EmpView>();
         short _WorkCardID = Convert.ToInt16(Request.Form["JobCardType"].ToString());
         //First Save Job Card Application
         JobCardApp jobCardApp = new JobCardApp();
         jobCardApp.CardType = _WorkCardID;
         jobCardApp.DateCreated = DateTime.Now;
         jobCardApp.DateStarted = Convert.ToDateTime(Request.Form["JobDateFrom"]);
         jobCardApp.DateEnded = Convert.ToDateTime(Request.Form["JobDateTo"]);
         jobCardApp.Status = false;
         jobCardApp.UserID = LoggedInUser.UserID;
         _EmpNo = Request.Form["JobEmpNo"];
         _Emp = emps.Where(aa => aa.EmpNo == _EmpNo).ToList();
         if (_Emp.Count > 0)
         {
             jobCardApp.CriteriaData = _Emp.FirstOrDefault().EmpID;
             jobCardApp.JobCardCriteria = "E";
             if (ValidateJobCard(jobCardApp))
             {
                 db.JobCardApps.Add(jobCardApp);
                 if (db.SaveChanges() > 0)
                 {
                     AddJobCardAppToJobCardData();
                     Message = "Job Card Created Sucessfully.";
                 }
             }
             else
                 Message = "Job Card already created for FPID: " + _EmpNo;
         }
         else
             Message = "No Employee found, Please enter a valid FPID";
         //Add Job Card to JobCardData and Mark Legends in Attendance Data if attendance Created
         Session["EditAttendanceDate"] = DateTime.Today.Date.ToString("yyyy-MM-dd");
         ViewData["datef"] = Session["EditAttendanceDate"].ToString();
         ViewData["JobDateFrom"] = DateTime.Today.AddDays(-1).ToString("yyyy-MM-dd");
         ViewData["JobDateTo"] = DateTime.Today.AddDays(-1).ToString("yyyy-MM-dd");
         ViewBag.JobCardType = new SelectList(db.JobCards, "WorkCardID", "WorkCardName");
     }
     catch (Exception ex)
     {
         Message = "An Error occured while creating Job Card of " + Request.Form["JobCardType"].ToString();
     }
         //List<EmpView> emps = new List<EmpView>();
         ViewData["JobDateFrom"] = DateTime.Today.AddDays(-1).ToString("yyyy-MM-dd");
         ViewData["JobDateTo"] = DateTime.Today.AddDays(-1).ToString("yyyy-MM-dd");
         ViewBag.JobCardType = new SelectList(db.JobCards, "WorkCardID", "WorkCardName");
         ViewBag.CMessage = Message;
         ViewBag.CurrentFilter = "";
         int pageSize = 10;
         int? page = 1;
         int pageNumber = (page ?? 1);
     return View("Index",emps.ToPagedList(pageNumber, pageSize));
 }
开发者ID:linkstatic12,项目名称:NHAWMS,代码行数:64,代码来源:JobCardController.cs


示例10: Index

        // GET: /Emp/
        public ActionResult Index(string sortOrder, string searchString, string currentFilter, int? page)
        {
            ViewBag.CurrentSort = sortOrder;
            ViewBag.NameSortParm = String.IsNullOrEmpty(sortOrder) ? "name_desc" : "";
            ViewBag.DesigSortParm = sortOrder == "designation" ? "designation_desc" : "designation";
            ViewBag.LocSortParm = sortOrder == "location" ? "location_desc" : "location";
            ViewBag.SectionSortParm = sortOrder == "section" ? "section_desc" : "section";
            ViewBag.DepartmentSortParm = sortOrder == "wing" ? "wing_desc" : "wing";
            ViewBag.ShiftSortParm = sortOrder == "shift" ? "shift_desc" : "shift";
            ViewBag.TypeSortParm = sortOrder == "type" ? "type_desc" : "type";
            //List<EmpView> emps = new List<EmpView>();
            if (searchString != null)
            {
                page = 1;
            }
            else
            {
                searchString = currentFilter;
            }
            User LoggedInUser = Session["LoggedUser"] as User;
            QueryBuilder qb = new QueryBuilder();
            string query = qb.MakeCustomizeQuery(LoggedInUser);
            DataTable dt = qb.GetValuesfromDB("select * from EmpView"+query);
            List<EmpView> emps = dt.ToList<EmpView>();

            ViewBag.CurrentFilter = searchString;

            if (!String.IsNullOrEmpty(searchString))
            {
                if (searchString == "Active" || searchString == "active")
                {
                    emps = emps.Where(aa => aa.Status == true).ToList();
                }
                else if (searchString == "Inactive" || searchString == "inactive")
                {
                    emps = emps.Where(aa => aa.Status == false).ToList();
                }
                else
                {
                    try
                    {
                        emps = emps.Where(s => s.EmpName.ToUpper().Contains(searchString.ToUpper())
                         || s.EmpNo.Contains(searchString.ToUpper())
                         || s.SectionName.ToUpper().Contains(searchString.ToUpper())
                         || s.ShiftName.ToUpper().Contains(searchString.ToUpper())
                         || s.DesignationName.ToUpper().Contains(searchString.ToUpper())).ToList();
                    }
                    catch(Exception ex)
                    {

                    }
                }
            }

            switch (sortOrder)
            {
                case "name_desc":
                    emps = emps.OrderByDescending(s => s.EmpName).ToList();
                    break;
                case "designation_desc":
                    emps = emps.OrderByDescending(s => s.DesignationName).ToList();
                    break;
                case "designation":
                    emps = emps.OrderBy(s => s.DesignationName).ToList();
                    break;
                case "location_desc":
                    emps = emps.OrderByDescending(s => s.LocName).ToList();
                    break;
                case "location":
                    emps = emps.OrderBy(s => s.LocName).ToList();
                    break;
                case "section_desc":
                    emps = emps.OrderByDescending(s => s.SectionName).ToList();
                    break;
                case "section":
                    emps = emps.OrderBy(s => s.SectionName).ToList();
                    break;
                //case "wing_desc":
                //    emps = emps.OrderByDescending(s => s.sec.DeptName).ToList();
                //    break;
                //case "wing":
                //    emps = emps.OrderBy(s => s.DeptName).ToList();
                //    break;
                case "shift_desc":
                    emps = emps.OrderByDescending(s => s.ShiftName).ToList();
                    break;
                case "shift":
                    emps = emps.OrderBy(s => s.ShiftName).ToList();
                    break;
                case "type_desc":
                    emps = emps.OrderByDescending(s => s.TypeName).ToList();
                    break;
                case "type":
                    emps = emps.OrderBy(s => s.TypeName).ToList();
                    break;
                default:
                    emps = emps.OrderBy(s => s.EmpName).ToList();
                    break;
            }
//.........这里部分代码省略.........
开发者ID:ahsinanwar,项目名称:SingleCompany,代码行数:101,代码来源:EmpController.cs


示例11: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            String reportName = Request.QueryString["reportname"];
            if (!Page.IsPostBack)
            {
                List<string> list = Session["ReportSession"] as List<string>;
                FiltersModel fm = Session["FiltersModel"] as FiltersModel;
                CreateDataTable();
                User LoggedInUser = HttpContext.Current.Session["LoggedUser"] as User;
                QueryBuilder qb = new QueryBuilder();
                string query = qb.MakeCustomizeQuery(LoggedInUser);
                _dateFrom = list[0];
                string _dateTo = list[1];

                string PathString = "";

                switch (reportName)
                {
                    case "emp_record":   DataTable dt = qb.GetValuesfromDB("select * from EmpView " + query);
                                        List<EmpView> _ViewList = dt.ToList<EmpView>();
                                        List<EmpView> _TempViewList = new List<EmpView>();
                                        title = "Employee Report";
                                         if (GlobalVariables.DeploymentType == false)
                                                                    PathString = "/Reports/RDLC/Employee.rdlc";
                                                               else
                                                                    PathString = "/WMS/Reports/RDLC/Employee.rdlc";

                                        LoadReport(PathString, ReportsFilterImplementation(fm,_TempViewList, _ViewList) , _dateFrom+" TO "+_dateTo);

                           break;

                    case "emp_detail_excel": DataTable dt1 = qb.GetValuesfromDB("select * from EmpView " + query);
                                               List<EmpView> _ViewList1 = dt1.ToList<EmpView>();
                                               List<EmpView> _TempViewList1 = new List<EmpView>();
                                               title = "Employee Detail Report";
                                               if (GlobalVariables.DeploymentType == false)
                                                   PathString = "/Reports/RDLC/EmployeeDetail.rdlc";
                                               else
                                                   PathString = "/WMS/Reports/RDLC/EmployeeDetail.rdlc";
                                               LoadReport(PathString, ReportsFilterImplementation(fm, _TempViewList1, _ViewList1), _dateFrom + " TO " + _dateTo);

                                                break;
                    case "leave_application": dt1 = qb.GetValuesfromDB("select * from ViewLvApplication " + query + " and (FromDate >= '" + _dateFrom + "' and ToDate <= '" + _dateTo + "' )");
                                               List<ViewLvApplication> _ViewListLvApp = dt1.ToList<ViewLvApplication>();
                                               List<ViewLvApplication> _TempViewListLvApp = new List<ViewLvApplication>();
                                                title = "Leave Application Report";
                                                if (GlobalVariables.DeploymentType == false)
                                                    PathString = "/Reports/RDLC/DRLeave.rdlc";
                                                else
                                                    PathString = "/WMS/Reports/RDLC/EmployeeDetail.rdlc";
                                                LoadReport(PathString, ReportsFilterImplementation(fm, _TempViewListLvApp, _ViewListLvApp), _dateFrom + " TO " + _dateTo);

                                                break;
                    case "detailed_att": DataTable dt2 = qb.GetValuesfromDB("select * from ViewDetailAttData " + query + " and (AttDate >= " + "'" + _dateFrom + "'" + " and AttDate <= " + "'"
                                                     + _dateTo + "'" + " )");
                                                List<ViewDetailAttData> _ViewList2 = dt2.ToList<ViewDetailAttData>();
                                                List<ViewDetailAttData> _TempViewList2 = new List<ViewDetailAttData>();
                                                title = "Detailed Attendence";
                                                if (GlobalVariables.DeploymentType == false)
                                                    PathString = "/Reports/RDLC/DRdetailed.rdlc";
                                                else
                                                    PathString = "/WMS/Reports/RDLC/DRdetailed.rdlc";

                                                LoadReport(PathString, ReportsFilterImplementation(fm, _TempViewList2, _ViewList2), _dateFrom + " TO " + _dateTo);

                                                break;
                    case "consolidated_att": DataTable dt3 = qb.GetValuesfromDB("select * from ViewAttData " + query + " and (AttDate >= " + "'" + _dateFrom + "'" + " and AttDate <= " + "'"
                                                     + _dateTo + "'" + " )" );
                                                List<ViewAttData> _ViewList3 = dt3.ToList<ViewAttData>();
                                                List<ViewAttData> _TempViewList3 = new List<ViewAttData>();
                                                title = "Consolidated Attendence";
                                                if (GlobalVariables.DeploymentType == false)
                                                    PathString = "/Reports/RDLC/DRAttendance.rdlc";
                                                else
                                                    PathString = "/WMS/Reports/RDLC/DRAttendance.rdlc";

                                                LoadReport(PathString, ReportsFilterImplementation(fm, _TempViewList3, _ViewList3), _dateFrom + " TO " + _dateTo);

                                                break;
                    case "present": DataTable dt4 = qb.GetValuesfromDB("select * from ViewAttData " + query + " and (AttDate >= " + "'" + _dateFrom + "'" + " and AttDate <= " + "'"
                                                     + _dateTo + "'" + " )" + " and StatusP = 1 ");
                                                List<ViewAttData> _ViewList4 = dt4.ToList<ViewAttData>();
                                                List<ViewAttData> _TempViewList4 = new List<ViewAttData>();
                                                title = "Present Employee Report";
                                                if (GlobalVariables.DeploymentType == false)
                                                    PathString = "/Reports/RDLC/DRPresent.rdlc";
                                                else
                                                    PathString = "/WMS/Reports/RDLC/DRPresent.rdlc";

                                                LoadReport(PathString, ReportsFilterImplementation(fm, _TempViewList4, _ViewList4), _dateFrom + " TO " + _dateTo);

                                                break;
                    case "absent": DataTable dt5 = qb.GetValuesfromDB("select * from ViewAttData " + query + " and (AttDate >= " + "'" + _dateFrom + "'" + " and AttDate <= " + "'"
                                                     + _dateTo + "'" + " )" +" and StatusAB = 1 ");
                                                List<ViewAttData> _ViewList5 = dt5.ToList<ViewAttData>();
                                                List<ViewAttData> _TempViewList5 = new List<ViewAttData>();
                                                title = "Absent Employee Report";
                                                if (GlobalVariables.DeploymentType == false)
                                                    PathString = "/Reports/RDLC/DRAbsent.rdlc";
                                                else
//.........这里部分代码省略.........
开发者ID:qq5013,项目名称:WMS-Fatima,代码行数:101,代码来源:ReportContainer.aspx.cs


示例12: Index

        //
        // GET: /Zones/
        public ActionResult Index(string sortOrder, string searchString, string currentFilter, int? page)
        {
            ViewBag.CurrentSort = sortOrder;
            ViewBag.NameSortParm = String.IsNullOrEmpty(sortOrder) ? "name_desc" : "";
            if (searchString != null)
            {
                page = 1;
            }
            else
            {
                searchString = currentFilter;
            }

            ViewBag.CurrentFilter = searchString;
            User LoggedInUser = HttpContext.Session["LoggedUser"] as User;
            QueryBuilder qb = new QueryBuilder();
            string query = qb.QueryForUserAccess(LoggedInUser, "Zone");
            DataTable dt = qb.GetValuesfromDB("Select * FROM Zone where " + query);
            var zone = dt.ToList<Zone>().AsQueryable();

            if (!String.IsNullOrEmpty(searchString))
            {
                zone = zone.Where(s => s.ZoneName.ToUpper().Contains(searchString.ToUpper()));
            }

            switch (sortOrder)
            {
                case "name_desc":
                    zone = zone.OrderByDescending(s => s.ZoneName);
                    break;
                default:
                    zone = zone.OrderBy(s => s.ZoneName);
                    break;
            }
            int pageSize = 8;
            int pageNumber = (page ?? 1);
            return View(zone.ToPagedList(pageNumber, pageSize));
        }
开发者ID:ahsinanwar,项目名称:WMSNHA2016,代码行数:40,代码来源:ZonesController.cs


示例13: Page_Load

 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         DivGridSection.Visible = false;
         DivGridCrew.Visible = false;
         DivGridDept.Visible = false;
         DivGridEmp.Visible = false;
         DivShiftGrid.Visible = false;
         DivLocGrid.Visible = false;
         DivTypeGrid.Visible = false;
         ReportViewer1.Visible = true;
         ReportViewer1.Width = 1050;
         ReportViewer1.Height = 700;
         SelectedTypes.Clear();
         SelectedCrews.Clear();
         SelectedDepts.Clear();
         SelectedEmps.Clear();
         SelectedLocs.Clear();
         SelectedSections.Clear();
         SelectedShifts.Clear();
         RefreshLabels();
         LoadGridViews();
         if (GlobalVariables.DeploymentType == false)
         {
             PathString = "/Reports/RDLC/YLvConsumed.rdlc";
         }
         else
             PathString = "/WMS/Reports/RDLC/YLvConsumed.rdlc";
         User LoggedInUser = HttpContext.Current.Session["LoggedUser"] as User;
         QueryBuilder qb = new QueryBuilder();
         string query = qb.MakeCustomizeQuery(LoggedInUser);
         DataTable dt = qb.GetValuesfromDB("select * from ViewLvConsumed " + query);
         List<ViewLvConsumed> _ViewList = dt.ToList<ViewLvConsumed>();
         LoadReport(PathString, _ViewList);
     }
 }
开发者ID:qq5013,项目名称:WMS-Fatima,代码行数:37,代码来源:YLvConsumed.aspx.cs


示例14: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {

                DateTime date = DateTime.Today.Date.AddDays(-1);
                if (GlobalVariables.DeploymentType == false)
                {
                    PathString = "/Reports/RDLC/DRDetailed.rdlc";
                }
                else
                    PathString = "/WMS/Reports/RDLC/DRDetailed.rdlc";
                //List<ViewMultipleInOut> _View = new List<ViewMultipleInOut>();
                User LoggedInUser = HttpContext.Current.Session["LoggedUser"] as User;
                QueryBuilder qb = new QueryBuilder();
                string query = qb.MakeCustomizeQuery(LoggedInUser);
                DataTable dt = qb.GetValuesfromDB("select * from ViewMultipleInOut " + query +" and AttDate = '"+ date.Date.Year.ToString()+"-"+date.Date.Month.ToString()+"-"+date.Date.Day.ToString()+"'");
                List<ViewMultipleInOut> _View = dt.ToList<ViewMultipleInOut>();
                Load 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Models.TAS2013Entities类代码示例发布时间:2022-05-26
下一篇:
C# Model.ExecResult类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap