Beispiel #1
0
        public async Task RetriveShopppingCartTest()
        {
            //Arrange
            var sc = new ShoppingCart()
            {
                Id = "1"
            };

            sc.Items = new List <ShoppingCartMobilePhone>();
            var mobilePhone = new MobilePhone()
            {
                Id = 1
            };
            var item = new ShoppingCartMobilePhone()
            {
                MobilePhoneId  = 1,
                MobilePhoneRef = mobilePhone
            };

            sc.Items.Add(item);
            var repoMock = new Mock <IShoppingCartRepository>();

            repoMock.Setup(sc => sc.GetShoppingCart()).ReturnsAsync(sc);
            var service = new ShoppingCartService(repoMock.Object);
            //Act
            var result = await service.RetriveShopppingCart();

            //Assert
            result.Should().NotBeNull();
            result.Should().BeOfType <ShoppingCartVM>();
            result.Items.Should().HaveCount(1);
        }
        public void FillEmailForm(PracticeRegistrationModel user)
        {
            SignInButton.Click();
            EmailAddressField.SendKeys(user.EmailAddressField);
            CreateAccountButton.Click();
            RadioButton.Click();
            FirstName.SendKeys(user.FirstName);
            LastName.SendKeys(user.LastName);
            Password.SendKeys(user.Password);

            SelectElement date = new SelectElement(Date);

            date.SelectByValue("1");
            SelectElement month = new SelectElement(Month);

            month.SelectByValue("2");
            SelectElement year = new SelectElement(Year);

            year.SelectByValue("2010");

            Address.SendKeys(user.Address);
            City.SendKeys(user.City);

            SelectElement state = new SelectElement(State);

            state.SelectByValue("2");

            ZipCode.SendKeys(user.ZipCode);
            MobilePhone.SendKeys(user.MobilePhone);
            RegisterButton.Click();
        }
Beispiel #3
0
    public static MobilePhone GetMobilePhoneFromUserAgent(string HTTP_USER_AGENT)
    {
        HTTP_USER_AGENT = HTTP_USER_AGENT.ToLower();
        MobilePhone MPhone = new MobilePhone();

        // loop through looking for the device Manufacturer
        for (int i = 0; i < MobilePhoneList.Count; i++)
        {
            if (HTTP_USER_AGENT.Contains(MobilePhoneList[i].Manufacturer.ToLower()))
            {
                MPhone.Manufacturer = MobilePhoneList[i].Manufacturer;
                break;
            }
        }

        // loop through looking for the device Model
        for (int i = 0; i < MobilePhoneList.Count; i++)
        {
            if (HTTP_USER_AGENT.Contains(MobilePhoneList[i].Model.ToLower()))
            {
                MPhone.Model = MobilePhoneList[i].Model;
                break;
            }
        }

        return MPhone;
    }
Beispiel #4
0
 private void AddOwnerBtn_Click(object sender, EventArgs e)
 {
     if (owner == null)
     {
         Tariff      Tariff = null;
         MobilePhone Mobile = null;
         bool        sex    = SexBox.Text == "Мужской" ? true : false;
         foreach (var tariff in Tariff.getList())
         {
             if (tariff.Name == TariffBox.Text)
             {
                 Tariff = tariff;
             }
         }
         foreach (var mobile in MobilePhone.getList())
         {
             if (mobile.producer.Name + " " + mobile.modelPhone.Name == PhoneBox.Text)
             {
                 Mobile = mobile;
             }
         }
         Objects.Owner.Add(Mobile, Tariff, SurnameBox.Text, MiddleNameBox.Text, FirstNameBox.Text, sex, url, PassportBox.Text, NumberPhoneBox.Text);
         Close();
     }
     else
     {
         owner.firstName  = FirstNameBox.Text;
         owner.middleName = MiddleNameBox.Text;
         owner.surname    = SurnameBox.Text;
         foreach (var mobile in MobilePhone.getList())
         {
             if (PhoneBox.SelectedItem.ToString() == mobile.producer.Name + " " + mobile.modelPhone.Name)
             {
                 owner.mobilePhone = mobile;
                 break;
             }
         }
         foreach (var tariff in Tariff.getList())
         {
             if (TariffBox.Text == tariff.Name)
             {
                 owner.tariff = tariff;
             }
         }
         List <Service> services = new List <Service>();
         foreach (var service in Service.getList())
         {
             if (useSerivce.Contains(service.Name))
             {
                 services.Add(service);
             }
         }
         owner.services       = services;
         owner.sex            = SexBox.SelectedIndex == 0;
         owner.passportNumber = PassportBox.Text;
         owner.mobileNumber   = NumberPhoneBox.Text;
         owner.photoUrl       = url;
         Close();
     }
 }
