Esempio n. 1
0
        public ActionResult _DetailODSResumen(int OrderID)
        {
            var dataODS = FacadeOrder.Get(OrderID);

            ViewBag.dataODS = dataODS;

            return(PartialView());
        }
Esempio n. 2
0
        public ActionResult _DetailODSCP(int OrderID)
        {
            var dataODS    = FacadeOrder.Get(OrderID);
            var dataClient = FacadeClient.GetByID(dataODS.FK_ClientID);
            var dataBI     = FacadeInstalledBase.GetByID(dataODS.FK_InstalledBaseID);

            ViewBag.dataODS    = dataODS;
            ViewBag.dataClient = dataClient;
            return(PartialView());
        }
Esempio n. 3
0
        public ActionResult _DetailODSNotes(int OrderID)
        {
            var dataODS   = FacadeOrder.Get(OrderID);
            var dataVisit = FacadeVisit.GetByOrderID(OrderID);

            ViewBag.dataODS   = dataODS;
            ViewBag.dataVisit = dataVisit;

            return(PartialView());
        }
Esempio n. 4
0
        public ActionResult _DetailODS(int MonitorID)
        {
            var dataMonitor = FacadeMonitor.Get(MonitorID);
            var dataODS     = FacadeOrder.Get(dataMonitor.OrderID);
            var dataTecnico = FacadeEmployee.GetID(dataODS.FK_EmployeeID.Value);

            ViewBag.dataODS     = dataODS;
            ViewBag.dataMonitor = dataMonitor;
            ViewBag.dataTecnico = dataTecnico;

            return(PartialView());
        }
Esempio n. 5
0
        public ActionResult _DetailODSIP(int OrderID)
        {
            var dataODS       = FacadeOrder.Get(OrderID);
            var dataInvoicing = FacadeInvoicing.GetPolicyInvoice(OrderID, "");
            var dataPayment   = FacadePayment.GetPaymetByType(OrderID);

            ViewBag.dataODS       = dataODS;
            ViewBag.dataInvoicing = dataInvoicing;
            ViewBag.dataPayment   = dataPayment;

            return(PartialView());
        }
Esempio n. 6
0
        public ActionResult _DetailODSIB(int OrderID)
        {
            var dataODS       = FacadeOrder.Get(OrderID);
            var dataIB        = FacadeInstalledBase.GetByID(dataODS.FK_InstalledBaseID);
            var dataProduct   = FacadeProduct.GetByID(dataIB.FK_ProductID.Value);
            var dataShopPlace = FacadeShopPlace.Get(dataIB.FK_ShopPlaceID.Value);

            ViewBag.dataODS       = dataODS;
            ViewBag.dataIB        = dataIB;
            ViewBag.dataProduct   = dataProduct;
            ViewBag.dataShopPlace = dataShopPlace;

            return(PartialView());
        }
Esempio n. 7
0
        public ActionResult _ODSAssignament(int MonitorID)
        {
            var dataMonitor = FacadeMonitor.Get(MonitorID);
            var dataODS     = FacadeOrder.Get(dataMonitor.OrderID);
            var dataModule  = FacadeModuleService.GetAllBYModule(dataODS.FK_ModuleID.Value);
            var dataTecnico = FacadeEmployee.GetID(dataODS.FK_EmployeeID.Value);

            ViewBag.dataODS     = dataODS;
            ViewBag.dataMonitor = dataMonitor;
            ViewBag.dataTecnico = dataTecnico;
            ViewBag.monitorID   = MonitorID;
            ViewBag.dataModule  = dataModule;
            return(PartialView());
        }
        public ActionResult SaveAsig(int Newuser, int order)
        {
            var datauser = FacadeEmployee.GetEmployeeByUser(Newuser);

            var dataMonitor = FacadeMonitor.Get(order);
            var dataODS     = FacadeOrder.Get(dataMonitor.OrderID);
            var EmployeeID  = datauser[0].PK_EmployeeID;
            var OrderID     = dataODS.PK_OrderID;

            FacadeOrder.SetUser(OrderID, EmployeeID);


            var result = "Success";

            return(Json(result));
        }
