示例#1
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;
        }
示例#2
0
        /// <summary>
        /// To fetch FinalRouteApprovalDetial
        /// </summary>
        /// <param name="ProjectId"></param>
        public void getFinalRouteApprovalDetial(int ProjectId)
        {
            ProjectRouteBLL  objProjectRouteBLL = new ProjectRouteBLL();
            ProjectRouteBO   objProjectRoute    = new ProjectRouteBO();
            ProjectRouteList ProjectRouteList   = new ProjectRouteList();

            objProjectRoute.Project_Id = ProjectId;

            ProjectRouteList = objProjectRouteBLL.getFinalRouteApprovalDetial(objProjectRoute);

            //ProjectRouteList = objProjectRouteBLL.getFinalRouteApprovalDetial(objProjectRoute);

            if ((ProjectRouteList.Count) > 0)
            {
                for (int i = 0; i < ProjectRouteList.Count; i++)
                {
                    if (ProjectRouteList[i].IsFinal == "TRUE")
                    {
                        if (ProjectRouteList[i].ApprovedstatusID == 1)
                        {
                            btn_Save.Visible        = false;
                            btn_Clear.Visible       = false;
                            btn_ImportExcel.Visible = false;
                            GrdRouteCoordinates.Columns[GrdRouteCoordinates.Columns.Count - 1].Visible = false;
                            GrdRouteCoordinates.Columns[GrdRouteCoordinates.Columns.Count - 2].Visible = false;
                        }
                    }
                    else
                    {
                        if (ProjectRouteList[i].ApprovedstatusID == 3)
                        {
                            btn_Save.Visible        = false;
                            btn_Clear.Visible       = false;
                            btn_ImportExcel.Visible = false;
                            GrdRouteCoordinates.Columns[GrdRouteCoordinates.Columns.Count - 1].Visible = false;
                            GrdRouteCoordinates.Columns[GrdRouteCoordinates.Columns.Count - 2].Visible = false;
                        }
                        if (ProjectRouteList[i].ApprovedstatusID == 2)
                        {
                            btn_Save.Visible        = true;
                            btn_Clear.Visible       = true;
                            btn_ImportExcel.Visible = true;
                            GrdRouteCoordinates.Columns[GrdRouteCoordinates.Columns.Count - 1].Visible = true;
                            GrdRouteCoordinates.Columns[GrdRouteCoordinates.Columns.Count - 2].Visible = true;
                        }
                    }
                }
            }
        }
示例#3
0
        /// <summary>
        /// To get final route approval detail
        /// </summary>
        /// <param name="ProjectId"></param>
        public void getFinalRouteApprovalDetial(int ProjectId)
        {
            ProjectRouteBLL  objProjectRouteBLL = new ProjectRouteBLL();
            ProjectRouteBO   objProjectRoute    = new ProjectRouteBO();
            ProjectRouteList ProjectRouteList   = new ProjectRouteList();

            objProjectRoute.Project_Id = ProjectId;

            ProjectRouteList = objProjectRouteBLL.getFinalRouteApprovalDetial(objProjectRoute);

            //ProjectRouteList = objProjectRouteBLL.getFinalRouteApprovalDetial(objProjectRoute);

            if ((ProjectRouteList.Count) > 0)
            {
                for (int i = 0; i < ProjectRouteList.Count; i++)
                {
                    if (ProjectRouteList[i].IsFinal == "TRUE")
                    {
                        txtFinalRoute.Enabled   = false;
                        txtComments.Enabled     = false;
                        txtapprovedby.Enabled   = false;
                        txtapprovedDate.Enabled = false;
                        GetApproavlComments();

                        if (ProjectRouteList[i].ApprovedstatusID == 1)
                        {
                            pnlApprovel.Visible  = true;
                            txtFinalRoute.Text   = ProjectRouteList[i].Route_Name.ToString();
                            txtComments.Text     = ProjectRouteList[i].ApproverComment.ToString();
                            txtapprovedby.Text   = ProjectRouteList[i].ApproverUserName.ToString();
                            txtapprovedDate.Text = ProjectRouteList[i].Approveddate.ToString();

                            btn_Save.Visible       = false;
                            btn_Clear.Visible      = false;
                            ApproverButton.Visible = false;
                            // lnkApprovalComments.Visible = false;

                            //StatusLabel.Visible = false;
                            //StatusLabel.Text = "";
                            ApprovalMessage1.SetMessage = ApprovalMessage.MessageValue.None;
                        }
                    }
                    else
                    {
                        if (ProjectRouteList[i].ApprovedstatusID == 3)
                        {
                            pnlApprovel.Visible = false;
                            //StatusLabel.Visible = true;
                            //StatusLabel.Text = "Route Approval is Pending";
                            ApprovalMessage1.SetMessage = ApprovalMessage.MessageValue.RouteApprovalSent;
                            btn_Save.Visible            = false;
                            btn_Clear.Visible           = false;
                            ApproverButton.Visible      = false;
                            ///lnkApprovalComments.Visible = true;
                        }
                        if (ProjectRouteList[i].ApprovedstatusID == 2)
                        {
                            pnlApprovel.Visible = false;

                            //StatusLabel.Visible = true;

                            //StatusLabel.Text = "Route Declined";
                            ApprovalMessage1.SetMessage = ApprovalMessage.MessageValue.RouteApprovalDeclined;

                            btn_Save.Visible       = true;
                            btn_Clear.Visible      = true;
                            ApproverButton.Visible = false;
                            //lnkApprovalComments.Visible = true;
                        }
                    }
                }
            }
            else
            {
                pnlApprovel.Visible = false;
            }
        }