Exemplo n.º 1
0
 public JsonResult DeleteWorkOrderById(int ID, string StatusCode)
 {
     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
         {
             WorkOrders objWO = new WorkOrders();
             int result = objWO.DeleteWorkOrderById(ID, StatusCode);
             return Json(result);
         }
     }
     catch (Exception ex)
     {
         log.Error("Error: " + ex);
         return Json("");
     }
     finally
     {
         log.Debug("End: " + methodBase.Name);
     }
 }
Exemplo n.º 2
0
        private WorkOrders FetchWorkOrderType(WorkOrders SerchWO, SafeDataReader dr)
        {
            SerchWO.Code = dr.GetString("Code");
            SerchWO.Name = dr.GetString("Name");

            return SerchWO;
        }
Exemplo n.º 3
0
 private WorkOrders FetchWOTypeOrCategory(WorkOrders WOTypeOrCategory, SafeDataReader dr)
 {
     WOTypeOrCategory.Name = dr.GetString("Name");
     WOTypeOrCategory.Code = dr.GetString("Code");
     return WOTypeOrCategory;
 }
Exemplo n.º 4
0
 private WorkOrders FetchingSerchWOData(WorkOrders SerchWO, SafeDataReader dr)
 {
     SerchWO.ID = dr.GetInt32("ID");
     SerchWO.RefID = SerchWO.ID;
     SerchWO.WorkOrderType = dr.GetString("Type");
     // SerchWO.Description = dr.GetString("Description");
     SerchWO.Status = dr.GetBoolean("Status");
     SerchWO.EditStatus = dr.GetBoolean("EditStatus");
     SerchWO.WorkOrderTypeText = dr.GetString("wotypetext");
     SerchWO.ClientId = dr.GetString("ClientName");
     SerchWO.WorkOrderID = dr.GetString("WOCode");
     SerchWO.NoteCount = dr.GetInt32("NoteCount");
     SerchWO.NoteType = dr.GetString("NoteType");
     SerchWO.StatusCode = dr.GetString("Name");
     SerchWO.BillingPartyName = dr.GetString("BillingPartyName");
     SerchWO.CreatedDate = dr.GetDateTime("CreatedDate").ToString("dd MMM yyyy hh:mm:ss tt");
     SerchWO.IsAdhoc = dr.GetBoolean("IsAdhoc");
     SerchWO.IsPostedToCss1 = dr.GetBoolean("IsPostedToCss1");
     return SerchWO;
 }
Exemplo n.º 5
0
 private WorkOrders FetchingSerchWODataByWO(WorkOrders SerchWO, SafeDataReader dr)
 {
     SerchWO.ID = dr.GetInt32("ID");
     SerchWO.ClientId = dr.GetString("ClientCode");
     SerchWO.WOCode = dr.GetString("WOCode");
     SerchWO.GroupCode = dr.GetString("GroupCode");
     SerchWO.IsBillable = dr.GetBoolean("IsBillable");
     SerchWO.IsAdhoc = dr.GetBoolean("IsAdhoc");
     SerchWO.IsPostedToCss1 = dr.GetBoolean("IsPostedToCss1");
     SerchWO.CategoryCode = dr.GetString("CategoryCode");
     SerchWO.SourceID = dr.GetString("SourceID");
     SerchWO.WorkOrderType = dr.GetString("Type");
     SerchWO.ClientName = dr.GetString("ClientName");
     SerchWO.StatusCode = dr.GetString("StatusCode");
     // SerchWO.Status = dr.GetBoolean("Status");
     SerchWO.WorkOrderTypeText = dr.GetString("TypeName");
     SerchWO.BillingPartyName = dr.GetString("BillingParty");
     SerchWO.BillingPartyID = dr.GetInt32("BillingPartyID");
     SerchWO.BillingPartySourceID = dr.GetString("BillingPartySourceID");
     SerchWO.Description = dr.GetString("Description");
     return SerchWO;
 }
