Example #1
0
        public void PtPmGetPartUrlFullContentMax()
        {
            Pm Pm = new Pm(lat, lon, Pm.Color.or, Pm.Size.m, 100);

            string result = $"{Pm.Lon.ToString().Replace(',', '.')}" +
                            $",{Pm.Lat.ToString().Replace(',', '.')}," +
                            $"pmorm";

            Assert.AreEqual(result, Pm.GetPartUrl());
        }
Example #2
0
        public void PtPmGetPartUrlAb()
        {
            Pm Pm = new Pm(lat, lon, Pm.AB.b);

            string result = $"{Pm.Lon.ToString().Replace(',', '.')}" +
                            $",{Pm.Lat.ToString().Replace(',', '.')}," +
                            $"pmb";

            Assert.AreEqual(result, Pm.GetPartUrl());
        }
Example #3
0
        public void PtPmGetPartUrlFull()
        {
            Pm Pm = new Pm(lat, lon, Pm.Color.yw, Pm.Size.s, 5);

            string result = $"{Pm.Lon.ToString().Replace(',', '.')}" +
                            $",{Pm.Lat.ToString().Replace(',', '.')}," +
                            $"pmyws5";

            Assert.AreEqual(result, Pm.GetPartUrl());
        }
Example #4
0
        protected override bool ExecuteParent(ArraySegment <string> arguments, ICommandSender sender, out string response)
        {
            EventHandlers.LogCommandUsed((CommandSender)sender, EventHandlers.FormatArguments(arguments, 0));
            StringBuilder ListBuilder = new StringBuilder();

            ListBuilder.Append("Here are the following enums you can use in commands:\n\nBreakType: ");
            foreach (BreakType Bt in Enum.GetValues(typeof(BreakType)))
            {
                ListBuilder.Append(Bt.ToString());
                ListBuilder.Append(" ");
            }
            ListBuilder.AppendLine();
            ListBuilder.Append("MoveType: ");
            foreach (MoveType Mt in Enum.GetValues(typeof(MoveType)))
            {
                ListBuilder.Append(Mt.ToString());
                ListBuilder.Append(" ");
            }
            ListBuilder.AppendLine();
            ListBuilder.Append("GrenadeType: ");
            foreach (GrenadeType Gt in Enum.GetValues(typeof(GrenadeType)))
            {
                ListBuilder.Append(Gt.ToString());
                ListBuilder.Append(" ");
            }
            ListBuilder.AppendLine();
            ListBuilder.Append("VectorAxis: ");
            foreach (VectorAxis Va in Enum.GetValues(typeof(VectorAxis)))
            {
                ListBuilder.Append(Va.ToString());
                ListBuilder.Append(" ");
            }
            ListBuilder.AppendLine();
            ListBuilder.Append("PositionModifier: ");
            foreach (PositionModifier Pm in Enum.GetValues(typeof(PositionModifier)))
            {
                ListBuilder.Append(Pm.ToString());
                ListBuilder.Append(" ");
            }
            string message = ListBuilder.ToString();

            ListBuilder.Clear();
            response = message;
            return(true);
        }
Example #5
0
 public void SetTaskStatusActive(int userId, int taskId)
 {
     Pm.SetUserTaskAsActive(userId, taskId);
 }
Example #6
0
 public int GetLastTaskId()
 {
     return(Pm.GetLastTaskId());
 }
 private void Pm_Click(object sender, EventArgs e)
 {
     Pm form2 = new Pm();
     form2.Show();
 }