Esempio n. 9
0
        public ActionResult _DetailODSFR(int OrderID)
        {
            var dataODS = FacadeOrder.Get(OrderID);
            var dataRef = FacadeSparePart.GetByOrderID(OrderID);

            string desc1 = "", desc2 = "", desc3 = "", desc4 = "", desc5 = "";

            if (!string.IsNullOrEmpty(dataODS.Failure1))
            {
                desc1 = FacadeCodeFailure.GetByCodeFailure(dataODS.Failure1).Failure;
            }
            if (!string.IsNullOrEmpty(dataODS.Failure2))
            {
                desc2 = FacadeCodeFailure.GetByCodeFailure(dataODS.Failure2).Failure;
            }
            if (!string.IsNullOrEmpty(dataODS.Failure3))
            {
                desc3 = FacadeCodeFailure.GetByCodeFailure(dataODS.Failure3).Failure;
            }
            if (!string.IsNullOrEmpty(dataODS.Failure4))
            {
                desc4 = FacadeCodeFailure.GetByCodeFailure(dataODS.Failure4).Failure;
            }
            if (!string.IsNullOrEmpty(dataODS.Failure5))
            {
                desc5 = FacadeCodeFailure.GetByCodeFailure(dataODS.Failure5).Failure;
            }


            ViewBag.desc1 = desc1;
            ViewBag.desc2 = desc2;
            ViewBag.desc3 = desc3;
            ViewBag.desc4 = desc4;
            ViewBag.desc5 = desc5;

            var dataGuranty = FacadeGuaranty.Get(dataODS.FK_GuarantyID.Value);



            ViewBag.dataODS     = dataODS;
            ViewBag.dataRef     = dataRef;
            ViewBag.dataGuranty = dataGuranty;


            return(PartialView());
        }
Esempio n. 10
0
        public ActionResult _DetailDistance(int orderID)
        {
            string refMan        = "8011161600000025";
            var    dataMonitor   = FacadeMonitor.GetByOrderID(orderID);
            var    dataODS       = FacadeOrder.Get(orderID);
            var    dataModule    = FacadeModuleService.GetAllBYModule(dataODS.FK_ModuleID.Value);
            var    dataSparePart = FacadeSparePart.GetByRefManID(orderID, refMan);

            if (dataSparePart == null)
            {
                ViewBag.Kilometres = 0;
            }
            else
            {
                ViewBag.Kilometres = dataSparePart.Quantity;
            }
            ViewBag.dataODS     = dataODS;
            ViewBag.dataMonitor = dataMonitor;
            ViewBag.dataModule  = dataModule;


            return(PartialView());
        }
        public ActionResult GetList_UserTA(int monitorID)
        {
            var dataMonitor = FacadeMonitor.Get(monitorID);


            if (dataMonitor.StatusVisitID == 1)
            {
                var dataODS      = FacadeOrder.Get(dataMonitor.OrderID);
                var dataEmployee = FacadeEmployee.GetID(dataODS.FK_EmployeeID.Value);
                var dataUser     = FacadeUsers.GetByID(dataEmployee.FK_UserID.Value);
                var ls           = FacadeUsers.GetAllUserModuleProfile(dataEmployee.FK_ModuleID, dataUser.ProfileID).Select(p => new SelectListItem()
                {
                    Text  = p.Name,
                    Value = p.UserID.ToString()
                }
                                                                                                                            ).Where(p => p.Text != dataUser.Name).ToList <SelectListItem>();
                return(Json(ls, JsonRequestBehavior.AllowGet));
            }
            else
            {
                var result = "error";
                return(Json(result));
            }
        }
