Exemplo n.º 1
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);
     }
 }
Exemplo n.º 2
0
        private Dashbord FetchWODraftDetails(Dashbord WorkOrderList, SafeDataReader dr)
        {
            WorkOrderList.WorkOrderID = dr.GetString("WOID");
            WorkOrderList.WorkOrderTypeText = dr.GetString("Type");
            WorkOrderList.Name = dr.GetString("ClientName");
            WorkOrderList.CreatedBy = dr.GetString("CreatedBy");
            WorkOrderList.UpdatedDate = dr.GetDateTime("UpdatedDate").ToString("dd MMM yyyy hh:mm:ss tt");
            WorkOrderList.WOCode = dr.GetString("WO");
            WorkOrderList.GroupCode = dr.GetString("GroupCode");

            WorkOrderList.RefID = dr.GetInt32("WOID");
            WorkOrderList.NoteCount = dr.GetInt32("NoteCount");
            WorkOrderList.NoteType = dr.GetString("NoteType");
            WorkOrderList.RowCount = dr.GetString("RowCount");
            return WorkOrderList;
        }
Exemplo n.º 3
0
        private Dashbord FetchAssignedWODetails(Dashbord WorkOrderList, SafeDataReader dr)
        {
            WorkOrderList.WorkOrderID = dr.GetString("WOID");
            WorkOrderList.WorkOrderTypeText = dr.GetString("Type");
            WorkOrderList.Name = dr.GetString("ClientName");
            WorkOrderList.AssignedTo = dr.GetString("AssignedTo");
            WorkOrderList.AssignedDate = dr.GetDateTime("AssignedDate").ToString("dd MMM yyyy hh:mm:ss tt");
            WorkOrderList.WOCode = dr.GetString("WO");
            WorkOrderList.GroupCode = dr.GetString("GroupCode");

            WorkOrderList.RefID = dr.GetInt32("WOID");
            WorkOrderList.NoteCount = dr.GetInt32("NoteCount");
            WorkOrderList.NoteType = dr.GetString("NoteType");
            WorkOrderList.ColorFlag = dr.GetString("ColorFlag");
            WorkOrderList.RowCount = dr.GetString("RowCount");
            return WorkOrderList;
        }
Exemplo n.º 4
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);
            }
        }
Exemplo n.º 5
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);
            }
        }