Пример #1
0
 /// <summary>
 /// Set Grid Data source
 /// </summary>
 /// <param name="addRow"></param>
 /// <param name="deleteRow"></param>e
 private void BindGrid()
 {
     if (pnlFileUpload.Visible)
     {
         GrdRouteCoordinates.DataSource = (DataTable)ViewState["EXCEL_DATA"];
         GrdRouteCoordinates.DataBind();
         GrdRouteCoordinates.Columns[GrdRouteCoordinates.Columns.Count - 1].Visible = false;
         GrdRouteCoordinates.Columns[GrdRouteCoordinates.Columns.Count - 2].Visible = false;
         lnkMap.Visible = false;
     }
     else
     {
         GrdRouteCoordinates.Columns[GrdRouteCoordinates.Columns.Count - 1].Visible = true;
         GrdRouteCoordinates.Columns[GrdRouteCoordinates.Columns.Count - 2].Visible = true;
         GrdRouteCoordinates.Columns[GrdRouteCoordinates.Columns.Count - 3].Visible = false;
         GrdRouteCoordinates.Columns[GrdRouteCoordinates.Columns.Count - 4].Visible = false;
         RouteCoordinatesBLL objRouteCoordinatesBLL = new RouteCoordinatesBLL();
         GrdRouteCoordinates.DataSource = objRouteCoordinatesBLL.GetRouteCoordinates(ViewState["ROUTE_ID"].ToString());
         GrdRouteCoordinates.DataBind();
         GrdRouteCoordinates.Visible = true;
         if (GrdRouteCoordinates.Rows.Count > 1)
         {
             lnkMap.Visible = true;
         }
         else
         {
             lnkMap.Visible = false;
         }
     }
 }
Пример #2
0
        /// <summary>
        /// To generate map
        /// </summary>
        /// <param name="routeID"></param>
        private void GenerateMap(int routeID)
        {
            RouteCoordinatesBLL  objRouteCoordinatesBLL = new RouteCoordinatesBLL();
            RouteCoordinatesList RouteCoordinates       = objRouteCoordinatesBLL.GetRouteCoordinates(routeID.ToString());

            System.Text.StringBuilder sb = new System.Text.StringBuilder();

            foreach (RouteCoordinatesBO objRouteCoord in RouteCoordinates)
            {
                sb.Append(string.Format("'{0},{1},{2}'", objRouteCoord.Latitude, objRouteCoord.Longitude, objRouteCoord.Routename));
                sb.Append(";");
            }

            if (sb.Length > 0)
            {
                sb.Remove(sb.Length - 1, 1);
            }
            //Response.Write(sb.ToString());
            ScriptManager.RegisterStartupScript(this, this.GetType(), "ShowMap", string.Format("initialize(\"{0}\")", sb.ToString()), true);

            /*
             * if (RouteCoordinates.Count > 0)
             * {
             *  hdnStartingCoordinate.Value = string.Format("{0},{1}", RouteCoordinates[0].Latitude, RouteCoordinates[0].Longitude);
             *  hdnEndingCoordinate.Value = string.Format("{0},{1}", RouteCoordinates[RouteCoordinates.Count - 1].Latitude, RouteCoordinates[RouteCoordinates.Count - 1].Longitude); ;
             *  ScriptManager.RegisterStartupScript(this, this.GetType(), "ShowMap", "calcRoute();", true);
             *  lblMessage.Visible = false;
             * }
             * else
             * {
             *  lblMessage.Visible=true;
             * }*/
        }
Пример #3
0
        /// <summary>
        /// to fetch the count of route co ordinates
        /// </summary>
        /// <param name="RouteId"></param>
        /// <returns></returns>
        private int RouteCordinates(string RouteId)
        {
            RouteCoordinatesBLL  objRouteCoordinatesBLL = new RouteCoordinatesBLL();
            RouteCoordinatesList lstRouteCoordinates    = objRouteCoordinatesBLL.GetRouteCoordinates(RouteId.ToString());

            return(lstRouteCoordinates.Count);
        }
Пример #4
0
        /// <summary>
        /// Set the Route coordinates to Map
        /// </summary>
        private void GenerateMap()
        {
            ProjectRouteBLL  objProjectRouteBLL = new ProjectRouteBLL();
            ProjectRouteBO   objProjectRoute    = new ProjectRouteBO();
            ProjectRouteList ProjectRouteList   = new ProjectRouteList();

            objProjectRoute.Project_Id = Convert.ToInt32(projectID);;
            bool checck = true;

            ProjectRouteList = objProjectRouteBLL.getFinalRouteApprovalDetial(objProjectRoute);
            for (int i = 0; i < ProjectRouteList.Count; i++)
            {
                if (ProjectRouteList[i].IsFinal == "TRUE")
                {
                    checck = false;
                    RouteCoordinatesBLL       objRouteCoordinatesBLL = new RouteCoordinatesBLL();
                    RouteCoordinatesList      RouteCoordinates       = objRouteCoordinatesBLL.GetRouteCoordinates(ProjectRouteList[i].Route_ID.ToString());
                    System.Text.StringBuilder sb = new System.Text.StringBuilder();

                    foreach (RouteCoordinatesBO objRouteCoord in RouteCoordinates)
                    {
                        sb.Append(string.Format("'{0},{1},{2}'", objRouteCoord.Latitude, objRouteCoord.Longitude, objRouteCoord.Routename));
                        sb.Append(";");
                    }

                    if (sb.Length > 0)
                    {
                        sb.Remove(sb.Length - 1, 1);
                    }
                    //Response.Write(sb.ToString());

                    System.Text.StringBuilder sb1 = new System.Text.StringBuilder();
                    sb1.Append(string.Format("'{0},{1},{2}'", "0.469104", "33.164163", "E"));
                    sb1.Append(";");
                    sb1.Append(string.Format("'{0},{1},{2}'", "0.469145", "33.164285", "B"));
                    sb1.Append(";");
                    sb1.Append(string.Format("'{0},{1},{2}'", "0.468865", "33.164583", "C"));
                    sb1.Append(";");
                    sb1.Append(string.Format("'{0},{1},{2}'", "0.468782", "33.164507", "D"));
                    sb1.Append(";");
                    sb1.Append(string.Format("'{0},{1},{2}'", "0.469104", "33.164163", "E"));
                    sb1.Append(";");

                    if (sb1.Length > 0)
                    {
                        sb1.Remove(sb1.Length - 1, 1);
                    }
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "ShowMap", string.Format("initialize(\"{0}\")", sb.ToString()), true);

                    //string paramView = string.Format("initialize('{0}','{1}');", sb.ToString(), sb1.ToString());
                    //ScriptManager.RegisterStartupScript(this, this.GetType(), "ShowMap", paramView, true);
                }
            }
            lblMessage.Visible = checck;
        }