Beispiel #5
0
        public override int GetHashCode()
        {
            int hashCode = FirstName.GetHashCode() ^ MiddleName.GetHashCode() ^ LastName.GetHashCode() ^ Id.GetHashCode()
                           ^ MobilePhone.GetHashCode() ^ Email.GetHashCode();

            return(hashCode);
        }
Beispiel #6
0
    protected void SetModel(object sender, EventArgs e)
    {
        if (drpModel.Items[0].Text == "select")
        {
            drpModel.Items.RemoveAt(0);
        }

        IsDownload = true;

        // get the model
        SelectedMobilephone = MobilePhone.GetMobilePhoneByID(Int32.Parse(drpModel.SelectedValue));
        // determine the OS runtime
        //

        if (SelectedMobilephone.Runtime == RunTimeOS.Symbian)
        {
            MobileDownloadPage = "http://www.getn2f.com/2";

            DownloadList = @"<span class='downloadlink'>Download Live <a style='font-size:smaller' href='http://www.getn2f.com/3'>.Sisx </a><small>Live v1.0 (455k)</small></span><br />";
            QRImageURL   = "/images/qr2.gif";
        }
        else if (SelectedMobilephone.Runtime == RunTimeOS.J2ME)
        {
            MobileDownloadPage = "http://www.getn2f.com/1";

            DownloadList = @"<span class='downloadlink' style='color:#cccccc;background: url(images/link-arrow-grey.gif) left 3px no-repeat'>Download Live <small>Currently unsupported</small></span><br />";

            QRImageURL = "/images/qr1.gif";
        }

        DownloadList += @"<span class='downloadlink'>Download Ask <a style='font-size:smaller' href='http://www.getn2f.com/4'>.Jar </a> | <a style='font-size:smaller' href='http://www.getn2f.com/5'>.Jad </a><small>Ask v1.0 (245k)</small></span><br />
                             <span class='downloadlink'>Download Tag <a style='font-size:smaller' href='http://www.getn2f.com/6'>.Jar </a> | <a style='font-size:smaller' href='http://www.getn2f.com/7'>.Jad </a><small>Tag v1.0  (125k)</small></span><br />
                             <span class='downloadlink'>Download Snapup <a style='font-size:smaller' href='http://www.getn2f.com/8'>.Jar </a> | <a style='font-size:smaller' href='http://www.getn2f.com/9'>.Jad </a><small>Snapup v1.0  (100k)</small></span><br />";
    }
        public ChargeTask(MobilePhone phone, Action ShowBattery)
        {
            _phone                = phone;
            this.ShowBattery      = ShowBattery;
            _tokenCancelDischarge = new CancellationTokenSource();
            var token = _tokenCancelDischarge.Token;

            DischargingTask = Task.Run(
                async() => {
                // if not in unit test — discharging process is always active
                while (Endless < TestIterations)
                {
                    if (IsTestDischarge)
                    {
                        Endless++;
                    }
                    ShowBattery();
                    await Task.Delay(DischargeInterval, token);
                    lock (_phone.BatteryBase) {
                        _phone.Discharge();
                    }
                    if (token.IsCancellationRequested)
                    {
                        break;
                    }
                }
            }, token);
        }
