Beispiel #1
0
        public void ListaDetallesOrden()
        {
            var id = Request.Params["ORDERID"];

            using (var connection = new FesaDataSourceDataContext())
            {
                var customer = connection.GET_ASSIGNMENTDETAILS_SP(id).ToList();
                var contacto = connection.GET_CONTACTDETAILS_SP(id).ToList();
                var user     = connection.GET_PERSONNELDETAILS_SP(id).ToList();


                foreach (var c in customer)
                {
                    Code.Text            = c.CODE;
                    Empresa.Text         = c.NAME;
                    Description.Text     = c.DESCRIPTION;
                    FechSolicitud.Text   = c.REQUESTDATE.Value.ToString("dd/MM/yyyy");
                    FechEstimada.Text    = c.ESTIMATEDSTARTDATE.Value.ToString("dd/MM/yyyy");
                    FechFinEstimada.Text = c.ESTIMATEDENDDATE.Value.ToString("dd/MM/yyyy");
                    District.Text        = c.DISTRICT;
                    Department.Text      = c.DEPARTMENT;
                    Province.Text        = c.PROVINCE;
                    Serial.Text          = c.SERIALNUMBER;
                    Brand.Text           = c.BRAND;
                    Model.Text           = c.MODEL;
                    LifeHours.Text       = Convert.ToString(c.LIFEHOURS);
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            System.Web.HttpCookie authCookie = HttpContext.Current.Request.Cookies[FormsAuthentication.FormsCookieName];
            if (authCookie == null)
            {
                return;
            }

            var encTicket = authCookie.Value;
            var ticket    = FormsAuthentication.Decrypt(encTicket);

            if (ticket != null)
            {
                _userId = ticket.UserData;
            }


            if (Page.IsPostBack)
            {
                return;
            }
            ListarOrdenPaginadas();

            var fesaDataSource = new FesaDataSourceDataContext();

            OfficeList.DataSource = fesaDataSource.GET_ALL_OFFICE();
            OfficeList.DataBind();
            CostCenterList.DataSource = fesaDataSource.GET_ALL_COSTCENTER();
            CostCenterList.DataBind();
        }
Beispiel #3
0
        public static IList <dynamic> GetItems(int office, int costCenter, DateTime fechaInicio, DateTime fechaFin)
        {
            var            fesaDataSource = new FesaDataSourceDataContext();
            var            spResult       = fesaDataSource.GET_ALL_ACTIVITIES_SP(office, costCenter, fechaInicio, fechaFin).ToList();
            List <dynamic> activities     = new List <dynamic>();

            foreach (var item in spResult)
            {
                activities.Add((dynamic)item);
            }
            return(activities);
        }
Beispiel #4
0
        public void CheckedDocument()
        {
            using (var connection = new FesaDataSourceDataContext()) {
                var connec = connection.GET_DOCUMENT_BY_NAME_SP(ASSIGNMENTID).ToList();

                foreach (var u in connec)
                {
                    string Name = u.NAME;
                    for (int i = 0; i < 7; i++)
                    {
                        switch (Name)
                        {
                        case "INFORME TÉCNICO":

                            cbx_informe.Checked = true;
                            break;

                        case "DETALLE DE GASTO":
                            cbx_detalleG.Enabled = false;
                            cbx_detalleG.Checked = true;
                            break;

                        case "ACTA DE CONFORMIDAD":

                            cbx_actaC.Checked = true;
                            break;

                        case "SIMS":

                            cbx_sims.Checked = true;
                            break;

                        case "DOCUMENTO DE SEGURIDAD":

                            cbx_documentS.Checked = true;
                            break;

                        case "GUÍA DE REPUESTOS FIRMADA POR CLIENTE":

                            cbx_guia.Checked = true;
                            break;

                        case "CHECKING DE CAMIONETA":

                            cbx_checCa.Checked = true;
                            break;
                        }
                    }
                }
            }
        }
Beispiel #5
0
        protected void GVACTIVITY_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            GridView tg;
            GridView tg1;

            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                tg  = e.Row.FindControl("GVLO") as GridView;
                tg1 = e.Row.FindControl("GVLOINI") as GridView;
                List <Actividad> list = new List <Actividad>();
                using (var connection = new FesaDataSourceDataContext()) {
                    var row = e.Row.DataItem;
                    System.Reflection.PropertyInfo pi = row.GetType().GetProperty("IDACTIVITY");
                    String activityId = (String)(pi.GetValue(row, null));
                    if (row != null)
                    {
                        var personnel = connection.GET_ACTIVITY_BY_PERSONNELID_ACTIVITYSTATE_END_SP(activityId).ToList();

                        foreach (var item in personnel)
                        {
                            //ANTONIO
                            //Agrego la validación de ubicacion
                            var activity = new Actividad();
                            activity.UBICATIONINI = item.UBICATIONINI?.ToString();
                            activity.UBICATIONEND = item.UBICATIONEND?.ToString();
                            if (string.IsNullOrEmpty(activity.UBICATIONINI) || string.IsNullOrWhiteSpace(activity.UBICATIONINI))
                            {
                                activity.UBICATIONINI = item.UBICATIONEND?.ToString();
                            }
                            list.Add(activity);
                            break;
                        }
                        tg.DataSource = list.ToList();
                        tg.DataBind();

                        tg1.DataSource = list.ToList();
                        tg1.DataBind();

                        if (tg.HeaderRow != null)
                        {
                            tg.HeaderRow.Visible = false;
                        }
                        if (tg1.HeaderRow != null)
                        {
                            tg1.HeaderRow.Visible = false;
                        }
                    }
                }
            }
        }
 public void ListarOrdenPaginadas(int currentPage = 1)
 {
     using (var connection = new FesaDataSourceDataContext()) {
         GVOrder.DataSource = null;
         GVOrder.DataBind();
         int pageSize      = 10;
         int?totalRowCount = 0;
         //ANTONIO
         List <ORDERTEMP> orders = connection.SP_GET_ALL_ORDER_PAGINATE_P(currentPage, pageSize, ref totalRowCount).ToList();
         //List<OrderNew> Orders = connection.SP_GET_ORDER_PAGINATE(TxtBuscar.Text,CostCenterList.SelectedIndex,OfficeList.SelectedIndex, currentPage, pageSize, ref _TotalRowCount).ToList();
         totalRowCount      = Convert.ToInt32(totalRowCount.Value);
         GVOrder.DataSource = orders;
         GVOrder.DataBind();
         //GeneratePager(totalRowCount, pageSize, currentPage);
         this.PopulatePager(totalRowCount, currentPage);
     }
 }