Esempio n. 12
0
        static void Main(string[] args)
        {
            var arrODS = FacadeOrder.GetAll().Where(p => p.OrderExecuteDate.Equals(new DateTime(2017, 11, 8)));
            int j      = 1;

            Console.WriteLine("Total: " + arrODS.Count().ToString());

            foreach (var i in arrODS)
            {
                try
                {
                    Console.WriteLine(j.ToString() + " de " + arrODS.Count().ToString());

                    var dataODS           = FacadeOrder.Get(i.PK_OrderID);
                    var dataClient        = FacadeClient.GetByID(i.FK_ClientID);
                    var dataBaseInstalled = FacadeInstalledBase.GetByID(dataODS.FK_InstalledBaseID);
                    var dataProduct       = FacadeProduct.GetByID(dataBaseInstalled.FK_ProductID.Value);
                    var dataHistory       = FacadeMabe.HistoryODSByClient(dataClient.ClientID, dataBaseInstalled.InstalledBaseID);

                    // insertar datos order history
                    foreach (var item in dataHistory)
                    {
                        var dataDBHistory = FacadeHistory.GetByOrderID(dataODS.PK_OrderID);

                        if (dataDBHistory.Where(p => p.OrderID == item.ID_Oper).Count() > 0)
                        {
                            // update
                            var entity = dataDBHistory.Where(p => p.OrderID == item.ID_Oper).FirstOrDefault();
                            entity.CloseDate          = ParseDate(item.Fecha_Cierre_Orden);
                            entity.Failure1           = string.IsNullOrEmpty(item.Desc_ID_Falla1) ? "" : item.Desc_ID_Falla1;
                            entity.Failure2           = string.IsNullOrEmpty(item.Desc_ID_Falla2) ? "" : item.Desc_ID_Falla2;
                            entity.Failure3           = string.IsNullOrEmpty(item.Desc_ID_Falla3) ? "" : item.Desc_ID_Falla3;
                            entity.FailureID1         = string.IsNullOrEmpty(item.ID_Falla1) ? "" : item.ID_Falla1;
                            entity.FailureID2         = string.IsNullOrEmpty(item.ID_Falla2) ? "" : item.ID_Falla2;
                            entity.FailureID3         = string.IsNullOrEmpty(item.ID_Falla3) ? "" : item.ID_Falla3;
                            entity.FK_ClientID        = dataODS.FK_ClientID;
                            entity.FK_InstalledBaseID = dataODS.FK_InstalledBaseID;
                            entity.FK_OrderID         = dataODS.PK_OrderID;
                            entity.Guaranty           = string.IsNullOrEmpty(item.Tipo_Serv) ? "" : item.Tipo_Serv;
                            entity.ItemStatus         = string.IsNullOrEmpty(item.Estatus_Visita) ? "" : item.Estatus_Visita;
                            entity.ModifyDate         = DateTime.UtcNow;
                            entity.OrderID            = string.IsNullOrEmpty(item.ID_Oper) ? "" : item.ID_Oper;
                            entity.OrderStatus        = string.IsNullOrEmpty(item.Estatus_Oper) ? "" : item.Estatus_Oper;
                            entity.ShopDate           = new DateTime(1980, 1, 1);
                            entity.Status             = true;
                            FacadeHistory.Update(entity);
                        }
                        else
                        {
                            // insert
                            var entity = new EntityHistory();
                            entity.CloseDate          = ParseDate(item.Fecha_Cierre_Orden);
                            entity.CreateDate         = DateTime.UtcNow;
                            entity.Failure1           = string.IsNullOrEmpty(item.Desc_ID_Falla1) ? "" : item.Desc_ID_Falla1;
                            entity.Failure2           = string.IsNullOrEmpty(item.Desc_ID_Falla2) ? "" : item.Desc_ID_Falla2;
                            entity.Failure3           = string.IsNullOrEmpty(item.Desc_ID_Falla3) ? "" : item.Desc_ID_Falla3;
                            entity.FailureID1         = string.IsNullOrEmpty(item.ID_Falla1) ? "" : item.ID_Falla1;
                            entity.FailureID2         = string.IsNullOrEmpty(item.ID_Falla2) ? "" : item.ID_Falla2;
                            entity.FailureID3         = string.IsNullOrEmpty(item.ID_Falla3) ? "" : item.ID_Falla3;
                            entity.FK_ClientID        = dataODS.FK_ClientID;
                            entity.FK_InstalledBaseID = dataODS.FK_InstalledBaseID;
                            entity.FK_OrderID         = dataODS.PK_OrderID;
                            entity.Guaranty           = string.IsNullOrEmpty(item.Tipo_Serv) ? "" : item.Tipo_Serv;
                            entity.ItemStatus         = string.IsNullOrEmpty(item.Estatus_Visita) ? "" : item.Estatus_Visita;
                            entity.ModifyDate         = DateTime.UtcNow;
                            entity.OrderID            = string.IsNullOrEmpty(item.ID_Oper) ? "" : item.ID_Oper;
                            entity.OrderStatus        = string.IsNullOrEmpty(item.Estatus_Oper) ? "" : item.Estatus_Oper;
                            entity.PK_HistoryID       = 0;
                            entity.ShopDate           = new DateTime(1980, 1, 1);
                            entity.Status             = true;
                            FacadeHistory.Insert(entity);
                        }
                    }
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                    Console.WriteLine(ex.StackTrace);
                }

                j++;
            }

            //Inventory();
            //RestImage();

            //SendEmial();

            //foreach (TimeZoneInfo z in TimeZoneInfo.GetSystemTimeZones())
            //    Console.WriteLine(z.Id);

            //Console.WriteLine(FacadeGoogle.GetLocalDateTime(19.3850, -99.1650, DateTime.UtcNow));

            //string CLIENT_ID = "6538892993478012";
            //string CLIENT_SECRET = "GGGzSZuzfdBDpua7g7wyZo9qiTrnTvcS";
            //MP mp = new MP(CLIENT_ID, CLIENT_SECRET);

            //Hashtable data = mp.getPaymentInfo("9406314591T0170101000525SFODS");

            // Sets the filters you want
            //Dictionary<String, String> filters = new Dictionary<String, String>();
            //filters.Add("site_id", "MLM"); // Argentina: MLA; Brasil: MLB

            // Search payment data according to filters
            //Hashtable searchResult = mp.searchPayment(filters);

            // Show payment information
            //foreach (Hashtable payment in searchResult.SelectToken("response.results"))
            //{
            //    Console.WriteLine(String.Format("{0}", payment["collection"]["id"]));
            //}
            Console.WriteLine("Finish");
            Console.ReadKey();
        }