Beispiel #8
0
        static void Main(string[] args)
        {
            Inventory inventory = new Inventory();

            InitalizeInventory(inventory);

            //Searches
            MobilePhone searchMobile = new MobilePhone
            {
                OperatingSystem = "ios",
                Manufacture     = "Apple",
                ModelName       = "iphone 5s",
            };


            List <MobilePhone> collection = inventory.Search(searchMobile);

            foreach (var item in collection)
            {
                Console.WriteLine(item.ModelName);
                Console.WriteLine(item.Price);
                Console.WriteLine(item.OperatingSystem);
            }

            Console.ReadLine();
        }
        static void Main(string[] args)
        {
            //Create 'Director'
            MobilePhoneManufacturer mobilePhoneManufacturer = new MobilePhoneManufacturer();

            //Build Normal Mobile Phone
            IPhoneBuilder normalPhoneBuilder = new NormalPhoneBuilder("Normal_001", "Nokia 1600");

            mobilePhoneManufacturer.BuildMobilePhone(normalPhoneBuilder);
            MobilePhone NormalMobilePhone = normalPhoneBuilder.GetPhone();

            //Display Details
            Console.WriteLine("----------------------Normal Mobile Phone Details-----------------");
            NormalMobilePhone.DisplayPhoneDetails();

            //Build Smart Phone
            Console.WriteLine("\n----------------------Smart Phone Details-----------------");
            IPhoneBuilder smartPhoneBuilder = new SmartPhoneBuilder("SmartPhone_001", "Nokia Asha");

            mobilePhoneManufacturer.BuildMobilePhone(smartPhoneBuilder);
            MobilePhone SmartPhone = smartPhoneBuilder.GetPhone();

            //Display Details
            SmartPhone.DisplayPhoneDetails();

            Console.Write("Press any key to exist...");

            Console.ReadKey();
        }
        private void btnAddTelephone_Click(object sender, EventArgs e)
        {
            if (!maskedTextBoxTelephone.MaskFull)
            {
                MessageBox.Show("Некорректный ввод"); return;
            }

            if (db.Users.Count() == 0)
            {
                MessageBox.Show("Добавьте пользователя."); return;
            }

            int         idUser      = int.Parse(dataGridView1.CurrentRow.Cells["id"].Value.ToString());
            MobilePhone mobilePhone = new MobilePhone()
            {
                UserId = idUser, MobilePhoneUser = maskedTextBoxTelephone.Text
            };

            db.MobilePhones.Add(mobilePhone);
            db.SaveChanges();

            IEnumerable <MobilePhone> mobilePhoneList = db.MobilePhones.Where(m => m.UserId == idUser);

            manager.DataGridViewPhoneAdd(dataGridView2, mobilePhoneList);

            maskedTextBoxTelephone.Clear();
        }
Beispiel #11
0
        public async Task <IActionResult> Edit(long id, [Bind("IMEI,Modelo")] MobilePhone mobilePhone)
        {
            if (id != mobilePhone.IMEI)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(mobilePhone);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!MobilePhoneExists(mobilePhone.IMEI))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(mobilePhone));
        }
        protected void linkBtnAddToCart_Click(object sender, EventArgs e)
        {
            int                 nProductBought = int.Parse(nPhoneBought.Value.ToString());
            int                 id             = int.Parse(Request.QueryString["id"]);
            MobilePhone         mobile         = db.MobilePhones.Where(n => n.MobileID == id).SingleOrDefault();
            List <ShoppingCart> lstCart;

            if (Session["ShoppingCart"] != null)
            {
                lstCart = (List <ShoppingCart>)Session["ShoppingCart"];
            }
            else
            {
                lstCart = new List <ShoppingCart>();
            }
            for (int i = 1; i <= nProductBought; i++)
            {
                ShoppingCart sp = new ShoppingCart();
                sp.ProductID     = mobile.MobileID;
                sp.ProductName   = mobile.MobileName;
                sp.Price         = mobile.Price;
                sp.timeInsurance = mobile.TimeInsurance + " months";
                lstCart.Add(sp);
            }
            Session["ShoppingCart"] = lstCart;
            Response.Redirect("../Product.aspx");
        }
        public void getInfoMobile(MobilePhone mobile)
        {
            getListImage(mobile);

            pricePhone.InnerHtml = "<span>" + String.Format("{0:0,0 vnđ}", mobile.Price) + "</span>";
            namePhone.InnerHtml  = mobile.MobileName;
            mobileOS.InnerHtml   = "<span>Operating System:</span> &nbsp; " + mobile.MobileOS;
            mobileSize.InnerHtml = "<span>Display Size:</span>&nbsp;" + mobile.Size.ToString() + " Inches";
            nPhoneLeft.InnerHtml = "<span>Remains:</span>&nbsp;" + mobile.Quantity.ToString();
            string html = "";

            html += "<ul><li><span class=\"specification-heading\">Operating System</span> <span>" + mobile.MobileOS + "</span><div class=\"clear\"></div></li>";
            html += "<ul><li><span class=\"specification-heading\">Display Size</span> <span>" + mobile.Size + " Inches</span><div class=\"clear\"></div></li>";
            html += "<ul><li><span class=\"specification-heading\">Camera </span> <span>" + mobile.MainCamera + "</span><div class=\"clear\"></div></li>";
            html += "<ul><li><span class=\"specification-heading\">Front Camera</span> <span>" + mobile.Camera + "</span><div class=\"clear\"></div></li>";
            html += "<ul><li><span class=\"specification-heading\">CPU</span> <span>" + mobile.CPU + "</span><div class=\"clear\"></div></li>";
            html += "<ul><li><span class=\"specification-heading\">RAM</span> <span>" + mobile.RAM + " GB</span><div class=\"clear\"></div></li>";
            html += "<ul><li><span class=\"specification-heading\">Resolution</span> <span>" + mobile.Resolution + "</span><div class=\"clear\"></div></li>";
            html += "<ul><li><span class=\"specification-heading\">Number of Seller</span> <span>" + mobile.CustomerBought + "</span><div class=\"clear\"></div></li>";
            html += "<ul><li><span class=\"specification-heading\">Warranty Period</span> <span>" + mobile.TimeInsurance + " Months </span><div class=\"clear\"></div></li>";
            //html += "<ul><li><span class=\"specification-heading\">Video</span>" + "<span><embed  width='115%' height='315' src='" + mobile.Video.Replace("watch?v=", "/v/") + "'></span><div class=\"clear\"></div></li>";
            html += "</ul>";

            productSpecification.InnerHtml = html;
            nPhoneBought.Attributes.Add("max", mobile.Quantity.ToString());
        }