Exemplo n.º 6
0
        /// <summary>
        /// Description  : Get ID and Name from MWorkOrderType from database for Type dropdown in WorkOrder. 
        /// Created By   : Shiva
        /// Created Date : 20 May 2014
        /// Modified By  :
        /// Modified Date:
        /// </summary>
        /// <returns></returns>
        public static WorkOrderInfo GetWorkOrderType()
        {
            var data = new WorkOrderInfo();

            System.Diagnostics.StackFrame stackFrame = new System.Diagnostics.StackFrame();
            System.Reflection.MethodBase methodBase = stackFrame.GetMethod();
            log.Debug("Start: " + methodBase.Name);
            try
            {
                var lstWorkOrder = new List<WorkOrders>();

                var reader = SqlHelper.ExecuteReader(ConnectionUtility.GetConnectionString(), CommandType.StoredProcedure, "SPGetMWorkOrderType");
                var safe = new SafeDataReader(reader);
                while (reader.Read())
                {
                    var getIDFromDIType = new WorkOrders();
                    getIDFromDIType.FetchWorkOrderType(getIDFromDIType, safe);
                    lstWorkOrder.Add(getIDFromDIType);
                }
                data.WorkOrdersList = lstWorkOrder;
                return data;
            }
            catch (Exception ex)
            {
                log.Error("Error: " + ex);
                return data;
            }
            finally
            {
                log.Debug("End: " + methodBase.Name);
            }
        }
Exemplo n.º 7
0
        /// <summary>
        /// Description  : To Show all the Workorders SearchWO List 
        /// Created By   : hussain
        /// Created Date : 27 May 2014
        /// Modified By  :
        /// Modified Date:
        /// </summary>
        /// <returns>it will give all the Workorders details available in database</returns>
        public static WorkOrderInfo GetWorkOrderDetailsById(int ID)
        {
            var data = new WorkOrderInfo();

            System.Diagnostics.StackFrame stackFrame = new System.Diagnostics.StackFrame();
            System.Reflection.MethodBase methodBase = stackFrame.GetMethod();
            log.Debug("Start: " + methodBase.Name);
            try
            {
                var getWorkOrder = new List<WorkOrders>();
                SqlParameter[] sqlParams = new SqlParameter[1];
                sqlParams[0] = new SqlParameter("@ID", ID);
                var reader = SqlHelper.ExecuteReader(ConnectionUtility.GetConnectionString(), CommandType.StoredProcedure, "SpGetWorkorderById", sqlParams);
                var WorkOrderList = new WorkOrders();
                var safe = new SafeDataReader(reader);
                while (reader.Read())
                {
                    WorkOrderList.FetchingSerchWODataByWO(WorkOrderList, safe);
                    getWorkOrder.Add(WorkOrderList);
                }
                data.WorkOrdersList = getWorkOrder;

                reader.NextResult();
                while (reader.Read())
                {
                    var Assignment = new WOAssignment();
                    Assignment.FetchWOAssignmentDetails(Assignment, safe);
                    data.WOAssignment.Add(Assignment);
                }
                return data;
            }
            catch (Exception ex)
            {
                log.Error("Error: " + ex);
                return data;
            }
            finally
            {
                log.Debug("End: " + methodBase.Name);
            }
        }
Exemplo n.º 8
0
        /// <summary>
        /// Description  : To Show all the Workorders SearchWO List 
        /// Created By   : hussain
        /// Created Date : 27 May 2014
        /// Modified By  :
        /// Modified Date:
        /// </summary>
        /// <returns>it will give all the Workorders details available in database</returns>
        public static WorkOrderInfo GetSerchWOData(string ClientId, string SourceID, string WorkOrderID, string statusCode, int startpage, int rowsperpage, string Type, string OrderBy, string FromDate, string ToDate, int CreatedBy, string IsAdhoc, string AssignedTo)
        {
            var data = new WorkOrderInfo();

            System.Diagnostics.StackFrame stackFrame = new System.Diagnostics.StackFrame();
            System.Reflection.MethodBase methodBase = stackFrame.GetMethod();
            log.Debug("Start: " + methodBase.Name);
            try
            {
                var getWorkOrder = new List<WorkOrders>();
                SqlParameter[] sqlParams = new SqlParameter[13];
                sqlParams[0] = new SqlParameter("@startPage", startpage);
                sqlParams[1] = new SqlParameter("@resultPerPage", rowsperpage);
                sqlParams[2] = new SqlParameter("@ClientId", ClientId);
                sqlParams[3] = new SqlParameter("@SourceID", SourceID);
                sqlParams[4] = new SqlParameter("@WorkOrderID", WorkOrderID);
                sqlParams[5] = new SqlParameter("@status", statusCode);
                sqlParams[6] = new SqlParameter("@Type", Type);
                sqlParams[7] = new SqlParameter("@OrderBy", OrderBy);
                sqlParams[8] = new SqlParameter("@FromDate", HelperClasses.ConvertDateFormat(FromDate));
                sqlParams[9] = new SqlParameter("@ToDate", HelperClasses.ConvertDateFormat(ToDate));
                sqlParams[10] = new SqlParameter("@CreatedBy", CreatedBy);
                sqlParams[11] = new SqlParameter("@IsAdhoc", IsAdhoc);
                sqlParams[12] = new SqlParameter("@AssignedTo", AssignedTo);
                var reader = SqlHelper.ExecuteReader(ConnectionUtility.GetConnectionString(), CommandType.StoredProcedure, "[SpGetAllWorkOrder]", sqlParams);
                var safe = new SafeDataReader(reader);
                while (reader.Read())
                {
                    var WorkOrderList = new WorkOrders();
                    WorkOrderList.FetchingSerchWOData(WorkOrderList, safe);
                    getWorkOrder.Add(WorkOrderList);
                    data.workorderCount = Convert.ToInt32(reader["Workordercount"]);
                }
                data.WorkOrdersList = getWorkOrder;
                return data;
            }
            catch (Exception ex)
            {
                log.Error("Error: " + ex);
                return data;
            }
            finally
            {
                log.Debug("End: " + methodBase.Name);
            }
        }