Beispiel #7
0
        public void ListaContacto()
        {
            using (var connection = new FesaDataSourceDataContext())
            {
                var             id     = Request.Params["ORDERID"];
                List <Contacto> list   = new List <Contacto>();
                var             connec = connection.GET_CONTACTDETAILS_SP(id).ToList();

                foreach (var u in connec)
                {
                    list.Add(new Contacto
                    {
                        NameContact  = u.NAME,
                        EmailContact = u.EMAIL,
                        PhoneContact = u.PHONE
                    });
                }
                GVContact.DataSource = list.ToList();
                GVContact.DataBind();
            }
        }
Beispiel #8
0
        public void ListarEquipo()
        {
            using (var connection = new FesaDataSourceDataContext())
            {
                var           id     = Request.Params["ORDERID"];
                List <Equipo> list   = new List <Equipo>();
                var           connec = connection.GET_PERSONNELDETAILS_SP(id).ToList();

                foreach (var u in connec)
                {
                    list.Add(new Equipo
                    {
                        NamePersonnel  = u.NAME,
                        EmailPersonnel = u.EMAIL,
                        PhonePersonnel = u.PHONE
                    });
                }
                GVDetails.DataSource = list.ToList();
                GVDetails.DataBind();
            }
        }
Beispiel #9
0
        public void ListarActividad(string ASSIGNMENTID, string PERSONNELID)
        {
            using (var connection = new FesaDataSourceDataContext()) {
                var customer = connection.GET_ACTIVITY_BY_PERSONNELID_SP(ASSIGNMENTID, PERSONNELID).ToList();
                foreach (var s in customer)
                {
                    var x        = s.ACTIVITYID;
                    int?userType = s.ISLEAD;

                    string ISLEADDescription = string.Empty;
                    if (userType != null)
                    {
                        switch (userType)
                        {
                        case (int)ISLEAD.Technician:
                            ISLEADDescription = "(Técnico)";
                            break;

                        case (int)ISLEAD.Leader:
                            ISLEADDescription = "(Lider)";
                            break;

                        case (int)ISLEAD.Supervisor:
                            ISLEADDescription = "(Supervisor)";
                            break;
                        }
                        Label4.Text = s.CODE;
                        Label5.Text = s.NAMECLIENT;
                        Label6.Text = s.NAMEPERSONNEL;
                        Label7.Text = ISLEADDescription;
                    }
                }
                GVACTIVITY.DataSource = customer;
                GVACTIVITY.DataBind();
            }
        }