Beispiel #14
0
    public static MobilePhone GetMobilePhoneFromUserAgent(string HTTP_USER_AGENT)
    {
        HTTP_USER_AGENT = HTTP_USER_AGENT.ToLower();
        MobilePhone MPhone = new MobilePhone();

        // loop through looking for the device Manufacturer
        for (int i = 0; i < MobilePhoneList.Count; i++)
        {
            if (HTTP_USER_AGENT.Contains(MobilePhoneList[i].Manufacturer.ToLower()))
            {
                MPhone.Manufacturer = MobilePhoneList[i].Manufacturer;
                break;
            }
        }

        // loop through looking for the device Model
        for (int i = 0; i < MobilePhoneList.Count; i++)
        {
            if (HTTP_USER_AGENT.Contains(MobilePhoneList[i].Model.ToLower()))
            {
                MPhone.Model = MobilePhoneList[i].Model;
                break;
            }
        }

        return(MPhone);
    }
Beispiel #15
0
    public override bool Run(MobilePhone phone)
    {
        var result         = phone.ReceiveAMessage(SenderPhoneNumber, Text);
        var expectedResult = (phone.OS == OperatingSystem.OS_A) && (phone.ConnectionState == ConnectionState.Online);

        return(result == expectedResult);
    }
Beispiel #16
0
        internal static IList <MobilePhone> GetPhoneList(string filename)
        {
            var list = new List <MobilePhone>();

            foreach (var line in File.ReadLines(filename))
            {
                var seg = line.Split('|');

                MobilePhone info = new MobilePhone();
                info.Phone = int.Parse(seg[0]);
                var province = seg[1];
                var city     = seg[2];

                if (province == city)
                {
                    info.Area = city;
                }
                else
                {
                    info.Area = province + city;
                }

                info.Isp      = seg[3];
                info.CityCode = seg[4];
                info.ZipCode  = seg[5];
                info.AdCode   = int.Parse(seg[6]);

                list.Add(info);
            }

            return(list);
        }
Beispiel #17
0
    public override bool Run(MobilePhone phone)
    {
        var result         = phone.ReceiveACall(CallerPhoneNumber);
        var expectedResult = (phone.PhoneState != PhoneState.Silent) && (phone.ConnectionState == ConnectionState.Online);

        return(result == expectedResult);
    }
Beispiel #18
0
        public void PrintWithFilter_UserFilterEnabled_OnlySelectedDate()
        {
            //arrange
            FilterValueDTO   filterValueDTO = new FilterValueDTO("Jacob", "MESSAGE", DateTime.Now, DateTime.Now.Add(new TimeSpan(1, 0, 0)));
            MessageStorage   smsStorage     = new MessageStorage();
            MobilePhone      mobile         = new MobilePhone(Model.Iphone8, output, smsStorage);
            MessageInisiator inisiator      = new ThreadMessageInisiator(mobile);

            fakeForm.FilterDict.Add(FilterCheckBox.User, false);
            fakeForm.FilterDict.Add(FilterCheckBox.Message, false);
            fakeForm.FilterDict.Add(FilterCheckBox.Date, true);

            //act
            mobile.ChangeFormat(OutputFormat.FormatToUpper);
            mobile.Messages.Add(new Message(jacob, "testMessage from Jacob", DateTime.Now));
            mobile.Messages.Add(new Message(thomas, "testMessage from Thomas", DateTime.Now.Add(new TimeSpan(3, 0, 0))));
            mobile.ViewMessages(fakeForm.FilterDict, filterValueDTO);

            //assert
            string outputFromMobile = output.WriteLineText;
            string jacobString      = "";
            string thomasString     = "";

            if (outputFromMobile.IndexOf("JACOB") > 0)
            {
                jacobString = outputFromMobile.Substring(outputFromMobile.IndexOf("JACOB"), 5);
            }

            if (outputFromMobile.IndexOf("THOMAS") > 0)
            {
                thomasString = outputFromMobile.Substring(outputFromMobile.IndexOf("THOMAS"), 6);
            }
            Assert.AreEqual(jacobString, "JACOB");
            Assert.AreEqual(thomasString, "");
        }