Example #8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        var toUser = Request["toUser"];
        var fromUser = Request["fromUser"];
        var fromId = Request["fromId"];
        var noiDung = Request["txt"];
        var Id = Request["Id"];
        var logged = Security.IsAuthenticated();
        var pmSize = 10;
        switch (subAct)
        {
            case "add":
                #region add
                    if(!string.IsNullOrEmpty(noiDung))
                    {
                        if (toUser == Security.Username)
                            rendertext("Cannot send to yourself");
                        var item = new Pm
                                       {
                                           NoiDung = noiDung,
                                           NguoiGui = Security.Username,
                                           NguoiNhan = toUser,
                                           NgayTao = DateTime.Now,
                                           Doc = false
                                       };

                        var pmRoom = PmRoomDal.SelectByU1U2(Security.Username, toUser);
                        if (pmRoom.Id == 0)
                            pmRoom = PmRoomDal.Insert(new PmRoom()
                                                          {
                                                              NgayTao = DateTime.Now
                                                              ,
                                                              NgayCapNhat = DateTime.Now
                                                              ,
                                                              NguoiGui = Security.Username
                                                              ,
                                                              NguoiNhan = toUser
                                                              ,
                                                              Total = 0
                                                              ,
                                                              RowId = Guid.NewGuid()
                                                          });
                        item.PMR_ID = pmRoom.Id;
                        item.RowId = Guid.NewGuid();
                        item = PmDal.Insert(item);
                    }
                    break;
                #endregion
            case "remove":
                #region remove
                    if(!string.IsNullOrEmpty(Id))
                    {
                        var item = PmDal.SelectById(Convert.ToInt64(Id));
                        if (item.NguoiGui == Security.Username)
                            item.NguoiGuiXoa = true;
                        if (item.NguoiNhan == Security.Username)
                            item.NguoiNhanXoa = true;
                        PmDal.Update(item);
                    }
                    break;
                #endregion
            case "getPmBox":
                    #region get pm box
                    if (!string.IsNullOrEmpty(Id))
                    {
                        var item = PmRoomDal.SelectById(Convert.ToInt32(Id));
                        var list = PmDal.SelectByPmRoomId(Id, pmSize, fromId, Security.Username);
                        var mList = (from p in list
                                     select p).OrderBy(p => p.Id).ToList();
                        PmBox.List = mList;
                        PmBox.ToUser = item.NguoiGui == Security.Username ? item.NguoiNhan : item.NguoiGui;
                        PmBox.Id = Id;
                        PmBox.Visible = true;

                    }
                    break;
                    #endregion
            case "getPmList-More":
                    #region get pm more
                    if (!string.IsNullOrEmpty(Id) && !string.IsNullOrEmpty(fromId))
                    {
                        var list = PmDal.SelectByPmRoomId(Id, pmSize, fromId, Security.Username);
                        var mList = (from p in list
                                     select p).OrderBy(p => p.Id).ToList();
                        PmList.FromId = fromId;
                        PmList.RoomId = Id;
                        PmList.List = mList;
                        PmList.Visible = true;

                    }
                    break;
                    #endregion
            case "getPmList-Latest":
                    #region get pm box Latest
                    if (!string.IsNullOrEmpty(Id))
                    {
                        var list = PmDal.SelectLatestByPmRoomId(Id, 30, fromId, Security.Username);
                        var mList = (from p in list
                                     select p).OrderBy(p => p.Id).ToList();
                        PmList.RoomId = Id;
                        PmList.List = mList;
                        PmList.FromId = fromId;
                        PmList.Visible = true;

                    }
                    break;
                    #endregion
        }
    }