Beispiel #10
0
        ///*FILTRADO*/
        //public void GeneratePager(int? totalRowCount, int pageSize, int currentPage)
        //{


        //    int totalPageCount = (int)Math.Ceiling((decimal)totalRowCount / pageSize);
        //    int totalLinkInPage = (int)Math.Ceiling((decimal)totalRowCount / 10) / 5;
        //    int startPageLink = Math.Max(currentPage - (int)Math.Floor((decimal)totalLinkInPage / 2), 1);
        //    int lastPageLink = Math.Min(startPageLink + totalLinkInPage - 1, totalPageCount);

        //    if ((startPageLink + totalLinkInPage - 1) > totalPageCount)
        //    {
        //        lastPageLink = Math.Min(currentPage + (int)Math.Floor((decimal)totalLinkInPage / 2), totalPageCount);
        //        startPageLink = Math.Max(lastPageLink - totalLinkInPage + 1, 1);
        //    }

        //    List<ListItem> pageLinkContainer = new List<ListItem>();

        //    if (startPageLink != 1)
        //        pageLinkContainer.Add(new ListItem("First", "1", currentPage != 1));
        //    for (int i = startPageLink; i <= lastPageLink; i++)
        //    {
        //        pageLinkContainer.Add(new ListItem(i.ToString(), i.ToString(), currentPage != i));
        //    }
        //    if (lastPageLink != totalPageCount)
        //        pageLinkContainer.Add(new ListItem("Last", totalPageCount.ToString(), currentPage != totalPageCount));

        //    dlPager.DataSource = pageLinkContainer;
        //    dlPager.DataBind();

        //}

        //protected void dlPager_ItemCommand(object source, DataListCommandEventArgs e)
        //{
        //    if (e.CommandName.Equals("PageNo"))
        //    {
        //        ListarOrdenPaginadas(Convert.ToInt32(e.CommandArgument));
        //    }
        //}
        /*FIN FILTRADO*/

        protected void GVOrder_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            GridView tg;

            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                tg = e.Row.FindControl("TecniGV") as GridView;
                List <Tecnico> list = new List <Tecnico>();
                using (var connection = new FesaDataSourceDataContext()) {
                    var row = e.Row.DataItem;
                    System.Reflection.PropertyInfo pi = row.GetType().GetProperty("ASSIGNMENTID");
                    String assignmentId = (String)(pi.GetValue(row, null));


                    if (row != null)
                    {
                        var personnel = connection.GET_PERSONNEL_BY_ASSIGNMENT_SP(assignmentId).ToList();

                        foreach (var item in personnel)
                        {
                            int?userType   = item.USERTYPE;
                            int?userStatus = item.USERSTATUS;

                            if (userType != null && userStatus != null)
                            {
                                string userTypeDescription;
                                switch (userType)
                                {
                                case (int)UserType.Supervisor:
                                    userTypeDescription = "Supervisor";
                                    break;

                                case (int)UserType.Technician:
                                    userTypeDescription = "Técnico";
                                    break;

                                default:
                                    userTypeDescription = "Error";
                                    break;
                                }
                                string userStatusDescription = "";

                                if (userType == 1)
                                {
                                }
                                else
                                {
                                    //ASSIGMENT X USER (TABLA PERSONNEL)
                                    //switch (userStatus) {
                                    //    case (int)Models.AssignmentStatus.Hold:
                                    //        userStatusDescription = "Asignado";
                                    //        break;
                                    //    case (int)Models.AssignmentStatus.Active:
                                    //        userStatusDescription = "En Proceso";
                                    //        break;
                                    //    case (int)Models.AssignmentStatus.Complete:
                                    //        userStatusDescription = "Finalizado";
                                    //        break;
                                    //    default:
                                    //        userStatusDescription = "Error";
                                    //        break;
                                    //}

                                    switch (userStatus)
                                    {
                                    case (int)UserStatus.Assigned:
                                        userStatusDescription = "Asignado";
                                        break;

                                    case (int)UserStatus.Available:
                                        userStatusDescription = "Disponible";
                                        break;

                                    case (int)UserStatus.OnWork:
                                        userStatusDescription = "En proceso";
                                        break;

                                    case 3:
                                        userStatusDescription = "Completado";
                                        break;

                                    default:
                                        userStatusDescription = "Error";
                                        break;
                                    }
                                }
                                list.Add(new Tecnico {
                                    Name                  = item.NAMEPERSONNEL,
                                    Usertype              = Convert.ToInt32(item.USERTYPE),
                                    Personnelid           = item.PERSONNELID,
                                    Usertypedescription   = userTypeDescription,
                                    Userstatusdescription = userStatusDescription,
                                    Assignmentid          = assignmentId,
                                    DescriptionIcon       = userTypeDescription == "Técnico" ? ResolveUrl("~/Images/Tecnico.png") : ResolveUrl("~/Images/Supervisor.png")
                                });
                            }
                        }
                        if (tg != null)
                        {
                            tg.DataSource = list.ToList();
                            tg.DataBind();
                            if (tg.HeaderRow != null)
                            {
                                tg.HeaderRow.Visible = false;
                            }
                        }
                    }
                }
                tg = e.Row.FindControl("TecniStatus") as GridView;
                if (tg != null)
                {
                    tg.DataSource = list.ToList();
                    tg.DataBind();
                    if (tg.HeaderRow != null)
                    {
                        tg.HeaderRow.Visible = false;
                    }
                }
                list.Clear();
            }
        }