Beispiel #19
0
        private void SetupOutputPhone()
        {
            output = new ListViewOutput(CallListView);
            var smsStorage = new MessageStorage();

            phone = new MobilePhone(Model.Iphone10, output, smsStorage);
        }
        static void Main()
        {
            Console.WriteLine("Creating a new phone");
            MobilePhone yourPhone = new MobilePhone("tPhone", "Telerik", 250, "Pesho");
            Call firstCall = new Call(new DateTime(2015,03,12,21,15,59),"0887654321", 123);
            Call secondCall = new Call(new DateTime(2015, 03, 12, 22, 37, 01), "Mum", 1235);
            Call thirdCall = new Call(new DateTime(2015, 03, 13, 02, 49, 10), "Ex girlfriend", 30);
            
            yourPhone.AddCall(firstCall);
            yourPhone.AddCall(secondCall);
            yourPhone.AddCall(thirdCall);
           
            var result = yourPhone.SomeCalls;
            foreach (var call in result)
            {
                Console.WriteLine(call.PrintCalls());
            }

            double billToPay = yourPhone.CalculateInvoice(0.37, yourPhone.SomeCalls);
            Console.WriteLine();
            Console.WriteLine("Your invoice to pay is {0:C}",billToPay);
            var longestCall = yourPhone.SomeCalls.OrderBy(x => x.Duration).Last();
            yourPhone.RemoveCall(longestCall);
            billToPay = yourPhone.CalculateInvoice(0.37, yourPhone.SomeCalls);
            Console.WriteLine("Your invoice to pay after removing the call to your mother is {0:C}", billToPay);
            yourPhone.ClearHistory(yourPhone.SomeCalls);
            billToPay = yourPhone.CalculateInvoice(0.37, yourPhone.SomeCalls);
            Console.WriteLine("Your invoice after last payment is {0:C}", billToPay);

        }
        public async Task <IActionResult> Edit(string id, [Bind("IMEI,Model")] MobilePhone mobilePhone)
        {
            //if (id != mobilePhone.IMEI)
            //{
            //    return NotFound();
            //}

            if (ModelState.IsValid)
            {
                try
                {
                    var mp = await _context.MobilePhones.FindAsync(id);

                    _context.MobilePhones.Remove(mp);
                    _context.Add(mobilePhone);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!MobilePhoneExists(mobilePhone.IMEI))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index), new { iMEICheck = "On", modelCheck = "On" }));
            }
            return(View(mobilePhone));
        }
Beispiel #22
0
 public override int GetHashCode()
 {
     return(FirstName.GetHashCode() ^ MiddleName.GetHashCode()
            ^ LastName.GetHashCode() ^ Address.GetHashCode()
            ^ Email.GetHashCode() ^ MobilePhone.GetHashCode()
            ^ Ssn.GetHashCode());
 }
Beispiel #23
0
    protected void Page_Load(object sender, EventArgs e)
    {
        
        UserAgent = Request.ServerVariables["HTTP_USER_AGENT"];
        MyMobilePhone = MobilePhone.GetMobilePhoneFromUserAgent(UserAgent);

    }
Beispiel #24
0
        public void GetNumber_ReturnedNumberFromCard()
        {
            var pnone = new MobilePhone(fakeMobileCartCard.Object);

            var number = pnone.GetNumber();

            Assert.AreEqual(number, 3224168);
        }
Beispiel #25
0
    public static void Main()
    {
        Operater    r  = new Operater();
        MobilePhone SE = new MobilePhone(r);

        r.DolazniSignal(0, 38521100000);
        r.DolazniSignal(1, 38521200000);
    }
Beispiel #26
0
        public void Call_InvokedConnectToNetwork_OneTime()
        {
            var pnone = new MobilePhone(fakeMobileCartCard.Object);

            pnone.Call();

            fakeMobileCartCard.Verify(p => p.ConnectToNetwork(), Times.AtMostOnce);
        }