Exemplo n.º 9
0
        /// <summary>
        /// Description  : To get MWOType by Category Code.
        /// Created By   : Shiva
        /// Created Date : 15 July 2014
        /// Modified By  :
        /// Modified Date:
        /// </summary>
        /// <returns></returns>
        public static WorkOrderInfo GetMWOTypeByCategoryCode(string CategoryCode)
        {
            var WOTypeByCategoryCodeData = new WorkOrderInfo();

            System.Diagnostics.StackFrame stackFrame = new System.Diagnostics.StackFrame();
            System.Reflection.MethodBase methodBase = stackFrame.GetMethod();
            log.Debug("Start: " + methodBase.Name);
            try
            {
                var lstWOType = new List<WorkOrders>();
                SqlParameter[] sqlParams = new SqlParameter[1];
                sqlParams[0] = new SqlParameter("@CategoryCode", CategoryCode);
                var reader = SqlHelper.ExecuteReader(ConnectionUtility.GetConnectionString(), CommandType.StoredProcedure, "SpGetMWOTypeByCategoryCode", sqlParams);
                var safe = new SafeDataReader(reader);
                while (reader.Read())
                {
                    var GetMWOType = new WorkOrders();
                    GetMWOType.FetchWOTypeOrCategory(GetMWOType, safe);
                    lstWOType.Add(GetMWOType);
                }
                WOTypeByCategoryCodeData.WorkOrdersList = lstWOType;
                return WOTypeByCategoryCodeData;
            }
            catch (Exception ex)
            {
                log.Error("Error: " + ex);
                return WOTypeByCategoryCodeData;
            }
            finally
            {
                log.Debug("End: " + methodBase.Name);
            }
        }
Exemplo n.º 10
0
        /// <summary>
        /// Description  : To get DashBord Details.
        /// Created By   : Sudheer  
        /// Created Date : 7th Oct 2014
        /// Modified By  :
        /// Modified Date:
        /// </summary>
        /// <returns></returns>
        public static object GetDashbordDetails()
        {
            var data = new WorkOrderInfo();

            System.Diagnostics.StackFrame stackFrame = new System.Diagnostics.StackFrame();
            System.Reflection.MethodBase methodBase = stackFrame.GetMethod();
            log.Debug("Start: " + methodBase.Name);
            try
            {
                var getWorkOrder = new List<WorkOrders>();
                var reader = SqlHelper.ExecuteReader(ConnectionUtility.GetConnectionString(), CommandType.StoredProcedure, "SpGetDashbordDetails");
                var safe = new SafeDataReader(reader);
                while (reader.Read())
                {
                    var WorkOrderList = new WorkOrders();
                    WorkOrderList.FetchingSerchWOData(WorkOrderList, safe);
                    getWorkOrder.Add(WorkOrderList);
                    data.workorderCount = Convert.ToInt32(reader["Workordercount"]);
                }
                data.WorkOrdersList = getWorkOrder;
                return data;
            }
            catch (Exception ex)
            {
                log.Error("Error: " + ex);
                return data;
            }
            finally
            {
                log.Debug("End: " + methodBase.Name);
            }
        }