Example #9
0
        static void Main(string[] args)
        {
            L    l    = new L(true, false, false, true);
            LL   ll   = new LL(56.00848, 92.85302);
            int  z    = 15;
            Bbox bbox = new Bbox(56.01000, 92.85, 56.00580, 92.85778);
            Spn  spn  = new Spn(0.005, 0.005);
            Size size = new Size(450, 450);
            Lang lang = new Lang(Lang.Lang_reg.en_US);

            //Создание карты с слоем пробок
            StaticAPI map1 = new StaticAPI(l, ll, z, size, lang);

            Console.Write("Создание карты с слоем пробок.\n");
            Console.Write(map1.GetPictureURL() + "\n\n");

            //Создание карты с различными метками
            Pm              pm1      = new Pm(56.00922, 92.84895);
            Pm              pm2      = new Pm(56.00956, 92.85569, Pm.Color.do_, Pm.Size.l, 2);
            Pm              pm3      = new Pm(56.00891, 92.85581, Pm.Color.nt, Pm.Size.s, 3);
            Pm2             pm4      = new Pm2(56.00895, 92.85679);
            Pm2             pm5      = new Pm2(56.00702, 92.85713, Pm2.Color.gr, Pm2.Size.l, 5);
            Vk              pm6      = new Vk(56.00690, 92.85552, Vk.Color.bk);
            Vector          pm7      = new Vector(56.00613, 92.85574, Vector.Mark.comma);
            Vector          pm8      = new Vector(56.00574, 92.85283, Vector.Mark.ya_ru);
            Vector          pm9      = new Vector(56.00672, 92.85258, Vector.Mark.home);
            Flag            pm10     = new Flag(56.00661, 92.84937);
            List <MarkBase> listMark = new List <MarkBase>()
            {
                pm1, pm2, pm3, pm4, pm5, pm6, pm7, pm8, pm9, pm10
            };
            Pt        pt   = new Pt(listMark);
            StaticAPI map2 = new StaticAPI(new L(), bbox, pt: pt);

            Console.Write("Создание карты с различными метками.\n");
            Console.Write(map2.GetPictureURL() + "\n\n");

            //Создание спутниковой карты с полилиниями разного цвета
            Polyline polyline1 = new Polyline("0000FF99", 6, new List <Point>()
            {
                new Point(56.00976, 92.85251),
                new Point(56.00519, 92.85328),
                new Point(56.00518, 92.85359),
                new Point(56.00978, 92.85290)
            });
            Polyline polyline2 = new Polyline("FF0000FF", 10, new List <Point>()
            {
                new Point(56.00673, 92.84922),
                new Point(56.00719, 92.85721)
            });
            List <Polyline> listPol = new List <Polyline>()
            {
                polyline1, polyline2
            };
            Pl        pl   = new Pl(listPol);
            StaticAPI map3 = new StaticAPI(
                new L(false, true, true, false),
                ll,
                spn,
                new Size(450, 300),
                scale: 4,
                pl: pl);

            Console.Write("Создание спутниковой карты с полилиниями разного цвета.\n");
            Console.Write(map3.GetPictureURL() + "\n\n");

            //Создание карты с двумя пересекающимися полигонами
            List <Point> listPolygonPoint = new List <Point>()
            {
                new Point(56.00922, 92.84895),
                new Point(56.00956, 92.85569),
                new Point(56.00891, 92.85581),
                new Point(56.00895, 92.85679),
                new Point(56.00702, 92.85713),
                new Point(56.00690, 92.85552),
                new Point(56.00613, 92.85574),
                new Point(56.00574, 92.85283),
                new Point(56.00672, 92.85258),
                new Point(56.00661, 92.84937)
            };
            List <Point> listPolygonPoint2 = new List <Point>()
            {
                new Point(56.00827, 92.85097),
                new Point(56.00819, 92.85516),
                new Point(56.00693, 92.85367),
                new Point(56.00758, 92.85076)
            };
            Polyline     polygons          = new Polygon("F473fFAF", "ec473fF2", 8, listPolygonPoint, listPolygonPoint2);
            List <Point> listPolygonPoint3 = new List <Point>()
            {
                new Point(56.00976, 92.85251),
                new Point(56.00978, 92.85290),
                new Point(56.00518, 92.85359),
                new Point(56.00519, 92.85328)
            };
            Polyline        polygons2   = new Polygon(listPolygonPoint3);
            List <Polyline> listPolygon = new List <Polyline>()
            {
                polygons, polygons2
            };
            Pl        pl2  = new Pl(listPolygon);
            StaticAPI map4 = new StaticAPI(new L(), bbox, pl: pl2);

            Console.Write("Создание карты с двумя пересекающимися полигонами.\n");
            Console.Write(map4.GetPictureURL() + "\n\n");

            //Создание карты со всеми ранее созданными объектами
            List <Polyline> listPolygonPoint4 = new List <Polyline>()
            {
                polyline1, polyline2, polygons, polygons2
            };
            Pl        pl3  = new Pl(listPolygonPoint4);
            StaticAPI map5 = new StaticAPI(
                new L(true, false, true, true),
                bbox,
                new Size(450, 650),
                new Lang(Lang.Lang_reg.ru_RU),
                1.5,
                pt,
                pl3);

            Console.Write("Создание карты со всеми ранее созданными объектами.\n");
            Console.Write(map5.GetPictureURL() + "\n\n");

            Console.ReadLine();
        }
Example #10
0
 public int GetSampleEntriesAmout(bool isAdmin = false)
 {
     return(Pm.GetSampleEntriesAmount(isAdmin));
 }