Beispiel #27
0
 public void FillForm(RegistationFormModel user)
 {
     FirstName.SetText(user.FirstName);
     LastName.SetText(user.LastName);
     Email.SetText(user.Email);
     Gender(user.Gender).Click();
     MobilePhone.SetText(user.MobilePhone);
 }
Beispiel #28
0
        static void Main(string[] args)
        {
            Phone       testPhone       = new Phone("Nguoi la oi", "display phone", 5686.2f);
            MobilePhone testMobilePhone = new MobilePhone();

            testPhone.display();
            testMobilePhone.display();
        }
 public MobileDataContext()
 {
     MyMobilePhone = new MobilePhone
     {
         Model = "S10",
         Brand = "Samsung",
         Color = "Black"
     };
 }
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            MobilePhone mobilePhone = await db.MobilePhones.FindAsync(id);

            db.MobilePhones.Remove(mobilePhone);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
 public static MobilePhoneDto AsDto(this MobilePhone mobilePhone) => new MobilePhoneDto()
 {
     Id           = mobilePhone.Id,
     Type         = mobilePhone.Type,
     Name         = mobilePhone.Name,
     SellPrice    = mobilePhone.OriginPrice * (decimal)mobilePhone.Discount,
     CreatedDate  = mobilePhone.CreatedDate,
     ModifiedDate = mobilePhone.ModifiedDate
 };
Beispiel #32
0
        public MobilePhone Create(MobilePhone mob)
        {
            var mobile = _repository.Create(mob);

            if (_repository.SaveChanges())
            {
                return(mobile);
            }
            throw new BadRequestException("Failed to create mobile phone!");
        }
Beispiel #33
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        public override bool Equals(object obj)
        {
            var o = obj as TraderInfo;

            if (o == null)
            {
                return(false);
            }
            return(UserKey.Equals(o.UserKey) && MobilePhone.Equals(o.MobilePhone));
        }
    protected void SetManu(object sender, EventArgs e)
    {
        MobilePhone SelectedMobilephone = new MobilePhone();

        drpModel.Enabled = true;

        List<MobilePhone> Filtered = SelectedMobilephone.FilterManufacturer(drpManu.SelectedValue);

        drpModel.Items.Clear();
        drpModel.Items.Add(new ListItem("select"));

        for (int i = 0; i < Filtered.Count; i++)
        {
            drpModel.Items.Add(new ListItem(Filtered[i].Model,Filtered[i].ID.ToString()));
        }

        if (drpManu.Items[0].Text == "select")
        {
            drpManu.Items.RemoveAt(0);
        }
    }
    protected void SetModel(object sender, EventArgs e)
    {
        if (drpModel.Items[0].Text == "select")
        {
            drpModel.Items.RemoveAt(0);
        }

        IsDownload = true;

        // get the model
        SelectedMobilephone = MobilePhone.GetMobilePhoneByID(Int32.Parse(drpModel.SelectedValue));
        // determine the OS runtime
        //

        if (SelectedMobilephone.Runtime==RunTimeOS.Symbian)
        {
            MobileDownloadPage = "http://www.getn2f.com/2";

            DownloadList = @"<span class='downloadlink'>Download Live <a style='font-size:smaller' href='http://www.getn2f.com/3'>.Sisx </a><small>Live v1.0 (455k)</small></span><br />";
            QRImageURL = "/images/qr2.gif";
        }
        else if (SelectedMobilephone.Runtime == RunTimeOS.J2ME)
        {
            MobileDownloadPage = "http://www.getn2f.com/1";

            DownloadList = @"<span class='downloadlink' style='color:#cccccc;background: url(images/link-arrow-grey.gif) left 3px no-repeat'>Download Live <small>Currently unsupported</small></span><br />";
            
            QRImageURL = "/images/qr1.gif";
        }

        DownloadList += @"<span class='downloadlink'>Download Ask <a style='font-size:smaller' href='http://www.getn2f.com/4'>.Jar </a> | <a style='font-size:smaller' href='http://www.getn2f.com/5'>.Jad </a><small>Ask v1.0 (245k)</small></span><br />
                             <span class='downloadlink'>Download Tag <a style='font-size:smaller' href='http://www.getn2f.com/6'>.Jar </a> | <a style='font-size:smaller' href='http://www.getn2f.com/7'>.Jad </a><small>Tag v1.0  (125k)</small></span><br />
                             <span class='downloadlink'>Download Snapup <a style='font-size:smaller' href='http://www.getn2f.com/8'>.Jar </a> | <a style='font-size:smaller' href='http://www.getn2f.com/9'>.Jad </a><small>Snapup v1.0  (100k)</small></span><br />";


    }
