Ejemplo n.º 1
0
        public void ProcessRequest(HttpContext context)
        {
            int?ProjectID = 0, UserID = 0;
            GlobalAdminManager _GlobalAdminManager = new GlobalAdminManager();

            System.Collections.Specialized.NameValueCollection forms = context.Request.Form;
            HttpRequest  request  = context.Request;
            HttpResponse response = context.Response;

            string strOperation   = forms.Get("oper");
            string _search        = request["_search"];
            string textSearch     = request["txtSearch"] ?? "";
            int?   numberOfRows   = Convert.ToInt32(request["rows"]);
            int?   pageIndex      = Convert.ToInt32(request["page"]);
            string sortColumnName = request["sidx"];
            string sortOrderBy    = request["sord"];
            string filter         = request["filter"];

            if (request["UserID"] != "")
            {
                UserID = Convert.ToInt32(request["UserID"]);
                //obj_StaffUserBusiness.Deleteuser(id);
            }
            if (request["UserID"] != "")
            {
                UserID = Convert.ToInt32(request["UserID"]);
                //obj_StaffUserBusiness.Deleteuser(id);
            }
            DateTime        StartDate     = DateTime.UtcNow;
            DateTime        EndDate       = DateTime.UtcNow;
            eTracLoginModel ObjLoginModel = null;
            long            iUserID       = 0;

            if (context.Session["eTrac"] != null)
            {
                ObjLoginModel = (eTracLoginModel)(context.Session["eTrac"]);
                iUserID       = ObjLoginModel.UserId;
            }
            long            LocationID        = Convert.ToInt64(context.Session["eTrac_SelectedDasboardLocationID"]);
            ObjectParameter paramTotalRecords = new ObjectParameter("TotalRecords", typeof(int));
            var             WorkRequestList   = _GlobalAdminManager.GetAllWorkRequestAssignment(ProjectID, UserID, "GetWorkOrderWeekHistory", pageIndex, numberOfRows, sortColumnName, sortOrderBy, textSearch, LocationID, iUserID, StartDate, EndDate, filter, "", paramTotalRecords);

            if (WorkRequestList.Count() > 0)
            {
                string output = BuildJQGridResults(WorkRequestList, Convert.ToInt32(numberOfRows), Convert.ToInt32(pageIndex), Convert.ToInt32(paramTotalRecords.Value));
                response.Write(output);
            }
            else
            {
                JQGridResults    result = new JQGridResults();
                List <JQGridRow> rows   = new List <JQGridRow>();
                result.rows    = rows.ToArray();
                result.page    = 0;
                result.total   = 0;
                result.records = 0;
                response.Write(new JavaScriptSerializer().Serialize(result));
            }
        }
Ejemplo n.º 2
0
        /// <summary>Create
        /// <CreatedBy>Nagendra Upwanshi</CreatedBy>
        /// <CreatedOn>Nov-18-2014</CreatedOn>
        /// <CreatedFor>Load UI for Create New User</CreatedFor>
        /// </summary>
        /// <param name="usr"></param>
        /// <returns></returns>
        public ActionResult Index(string usr)
        {
            try
            {
                long            LocationID = 0, UserID = 0;
                eTracLoginModel obj_eTracLoginModel = new eTracLoginModel();
                if (Session["eTrac"] != null)
                {
                    obj_eTracLoginModel = (eTracLoginModel)Session["eTrac"];
                    UserID     = obj_eTracLoginModel.UserId;
                    LocationID = Convert.ToInt64(Session["eTrac_SelectedDasboardLocationID"]);
                }
                ObjectParameter    obj_ObjectParameter    = new ObjectParameter("TotalRecords", typeof(int));
                ObjectParameter    obj_ObjectParameter2   = new ObjectParameter("TotalRecords", typeof(int));
                GlobalAdminManager obj_GlobalAdminManager = new GlobalAdminManager();
                //  ViewBag.AllWorkOrder = obj_GlobalAdminManager.GetAllWorkRequestAssignment(0, 0, "GetAllWorkRequestAssignment", 1, 100000000, "WorkRequestAssignmentID", "asc", "", LocationID, obj_eTracLoginModel.UserId, DateTime.Now, DateTime.Now, "", obj_ObjectParameter).Count();
                ViewBag.AllAssignedWorkOrder = obj_GlobalAdminManager.GetAllWorkRequestAssignment(0, 0, "GetAllAssignedWorkRequest", 1, 100000000, "WorkRequestAssignmentID", "asc", "", LocationID, obj_eTracLoginModel.UserId, DateTime.Now, DateTime.Now, "", obj_ObjectParameter2).Count();

                return(View());
            }
            catch (Exception ex)
            { ViewBag.Message = ex.Message; ViewBag.AlertMessageClass = ObjAlertMessageClass.Danger; return(View("Error")); }
        }