示例#1
0
        private void FetchingDashbordData(DashbordInfo data, SqlDataReader reader, SafeDataReader safe)
        {
            System.Diagnostics.StackFrame stackFrame = new System.Diagnostics.StackFrame();
            System.Reflection.MethodBase methodBase = stackFrame.GetMethod();
            log.Debug("Start: " + methodBase.Name);
            try
            {

                //UnAssigned
                while (reader.Read())
                {
                    var ObjGetDashBord = new Dashbord();
                    ObjGetDashBord.FetchUnAssignedWODetails(ObjGetDashBord, safe);
                    data.WOUnAssignedList.Add(ObjGetDashBord);
                }

                //Assigned
                reader.NextResult();
                while (reader.Read())
                {
                    var ObjGetDashBord = new Dashbord();
                    ObjGetDashBord.FetchAssignedWODetails(ObjGetDashBord, safe);
                    data.WOAssignedList.Add(ObjGetDashBord);
                }

                //Draft
                reader.NextResult();
                while (reader.Read())
                {
                    var ObjGetDashBord = new Dashbord();
                    ObjGetDashBord.FetchWODraftDetails(ObjGetDashBord, safe);
                    data.WODraftList.Add(ObjGetDashBord);
                }

                //Document generated
                reader.NextResult();
                while (reader.Read())
                {
                    var ObjGetDashBord = new Dashbord();
                    ObjGetDashBord.FetchWODocGeneratedDetails(ObjGetDashBord, safe);
                    data.WODocGeneratedList.Add(ObjGetDashBord);
                }

                //Completed
                reader.NextResult();
                while (reader.Read())
                {
                    var ObjGetDashBord = new Dashbord();
                    ObjGetDashBord.FetchWOCompletedDetails(ObjGetDashBord, safe);
                    data.WOCompletedList.Add(ObjGetDashBord);
                }

            }
            catch (Exception ex)
            {
                log.Error("Error: " + ex);
            }
            finally
            {
                log.Debug("End: " + methodBase.Name);
            }
        }
示例#2
0
 public JsonResult GetDashbordDetails()
 {
     System.Diagnostics.StackFrame stackFrame = new System.Diagnostics.StackFrame();
     System.Reflection.MethodBase methodBase = stackFrame.GetMethod();
     log.Debug("Start: " + methodBase.Name);
     try
     {
         int checkSession = UserLogin.AuthenticateRequest();
         if (checkSession == 0)
         {
             return Json(checkSession);
         }
         else
         {
             Dashbord objDashbord = new Dashbord();
             DashbordInfo DashbordInfo = new DashbordInfo();
             int userID = Convert.ToInt32(Session["UserID"]);
             var dataresult = objDashbord.GetDashbordDetails(userID);
             return Json(dataresult);
         }
     }
     catch (Exception ex)
     {
         log.Error("Error: " + ex);
         return Json("");
     }
     finally
     {
         log.Debug("End: " + methodBase.Name);
     }
 }
示例#3
0
        /// <summary>
        /// Description  : To get DashBord Details.
        /// Created By   : Sudheer  
        /// Created Date : 7th Oct 2014
        /// Modified By  :
        /// Modified Date:
        /// </summary>
        /// <returns></returns>
        public DashbordInfo GetDashbordDetails(int userID)
        {
            var data = new DashbordInfo();

            System.Diagnostics.StackFrame stackFrame = new System.Diagnostics.StackFrame();
            System.Reflection.MethodBase methodBase = stackFrame.GetMethod();
            log.Debug("Start: " + methodBase.Name);
            try
            {
                var getWorkOrder = new List<Dashbord>();
                SqlParameter[] sqlParams = new SqlParameter[1];
                sqlParams[0] = new SqlParameter("@userID", userID);

                var reader = SqlHelper.ExecuteReader(ConnectionUtility.GetConnectionString(), CommandType.StoredProcedure, "SpGetDashbordDetails", sqlParams);
                var safe = new SafeDataReader(reader);

                var WorkOrderList = new Dashbord();
                WorkOrderList.FetchingDashbordData(data, reader, safe);
                // getWorkOrder.Add(WorkOrderList);
                return data;
            }
            catch (Exception ex)
            {
                log.Error("Error: " + ex);
                return data;
            }
            finally
            {
                log.Debug("End: " + methodBase.Name);
            }
        }