Beispiel #36
0
 static void Main()
 {
     MobilePhone gsm = new MobilePhone("htc", "HTC", 600m);
     System.Console.WriteLine(gsm.ToString());
 }
    protected void SetModel(object sender, EventArgs e)
    {
        if (drpModel.Items[0].Text == "select")
        {
            drpModel.Items.RemoveAt(0);
        }

        IsDownload = true;

        // get the model
        SelectedMobilephone = MobilePhone.GetMobilePhoneByID(Int32.Parse(drpModel.SelectedValue));
        // determine the OS runtime
        //


        string JavaDownloads = @"<span class='downloadlink'>Download Social<a style='font-size:smaller' href='http://www.getn2f.com/apps/J2MESOCIAL/Next2FriendsSocial.zip'> here </a><small>Social v1.0 (245k)</small></span>
                                <br/><a onclick='socialHelpPopup();return false;' style='cursor:pointer'>Important Instructions</a><br/><br/>";
	

        if (SelectedMobilephone.Runtime == RunTimeOS.Symbian)
        {
            SocialText = SetHelperText(InstructionsType.Symbian);

            MobileDownloadPage = "http://www.getn2f.com/4";

            DownloadList = @"<span class='downloadlink'>Download Live <a style='font-size:smaller' href='http://www.getn2f.com/5'>here </a><small>Live v1.0 (455k)</small></span><br />
                              ";
            DownloadList += JavaDownloads;
            QRImageURL = "/images/qrcode/4.gif";
        }
        else if (SelectedMobilephone.Runtime == RunTimeOS.J2ME)
        {
            SocialText = SetHelperText(InstructionsType.Symbian);

            MobileDownloadPage = "http://www.getn2f.com/1";

            DownloadList = @"<span class='downloadlink' style='color:#cccccc;background: url(images/link-arrow-grey.gif) left 3px no-repeat'>Download Live <small>Currently unsupported</small></span><br />";
            
            DownloadList += JavaDownloads;
            QRImageURL = "/images/qrcode/1.gif";
        }
        else if (SelectedMobilephone.Runtime == RunTimeOS.BlackJackII)
        {
            MobileDownloadPage = "http://www.getn2f.com/9";

            DownloadList = @"<span class='downloadlink'>Download Live <a style='font-size:smaller' href='http://www.getn2f.com/10'>here </a><small>Live v1.0 (2.3mb)</small></span><br />
                            <span class='downloadlink'>Download Social <a style='font-size:smaller' href='http://www.getn2f.com/11'>here </a><small>Social v1.0 (2.3mb)</small></span><br />";

            QRImageURL = "/images/qrcode/9.gif";
        }
        else if (SelectedMobilephone.Runtime == RunTimeOS.MotoQ)
        {
            MobileDownloadPage = "http://www.getn2f.com/6";

            DownloadList = @"<span class='downloadlink'>Download Live <a style='font-size:smaller' href='http://www.getn2f.com/7'>here </a><small>Live v1.0 (2.3mb)</small></span><br />
                            <span class='downloadlink'>Download Social <a style='font-size:smaller' href='http://www.getn2f.com/8'>here </a><small>Social v1.0 (2.3mb)</small></span><br />";

            QRImageURL = "/images/qrcode/6.gif";
        }
        else if (SelectedMobilephone.Runtime == RunTimeOS.BlackBerryCurve)
        {
            LiveText = SetHelperText(InstructionsType.BlackBerryLive);
            SocialText = SetHelperText(InstructionsType.BlackBerrySocial);

            MobileDownloadPage = "http://www.getn2f.com/12";

            DownloadList = @"<span class='downloadlink'>Download Live <a style='font-size:smaller' href='http://www.getn2f.com/apps/BBCurveLIVE/N2FLive.zip'>here </a><small>Supports OS:<br/>4.5 and above</small></span><br />
                             <p style='text-align:default;'><a onclick='liveHelpPopup();return false;' style='cursor:pointer'>Important Instructions</a></p>
                            <span class='downloadlink'>Download Social <a style='font-size:smaller' href='http://www.getn2f.com/apps/BBCurveSOCIAL/Next2FriendsSocial.zip'>here </a><small>Supports OS:<br/>4.5 and above</small></span><br />
                            <p style='text-align:default;'><a onclick='socialHelpPopup();return false;' style='cursor:pointer'>Important Instructions</a></p>";

            QRImageURL = "/images/qrcode/12.gif";
        }
        else if (SelectedMobilephone.Runtime == RunTimeOS.BlackBerryPearl)
        {
            LiveText = SetHelperText(InstructionsType.BlackBerryLive);
            SocialText = SetHelperText(InstructionsType.BlackBerrySocial);

            MobileDownloadPage = "http://www.getn2f.com/15";

            DownloadList = @"<span class='downloadlink'>Download Live <a style='font-size:smaller' href='http://www.getn2f.com/apps/BBPearlLIVE/N2FLive.zip'>here </a><small>Supports OS:<br/>4.5 and above</small></span><br />
                            <p style='text-align:default;'><a onclick='liveHelpPopup();return false;' style='cursor:pointer'>Important Instructions</a></p>
                            <span class='downloadlink'>Download Social <a style='font-size:smaller' href='http://www.getn2f.com/apps/BBPearlSOCIAL/Next2FriendsSocial.zip'>here </a><small>Supports OS:<br/>4.5 and above</small></span><br />
                            <p style='text-align:default;'><a onclick='socialHelpPopup();return false;' style='cursor:pointer'>Important Instructions</a></p>";

            QRImageURL = "/images/qrcode/15.gif";
        }
        else if (SelectedMobilephone.Runtime == RunTimeOS.BlackBerryCurveNoWifi)
        {
            LiveText = SetHelperText(InstructionsType.BlackBerryLive);
            SocialText = SetHelperText(InstructionsType.BlackBerrySocial);

            MobileDownloadPage = "http://www.getn2f.com/18";

            DownloadList = @"<span class='downloadlink'>Download Live <a style='font-size:smaller' href='http://www.getn2f.com/apps/BBCurveLIVE/N2FLive.zip'>here </a><small>Supports OS:<br/>4.5 and above</small></span><br />
                             <p style='text-align:default;'><a onclick='liveHelpPopup();return false;' style='cursor:pointer'>Important Instructions</a></p>
                            <span class='downloadlink'>Download Social <a style='font-size:smaller' href='http://www.getn2f.com/apps/8320nWIFIDESK/Next2FriendsSocial.zip'>here </a><small>Supports OS:<br/>4.5 and above</small></span><br />
                            <p style='text-align:default;'><a onclick='socialHelpPopup();return false;' style='cursor:pointer'>Important Instructions</a></p>";

            QRImageURL = "/images/qrcode/18.gif";
        }
        else if (SelectedMobilephone.Runtime == RunTimeOS.BlackBerryPearlNoWifi)
        {
            LiveText = SetHelperText(InstructionsType.BlackBerryLive);
            SocialText = SetHelperText(InstructionsType.BlackBerrySocial);

            MobileDownloadPage = "http://www.getn2f.com/19";

            DownloadList = @"<span class='downloadlink'>Download Live <a style='font-size:smaller' href='http://www.getn2f.com/apps/BBPearlLIVE/N2FLive.zip'>here </a><small>Supports OS:<br/>4.5 and above</small></span><br />
                            <p style='text-align:default;'><a onclick='liveHelpPopup();return false;' style='cursor:pointer'>Important Instructions</a></p>
                            <span class='downloadlink'>Download Social <a style='font-size:smaller' href='http://www.getn2f.com/apps/8120nWIFIDESK/Next2FriendsSocial.zip'>here </a><small>Supports OS:<br/>4.5 and above</small></span><br />
                            <p style='text-align:default;'><a onclick='socialHelpPopup();return false;' style='cursor:pointer'>Important Instructions</a></p>";

            QRImageURL = "/images/qrcode/19.gif";
        }
		else if (SelectedMobilephone.Runtime == RunTimeOS.BlackBerryBold)
        {
            LiveText = SetHelperText(InstructionsType.BlackBerryBold);
            SocialText = SetHelperText(InstructionsType.BlackBerrySocial);

            MobileDownloadPage = "http://www.getn2f.com/20";

            DownloadList = @"<span class='downloadlink'>Download Live <a style='font-size:smaller' href='http://www.getn2f.com/apps/9000desk/N2FLive.zip'>here </a></span><br />
                            <p style='text-align:default;'><a onclick='liveHelpPopup();return false;' style='cursor:pointer'><br/>Important Instructions</a></p>
                            <span class='downloadlink'>Download Social <a style='font-size:smaller' href='http://www.getn2f.com/apps/9000desk/Next2FriendsSocial.zip'>here </a></span><br />
                            <p style='text-align:default;'><a onclick='socialHelpPopup();return false;' style='cursor:pointer'><br/>Important Instructions</a></p>";

            QRImageURL = "/images/qrcode/20.gif";
        }
    }