Esempio n. 1
0
        public void PostaviStavki()
        {
            if (CurrNaracka != null)
            {
                for (int i = 0; i < Stavki.Count; i++)
                {
                    if (i < CurrNaracka.Stavki.Count)
                    {
                        Stavki[i].UpdateObject(CurrNaracka.Stavki[i + indStavki]);
                    }
                    else
                    {
                        Stavki[i].UpdateObject(null);
                    }
                }

                lblVreme.Text  = (DateTime.Now - CurrNaracka.Vreme).ToString(@"dd\.hh\:mm");
                lblVkupno.Text = CurrNaracka.VkupnaCena.ToString();
                if (CurrNaracka is Onsite)
                {
                    Onsite os = CurrNaracka as Onsite;
                    lblMasa.Text = os.BrojMasa.ToString();
                }
                else
                {
                    Online os = CurrNaracka as Online;
                    lblCenaZaDostava.UpdateObject(os.CenaZaDostava);
                    lblMasa.Text    = os.AdresaZaDostava;
                    lblKlient.Text  = String.Format("{0} {1} ", os.ImeKlient, os.PrezimeKlient);
                    lblKontakt.Text = os.Kontakt;
                }
            }
        }
Esempio n. 2
0
        public void SearchSkill()
        {
            Global.ExcelLib.PopulateInCollection(Base.ExcelPath, "SearchSkill");
            GlobalDefinitions.Wait();
            TxtSearcSkill.SendKeys(ExcelLib.ReadData(2, "Category"));
            SearchIcon.Click();
            //Checking the right page
            Assert.AreEqual("Search", GlobalDefinitions.driver.Title);
            Base.test = Base.extent.StartTest("On Share Search page");
            TxtSubCategory.SendKeys(ExcelLib.ReadData(2, "SubCategory"));
            SearchUser.SendKeys(ExcelLib.ReadData(2, "SearchUser"));
            IList <IWebElement> optionsToSelect = GlobalDefinitions.driver.FindElements(By.XPath("//input[@placeholder='Search user']"));

            foreach (IWebElement options in optionsToSelect)
            {
                Console.WriteLine(options);
                if (options.Text.Equals(SearchUser))
                {
                    Console.WriteLine("Trying to select: " + SearchUser);
                    options.Click();
                    break;
                }
            }
            Onsite.Click();
            Online.Click();
            ShowAll.Click();
        }
Esempio n. 3
0
        protected override void OnBindingContextChanged()
        {
            model = (Onsite)BindingContext;
            base.OnBindingContextChanged();
            StackLayout stack = CreateEditOnsiteDetail();

            View = stack;
        }
Esempio n. 4
0
 internal void SelectLocationType()
 {
     //enter service type
     if (GlobalDefinitions.ExcelLib.ReadData(2, "LocationType") == "On-site")
     {
         Onsite.Click();
     }
     else
     {
         Online.Click();
     }
 }
Esempio n. 5
0
        private void buttonFASAP2_Click(object sender, EventArgs e)
        {
            if (isVoted)
            {
                string updateOnsite = @"UPDATE RESTORAN
                                        SET REJTING = ((REJTING * PRIMEROK) + :Rejting) / (PRIMEROK + 1), PRIMEROK = PRIMEROK + 1
                                        WHERE RESTORAN_ID = :ResID";

                OracleCommand cmd = new OracleCommand(updateOnsite, Conn);

                OracleParameter prm = new OracleParameter("Rejting", OracleDbType.Double);
                prm.Value = Rejting;
                cmd.Parameters.Add(prm);

                prm       = new OracleParameter("ResID", OracleDbType.Int64);
                prm.Value = Restoran.RestoranID;
                cmd.Parameters.Add(prm);

                int br;
                try
                {
                    br = cmd.ExecuteNonQuery();
                }
                catch (Exception)
                {
                }
            }
            Onsite online = new Onsite(Naracka.NarackaID, Naracka.VkupnaCena, DateTime.Now, BrMasa);

            online.Stavki = Naracka.Stavki;
            online.SqlInsert(Conn, Restoran.RestoranID);
            UspesnostNaNaracka up = new UspesnostNaNaracka();

            up.ShowDialog();
            DialogResult = DialogResult.Yes;
        }
Esempio n. 6
0
        internal void Addingdate()
        {
            Actions actions = new Actions(Global.GlobalDefinitions.driver);



            //Populate the Excel sheet
            Global.GlobalDefinitions.ExcelLib.PopulateInCollection(Global.Base.ExcelPath, "Share_Skill");

            //click on share skill
            SSbutton.Click();
            Thread.Sleep(2000);

            //Click on title
            Title.Click();
            Title.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Title"));

            //clic on description
            Description.Click();
            Description.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Description"));

            //Click on Category
            actions.MoveToElement(Category).Build().Perform();
            Thread.Sleep(1000);
            IList <IWebElement> Select_Cat = Category.FindElements(By.TagName("option"));

            Console.WriteLine("List of category" + Select_Cat);
            int categorycount = Select_Cat.Count;

            for (int i = 0; i < categorycount; i++)
            {
                if (Select_Cat[i].Text == GlobalDefinitions.ExcelLib.ReadData(2, "Category"))
                {
                    Select_Cat[i].Click();
                    Console.WriteLine("Category is" + Select_Cat[i].Text);
                    Base.test.Log(LogStatus.Info, "Selected Category");
                }
            }

            //Click on Sub Category
            actions.MoveToElement(SubCategory).Build().Perform();
            Thread.Sleep(1000);
            IList <IWebElement> Select_SubCat = SubCategory.FindElements(By.TagName("option"));

            Console.WriteLine("List of category" + Select_SubCat);
            int Scategorycount = Select_SubCat.Count;

            for (int i = 0; i < Scategorycount; i++)
            {
                if (Select_SubCat[i].Text == GlobalDefinitions.ExcelLib.ReadData(2, "Sub-Category"))
                {
                    Select_SubCat[i].Click();
                    Console.WriteLine("Category is" + Select_SubCat[i].Text);
                    Base.test.Log(LogStatus.Info, "Selected Category");
                }
            }

            //Add tags
            actions.MoveToElement(Tags).Build().Perform();
            string tag1 = GlobalDefinitions.ExcelLib.ReadData(2, "Tags");
            string tag2 = GlobalDefinitions.ExcelLib.ReadData(3, "Tags");
            string tag3 = GlobalDefinitions.ExcelLib.ReadData(4, "Tags");

            Tags.SendKeys(tag1);
            Tags.SendKeys(Keys.Enter);

            Thread.Sleep(2000);
            Tags2.Click();
            // actions.MoveToElement(Tags2).Build().Perform();
            Tags2.SendKeys(tag2);

            Thread.Sleep(1000);
            //actions.MoveToElement(Tags).Build().Perform();
            //Tags.SendKeys(tag3);



            //Select service type
            actions.MoveToElement(ServiceType).Build().Perform();
            IList <IWebElement> ST = ServiceType.FindElements(By.XPath("//div/input[@name='serviceType']/following-sibling :: label"));

            for (int i = 0; i < ST.Count; i++)
            {
                Console.WriteLine("service from web" + ST[i].Text);
                if (ST[i].Text == GlobalDefinitions.ExcelLib.ReadData(2, "ServiceType"))
                {
                    HourlyService.Click();
                }
                else
                {
                    One_off_service.Click();
                }
                break;
            }

            //Select Location type
            actions.MoveToElement(LocationType).Build().Perform();
            IList <IWebElement> LT = ServiceType.FindElements(By.XPath("//div/input[@name='locationType']/following-sibling :: label"));

            for (int i = 0; i < LT.Count; i++)
            {
                Console.WriteLine("service from web" + LT[i].Text);
                if (LT[i].Text == GlobalDefinitions.ExcelLib.ReadData(2, "LocationType"))
                {
                    Onsite.Click();
                }
                else
                {
                    Online.Click();
                }
                break;
            }


            //Click on start date
            Startdate.Click();

            Thread.Sleep(1000);
            //Enter start date
            string s1 = Global.GlobalDefinitions.ExcelLib.ReadData(2, "StartDate");

            string[] s = s1.Split(' ');
            Console.WriteLine("1st part of string:" + s[0]);
            Console.WriteLine("2nd part of string:" + s[1]);
            string SD = s[0];

            Startdate.SendKeys(SD);

            //click on enddate
            Enddate.Click();
            //Enter End date
            string E1 = Global.GlobalDefinitions.ExcelLib.ReadData(2, "EndDate");

            string[] E = E1.Split(' ');
            Console.WriteLine("Enddate 1st part is:" + E[0]);
            Console.WriteLine("End date second part is:" + E[1]);
            string ED = E[0];

            Enddate.SendKeys(ED);

            Thread.Sleep(1000);
            //Enter day
            actions.MoveToElement(Days).Build().Perform();
            IList <IWebElement> Day_Name = Days.FindElements(By.XPath("//div[@class='ui checkbox']/input/following-sibling :: label"));

            Console.WriteLine("Days are" + Day_Name);
            IList <IWebElement> Day_check = Days.FindElements(By.XPath("//input[@tabindex='0' and @type='checkbox']"));

            Console.WriteLine("Day checkbox" + Day_check);
            Thread.Sleep(1000);
            int Day_Count      = Day_Name.Count;
            int DayCheck_Count = Day_check.Count;

            for (int i = 0; i < Day_Count; i++)
            {
                if (Day_Name[i].Text == GlobalDefinitions.ExcelLib.ReadData(2, "Day"))
                {
                    int j = i;
                    Day_check[j].Click();
                    Console.WriteLine("selected day is" + Day_Name[i]);
                }
            }

            //Enter starttime
            Start_Time.Click();
            string t1 = Global.GlobalDefinitions.ExcelLib.ReadData(2, "StartTime");

            Console.WriteLine("Starttime is:" + t1);
            Start_Time.SendKeys(t1);

            //Enter Endtime
            End_Time.Click();
            string ET = Global.GlobalDefinitions.ExcelLib.ReadData(2, "EndTime");

            Console.WriteLine("Endtime is:" + ET);
            End_Time.SendKeys(ET);

            //Select SkillExchange
            actions.MoveToElement(Skill_trade).Build().Perform();
            IList <IWebElement> Skill_E = Skill_trade.FindElements(By.XPath("//div/input[@name='skillTrades']/following-sibling :: label"));
            int SkillCount = Skill_E.Count;

            Console.WriteLine("count of radio buttons:" + SkillCount);
            for (int i = 0; i < SkillCount; i++)
            {
                if (Skill_E[i].Text == GlobalDefinitions.ExcelLib.ReadData(3, "SkillTrade"))
                {
                    Console.WriteLine("Skil is" + Skill_E[i].Text);
                    Skill_Exchange.Click();
                    actions.MoveToElement(Add_tags).Build().Perform();
                    string Tag = GlobalDefinitions.ExcelLib.ReadData(2, "SkillExchange");
                    Add_tags.SendKeys(Tag);
                    Base.test.Log(LogStatus.Info, "Selected skill");
                }

                else
                {
                    Credit.Click();
                    actions.MoveToElement(Add_credit).Build().Perform();
                    string Cr = GlobalDefinitions.ExcelLib.ReadData(2, "Credit");
                    Add_credit.SendKeys(Cr);
                }
                break;
            }


            //Click on Worksample
            PlusIcon.Click();

            //Performing the upload file operation using AutoIT

            AutoItX3 autoIT = new AutoItX3();

            autoIT.WinActivate("Open");
            Thread.Sleep(3000);
            string sample1 = GlobalDefinitions.ExcelLib.ReadData(2, "WorkSample");

            Console.WriteLine("file path is" + sample1);
            Thread.Sleep(2000);
            autoIT.Send(@sample1);
            Thread.Sleep(3000);
            autoIT.Send("{Enter}");
            Thread.Sleep(2000);

            //Downloading the file
            Download.Click();

            //Deleting a file
            Delete.Click();
            Thread.Sleep(500);

            actions.MoveToElement(Active).Build().Perform();
            IList <IWebElement> Active_Name = Active.FindElements(By.XPath("//div[@class='ui radio checkbox']/input[@name='isActive']/following-sibling :: label"));

            Console.WriteLine("Days are" + Active_Name);
            IList <IWebElement> Active_radio = Active.FindElements(By.XPath("//input[@name='isActive' and @type='radio']"));

            Console.WriteLine("Day checkbox" + Active_radio);
            Thread.Sleep(1000);
            int Active_Count = Active_Name.Count;

            for (int i = 0; i < Active_Count; i++)
            {
                if (Active_Name[i].Text == GlobalDefinitions.ExcelLib.ReadData(2, "Active"))
                {
                    int j = i;
                    Active_radio[j].Click();
                }
            }

            //click on save
            actions.MoveToElement(Buttons).Build().Perform();
            IList <IWebElement> BT = ServiceType.FindElements(By.XPath("//input[@type='button']"));

            for (int i = 0; i < BT.Count; i++)
            {
                Console.WriteLine("Button from web" + BT.Count);
                if (GlobalDefinitions.ExcelLib.ReadData(2, "Buttons") == "Save")
                {
                    Save.Click();
                }
                else
                {
                    Cancel.Click();
                }
                break;
            }


            string text = Global.GlobalDefinitions.driver.Title;

            if (text == "ServiceListing")
            {
                Global.Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Pass, "Share skill page");
            }
            else
            {
                Global.Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Fail, "Not valid page");
            }
        }
Esempio n. 7
0
        internal void EnterShareSkill()
        {
            //Explicit wait
            GlobalDefinitions.WaitForElement(GlobalDefinitions.driver, By.XPath("//a[contains(.,'Share Skill')]"));

            //click shareskill
            ShareSkillButton.Click();

            // Populate the excel data
            GlobalDefinitions.ExcelLib.PopulateInCollection(Base.ExcelPath, "ShareSkill");

            //Enter title
            Title.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Title"));

            //Enter Description
            Description.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Description"));

            // Select on Category Dropdown
            GlobalDefinitions.wait(10);
            SelectElement catg = new SelectElement(CategoryDropDown);

            catg.SelectByText(GlobalDefinitions.ExcelLib.ReadData(2, "Category"));

            //Select on SubCategory Dropdown
            GlobalDefinitions.wait(10);
            SelectElement subcatg = new SelectElement(SubCategoryDropDown);

            subcatg.SelectByText(GlobalDefinitions.ExcelLib.ReadData(2, "SubCategory"));

            //Enter Tag names in textbox
            Tags.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Tags"));
            Tags.SendKeys(Keys.Return);

            //Select the Service type
            if (GlobalDefinitions.ExcelLib.ReadData(2, "ServiceType") == "Hourly basis")
            {
                Hourly.Click();
            }
            else if (GlobalDefinitions.ExcelLib.ReadData(2, "ServiceType") == "One-off")
            {
                Oneoff.Click();
            }

            //Select the Location type
            if (GlobalDefinitions.ExcelLib.ReadData(2, "LocationType") == "On-site")
            {
                Onsite.Click();
            }
            else if (GlobalDefinitions.ExcelLib.ReadData(2, "LocationType") == "Online")
            {
                Online.Click();
            }

            //Click on Start Date dropdown
            StartDateDropDown.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Startdate"));

            //Click on End Date dropdown
            EndDateDropDown.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Enddate"));

            //Select available days
            Days.Click();

            //Select startTime
            StartTime.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Starttime"));

            //select endtime
            EndTimeDropDown.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Endtime"));

            if (GlobalDefinitions.ExcelLib.ReadData(2, "SkillTrade") == "Skill-Exchange")
            {
                //select SkillTradeOption
                SkillTradeOption.Click();
                //Enter SkillExchange
                SkillExchange.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Skill-Exchange"));
                SkillExchange.SendKeys(Keys.Return);
            }
            else if (GlobalDefinitions.ExcelLib.ReadData(2, "SkillTrade") == "Credit")
            {
                Credit.Click();
                Creditvalue.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "Credit"));
                Creditvalue.SendKeys(Keys.Enter);
            }
            //Click worksample
            Worksample.Click();
            //Worksample.SendKeys("path");

            //upload file using AutoIT
            AutoItX3 autoit = new AutoItX3();

            //Activate so that next action happens on this window
            autoit.WinActivate("Open");
            //autoit.Send(@"D:\Shareskillmars\FileUploadScript.exe");
            autoit.Send(@"D:\Shareskillmars\sample.txt");
            autoit.Send("{ENTER}");
            Thread.Sleep(10000);

            //Select user option
            if (GlobalDefinitions.ExcelLib.ReadData(2, "UserStatus") == "Active")
            {
                StatusActive.Click();
            }
            else if (GlobalDefinitions.ExcelLib.ReadData(2, "UserStatus") == "Hidden")
            {
                StatusHidden.Click();
            }

            //click save or cancel
            if (Global.GlobalDefinitions.ExcelLib.ReadData(2, "SaveOrCancel") == "Save")
            {
                Save.Click();
            }
            else if (Global.GlobalDefinitions.ExcelLib.ReadData(2, "SaveOrCancel") == "Cancel")
            {
                Cancel.Click();
            }
        }
Esempio n. 8
0
        public override List <Narachki.Naracka> ListaNaracki(Oracle.DataAccess.Client.OracleConnection conn)
        {
            Dictionary <VklucuvaKey, Stavka> Stavki = new Dictionary <VklucuvaKey, Stavka>();
            string          sqlMeni = @"SELECT n.Narachka_ID, n.VKUPNA_CENA, n.VREME, site.BROJ_MASA,st.stavka_id, st.ime_stavka, st.opis_stavka, st.cena_stavka, st.dodatok_stavka, vk.kolichina_stavka, vk.vkluchuva_id, vk.dodatok_id
                                FROM Korisnik k, Vraboten v, Onsite_narachka site, Narachka n, Vkluchuva vk, Stavka st
                                WHERE k.Vraboten_ID = v.Vraboten_ID AND site.Vraboten_ID = v.Vraboten_ID
		                                AND n.Narachka_ID = site.Narachka_ID AND n.Restoran_ID = site.Restoran_ID
		                                AND n.Restoran_ID = k.Restoran_ID 
                                        AND vk.RESTORAN_ID = n.RESTORAN_ID
                                        AND vk.NARACHKA_ID = n.NARACHKA_ID
                                        AND vk.RESTORAN_ID = st.RESTORAN_ID
                                        AND vk.STAVKA_ID = st.STAVKA_ID
                                        AND vk.IME_MENI = st.IME_MENI
		                                AND k.Korisnichko_ime = :UserName AND k.lozinka = :Password
		                                AND n.Realizirana = 0
                                        ORDER BY n.NARACHKA_ID, vk.VKLUCHUVA_ID";
            OracleCommand   cmd     = new OracleCommand(sqlMeni, conn);
            OracleParameter prm     = new OracleParameter("UserName", OracleDbType.Varchar2);

            prm.Value = Username;
            cmd.Parameters.Add(prm);
            prm       = new OracleParameter("Password", OracleDbType.Varchar2);
            prm.Value = Password;
            cmd.Parameters.Add(prm);
            cmd.CommandType = CommandType.Text;
            OracleDataReader          dr      = cmd.ExecuteReader();
            List <Naracka>            lista   = new List <Naracka>();
            Dictionary <int, Naracka> Naracki = new Dictionary <int, Naracka>();

            while (dr.Read())
            {
                int narid = dr.GetInt32(0);
                if (!Naracki.ContainsKey(narid))
                {
                    Naracka nar = new Onsite(narid, dr.GetInt32(1), dr.GetDateTime(2), dr.GetInt32(3));
                    Naracki.Add(narid, nar);
                    lista.Add(nar);
                }
                int    vklucuvaid = dr.GetInt32(10);
                int?   dodatokid;
                object obj1 = dr.GetValue(11);
                if (obj1 == null)
                {
                    dodatokid = null;
                }
                else
                {
                    dodatokid = obj1 as int?;
                }
                Object obj = dr.GetValue(6);
                String pomosen;
                if (obj == null)
                {
                    pomosen = null;
                }
                else
                {
                    pomosen = obj as String;
                }
                String IsDecorator = (string)dr.GetValue(8);
                if (IsDecorator == "1")
                {
                    Dodatok dodatok = new Dodatok(dr.GetInt16(4), dr.GetString(5), (decimal)dr.GetValue(7), pomosen);
                    dodatok.DodatokKey  = new VklucuvaKey(narid, dodatokid);
                    dodatok.VklucuvaKey = new VklucuvaKey(narid, vklucuvaid);
                    dodatok.Kolicina    = dr.GetInt32(9);
                    Stavki.Add(new VklucuvaKey(narid, vklucuvaid), dodatok);
                }
                else
                {
                    Stavka stavka = new Stavka(dr.GetInt16(4), dr.GetString(5), (decimal)dr.GetValue(7), pomosen);
                    stavka.DodatokKey  = new VklucuvaKey(narid, dodatokid);
                    stavka.VklucuvaKey = new VklucuvaKey(narid, vklucuvaid);
                    stavka.Kolicina    = dr.GetInt32(9);
                    Stavki.Add(new VklucuvaKey(narid, vklucuvaid), stavka);
                }
            }

            Dictionary <VklucuvaKey, Stavka> StavkiKoiSeRef = new Dictionary <VklucuvaKey, Stavka>();

            foreach (var obj in Stavki)
            {
                Stavka st;
                if (Stavki.TryGetValue(obj.Value.getDodatokKey(), out st))
                {
                    (obj.Value as Dodatok).Osnovna = st;
                    StavkiKoiSeRef.Add(obj.Value.getDodatokKey(), st);
                }
            }

            foreach (var obj in Stavki)
            {
                if (!StavkiKoiSeRef.ContainsKey(obj.Value.getVklucuvaKey()))
                {
                    Naracka nar;
                    if (Naracki.TryGetValue(obj.Value.VklucuvaKey.NarackaID, out nar))
                    {
                        nar.AddA(new OrderComponent(obj.Value, obj.Value.Kolicina));
                    }
                }
            }

            return(lista);
        }
        public void WorkExperienceLayout(List <WorkExperienceModel> workExperienceList)
        {
            if (ACTContext.isLogin == true)
            {
                #region work experience and onsite labels add button
                Label lblOnsiteSwithInfo = new Label {
                    Text = "Onsite Information ", HorizontalOptions = LayoutOptions.EndAndExpand, TextColor = Color.FromHex("5e247f"), FontSize = 12, FontAttributes = FontAttributes.Bold
                };
                Switch switchForOnsite1 = new Switch {
                    HorizontalOptions = LayoutOptions.End, BackgroundColor = Color.Transparent
                };
                StackLayout sSwithForOnsite = new StackLayout
                {
                    Children    = { lblOnsiteSwithInfo, switchForOnsite1 },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 20, 0, 0)
                };
                Button btnAddNewWorkExp = new Button {
                    Text = "Add work experience", HorizontalOptions = LayoutOptions.EndAndExpand, BackgroundColor = Color.FromHex("4690FB"), TextColor = Color.White, BorderRadius = 10, HeightRequest = 35, FontSize = 10, FontAttributes = FontAttributes.Bold
                };
                StackLayout sBtnAddNewWorkExp = new StackLayout
                {
                    Children    = { btnAddNewWorkExp },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(2, 5, 2, 5)
                };


                Label lblCompanyWorkExperienceInfo = new Label {
                    Text = "Work Experience Information", HorizontalOptions = LayoutOptions.CenterAndExpand, TextColor = Color.FromHex("5e247f"), FontSize = 18, FontAttributes = FontAttributes.Bold, HeightRequest = 30
                };
                Label companyWorkExperience = new Label {
                    Text = "", HorizontalOptions = LayoutOptions.Start, TextColor = Color.Black, HeightRequest = 40
                };
                StackLayout sCompanyWorkExperience = new StackLayout
                {
                    Children    = { lblCompanyWorkExperienceInfo, companyWorkExperience },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 20, 0, 0)
                };

                Label lblOnsiteInformation = new Label {
                    Text = "Onsite Information", HorizontalOptions = LayoutOptions.CenterAndExpand, TextColor = Color.FromHex("5e247f"), FontSize = 14, FontAttributes = FontAttributes.Bold, WidthRequest = 125, HeightRequest = 30
                };
                StackLayout sOnsiteInformation = new StackLayout
                {
                    Children    = { lblOnsiteInformation },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 20, 0, 0)
                };
                #endregion

                #region separator
                BoxView separator1 = new BoxView()
                {
                    Color = Color.Gray, HeightRequest = 1, HorizontalOptions = LayoutOptions.FillAndExpand
                };
                StackLayout sSeparator1 = new StackLayout
                {
                    Children    = { separator1 },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 0, 0, 0)
                };
                BoxView separator2 = new BoxView()
                {
                    Color = Color.Gray, HeightRequest = 1, HorizontalOptions = LayoutOptions.FillAndExpand
                };
                StackLayout sSeparator2 = new StackLayout
                {
                    Children    = { separator2 },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 0, 0, 0)
                };
                BoxView separator3 = new BoxView()
                {
                    Color = Color.Gray, HeightRequest = 1, HorizontalOptions = LayoutOptions.FillAndExpand
                };
                StackLayout sSeparator3 = new StackLayout
                {
                    Children    = { separator3 },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 0, 0, 0)
                };
                BoxView separator4 = new BoxView()
                {
                    Color = Color.Gray, HeightRequest = 1, HorizontalOptions = LayoutOptions.FillAndExpand
                };
                StackLayout sSeparator4 = new StackLayout
                {
                    Children    = { separator4 },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 0, 0, 0)
                };
                BoxView separator5 = new BoxView()
                {
                    Color = Color.Gray, HeightRequest = 1, HorizontalOptions = LayoutOptions.FillAndExpand
                };
                StackLayout sSeparator5 = new StackLayout
                {
                    Children    = { separator5 },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 0, 0, 0)
                };
                BoxView separator6 = new BoxView()
                {
                    Color = Color.Gray, HeightRequest = 1, HorizontalOptions = LayoutOptions.FillAndExpand
                };
                StackLayout sSeparator6 = new StackLayout
                {
                    Children    = { separator6 },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 0, 0, 0)
                };
                BoxView separator7 = new BoxView()
                {
                    Color = Color.Gray, HeightRequest = 1, HorizontalOptions = LayoutOptions.FillAndExpand
                };
                StackLayout sSeparator7 = new StackLayout
                {
                    Children    = { separator7 },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 0, 0, 0)
                };
                BoxView separator8 = new BoxView()
                {
                    Color = Color.Gray, HeightRequest = 1, HorizontalOptions = LayoutOptions.FillAndExpand
                };
                StackLayout sSeparator8 = new StackLayout
                {
                    Children    = { separator8 },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 0, 0, 0)
                };
                BoxView separator9 = new BoxView()
                {
                    Color = Color.Gray, HeightRequest = 1, HorizontalOptions = LayoutOptions.FillAndExpand
                };
                StackLayout sSeparator9 = new StackLayout
                {
                    Children    = { separator9 },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 0, 0, 0)
                };
                BoxView separator10 = new BoxView()
                {
                    Color = Color.Gray, HeightRequest = 1, HorizontalOptions = LayoutOptions.FillAndExpand
                };
                StackLayout sSeparator10 = new StackLayout
                {
                    Children    = { separator10 },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 0, 0, 0)
                };
                BoxView separator11 = new BoxView()
                {
                    Color = Color.Gray, HeightRequest = 1, HorizontalOptions = LayoutOptions.FillAndExpand
                };
                StackLayout sSeparator11 = new StackLayout
                {
                    Children    = { separator11 },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 0, 0, 0)
                };
                BoxView separator12 = new BoxView()
                {
                    Color = Color.Gray, HeightRequest = 1, HorizontalOptions = LayoutOptions.FillAndExpand
                };
                StackLayout sSeparator12 = new StackLayout
                {
                    Children    = { separator12 },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 0, 0, 0)
                };
                BoxView separatorListview = new BoxView()
                {
                    Color = Color.Gray, HeightRequest = 1, HorizontalOptions = LayoutOptions.FillAndExpand
                };
                StackLayout sSeparatorListview = new StackLayout
                {
                    Children    = { separatorListview },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 0, 0, 0)
                };

                BoxView separatorListviewOnsite = new BoxView()
                {
                    Color = Color.Gray, HeightRequest = 1, HorizontalOptions = LayoutOptions.FillAndExpand
                };
                StackLayout sSeparatorListviewOnsite = new StackLayout
                {
                    Children    = { separatorListviewOnsite },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 0, 0, 0)
                };
                #endregion

                #region company name, designation, role

                Label lblAddNewWorkExp = new Label {
                    Text = "Add new work experience information here", HorizontalOptions = LayoutOptions.Start, TextColor = Color.FromHex("5e247f"), FontSize = 14, FontAttributes = FontAttributes.Bold
                };
                StackLayout slblAddNewWorkExp = new StackLayout
                {
                    Children    = { lblAddNewWorkExp },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 20, 0, 0)
                };

                CompanyName = new CustomEntryForGeneralPurpose {
                    Placeholder = "Company Name", HorizontalOptions = LayoutOptions.FillAndExpand
                };
                StackLayout sCompanyName = new StackLayout
                {
                    Children    = { CompanyName },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 0, 0, 0)
                };

                workDesignation = new CustomEntryForGeneralPurpose {
                    Placeholder = "Designation", HorizontalOptions = LayoutOptions.FillAndExpand
                };
                StackLayout sWorkDesignation = new StackLayout
                {
                    Children    = { workDesignation },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 0, 0, 0)
                };

                workRole = new CustomEntryForGeneralPurpose {
                    Placeholder = "Role", HorizontalOptions = LayoutOptions.FillAndExpand
                };
                StackLayout sWorkRole = new StackLayout
                {
                    Children    = { workRole },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 0, 0, 0)
                };

                #endregion

                #region duration
                Label lblWorkDuration = new Label {
                    Text = "Duration", HorizontalOptions = LayoutOptions.Start, TextColor = Color.Gray, WidthRequest = 80, HeightRequest = 30
                };
                StackLayout slblWorkDuration = new StackLayout
                {
                    Children    = { lblWorkDuration },
                    Orientation = StackOrientation.Horizontal,
                    Margin      = new Thickness(0, 8, 0, 0)
                };
                lblFromDateText = new Label {
                    Text = "From", HorizontalOptions = LayoutOptions.Center, TextColor = Color.Gray
                };

                StackLayout sLblFromDateText = new StackLayout
                {
                    Children    = { lblFromDateText },
                    Orientation = StackOrientation.Horizontal,
                    Margin      = new Thickness(0, 8, 0, 0)
                };

                Image imgFromDateArrow = new Image {
                    Source = "calendar.png", HorizontalOptions = LayoutOptions.End
                };

                StackLayout slFromDateTap = new StackLayout {
                    Children = { sLblFromDateText, imgFromDateArrow }, Orientation = StackOrientation.Horizontal
                };

                DatePicker dtFromDate = new DatePicker {
                    IsVisible = false, BackgroundColor = Color.White
                };
                var fromDateTapGestureRecognizer = new TapGestureRecognizer();

                fromDateTapGestureRecognizer.NumberOfTapsRequired = 1; // single-tap
                fromDateTapGestureRecognizer.Tapped += (s, e) =>
                {
                    dtFromDate.Focus();
                };

                slFromDateTap.GestureRecognizers.Add(fromDateTapGestureRecognizer);

                dtFromDate.DateSelected += (object sender, DateChangedEventArgs e) =>
                {
                    lblFromDateText.Text = e.NewDate.ToString("yyyy-MM-dd");
                };

                //To date
                lblToDateText = new Label {
                    Text = "To", HorizontalOptions = LayoutOptions.Center, TextColor = Color.Gray
                };

                StackLayout sLblToDateText = new StackLayout
                {
                    Children    = { lblToDateText },
                    Orientation = StackOrientation.Horizontal,
                    Margin      = new Thickness(0, 8, 0, 0)
                };

                Image imgToDateArrow = new Image {
                    Source = "calendar.png", HorizontalOptions = LayoutOptions.End
                };

                StackLayout slToDateTap = new StackLayout {
                    Children = { sLblToDateText, imgToDateArrow }, Orientation = StackOrientation.Horizontal
                };

                DatePicker dtToDate = new DatePicker {
                    IsVisible = false, BackgroundColor = Color.White
                };
                var toDateTapGestureRecognizer = new TapGestureRecognizer();

                toDateTapGestureRecognizer.NumberOfTapsRequired = 1; // single-tap
                toDateTapGestureRecognizer.Tapped += (s, e) =>
                {
                    dtToDate.Focus();
                };

                slToDateTap.GestureRecognizers.Add(toDateTapGestureRecognizer);

                dtToDate.DateSelected += (object sender, DateChangedEventArgs e) =>
                {
                    lblToDateText.Text = e.NewDate.ToString("yyyy-MM-dd");
                };

                Label lblFromToTo = new Label {
                    Text = "-", HorizontalOptions = LayoutOptions.Center, TextColor = Color.Gray
                };

                StackLayout sLblFromToTo = new StackLayout
                {
                    Children    = { lblFromToTo },
                    Orientation = StackOrientation.Horizontal,
                    Margin      = new Thickness(0, 8, 0, 0)
                };

                StackLayout sWorkDuration = new StackLayout
                {
                    Children    = { slblWorkDuration, slFromDateTap, dtFromDate, sLblFromToTo, slToDateTap, dtToDate },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(3, 0, 0, 0)
                };
                #endregion duration

                #region contacts
                workReferenceContact = new CustomEntryForGeneralPurpose {
                    Placeholder = "Reference Contact", HorizontalOptions = LayoutOptions.FillAndExpand
                };
                StackLayout sWorkReferenceContact = new StackLayout
                {
                    Children    = { workReferenceContact },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 0, 0, 0)
                };

                workPhoneNo = new CustomEntryForGeneralPurpose {
                    Placeholder = "Phone No", HorizontalOptions = LayoutOptions.FillAndExpand
                };
                StackLayout sWorkPhoneNo = new StackLayout
                {
                    Children    = { workPhoneNo },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 0, 0, 0)
                };
                #endregion

                #region worked company and location

                Label lblAddNewOnsiteInfo = new Label {
                    Text = "Add new onsite detail information here", HorizontalOptions = LayoutOptions.Start, TextColor = Color.FromHex("5e247f"), FontSize = 14, FontAttributes = FontAttributes.Bold
                };
                StackLayout slblAddNewOnsiteInfo = new StackLayout
                {
                    Children    = { lblAddNewOnsiteInfo },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 20, 0, 0)
                };

                onsiteWorkedCompany = new CustomEntryForGeneralPurpose {
                    Placeholder = "Worked Company", HorizontalOptions = LayoutOptions.FillAndExpand
                };
                StackLayout sOnsiteWorkedCompany = new StackLayout
                {
                    Children    = { onsiteWorkedCompany },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 0, 0, 0)
                };


                onsiteWorkedCompanyLocation = new CustomEntryForGeneralPurpose {
                    Placeholder = "Location", HorizontalOptions = LayoutOptions.FillAndExpand
                };
                StackLayout sOnsiteWorkedCompanyLocation = new StackLayout
                {
                    Children    = { onsiteWorkedCompanyLocation },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 0, 0, 0)
                };
                #endregion

                #region duration
                Label lblOnsiteWorkedCompanyDuration = new Label {
                    Text = "Duration", HorizontalOptions = LayoutOptions.Start, TextColor = Color.Gray, WidthRequest = 80, HeightRequest = 30
                };
                StackLayout slblOnsiteWorkedCompanyDuration = new StackLayout
                {
                    Children    = { lblOnsiteWorkedCompanyDuration },
                    Orientation = StackOrientation.Horizontal,
                    Margin      = new Thickness(0, 8, 0, 0)
                };

                lblFromDateOnsiteText = new Label {
                    Text = "From", HorizontalOptions = LayoutOptions.Center, TextColor = Color.Gray
                };

                StackLayout slblFromDateOnsiteText = new StackLayout
                {
                    Children    = { lblFromDateOnsiteText },
                    Orientation = StackOrientation.Horizontal,
                    Margin      = new Thickness(0, 8, 0, 0)
                };

                Image imgFromDateOnsiteArrow = new Image {
                    Source = "calendar.png", HorizontalOptions = LayoutOptions.End
                };

                StackLayout slFromDateOnsiteTap = new StackLayout {
                    Children = { slblFromDateOnsiteText, imgFromDateOnsiteArrow }, Orientation = StackOrientation.Horizontal
                };

                DatePicker dtFromOnsiteDate = new DatePicker {
                    IsVisible = false, BackgroundColor = Color.White
                };
                var fromDateOnsiteTapGestureRecognizer = new TapGestureRecognizer();

                fromDateOnsiteTapGestureRecognizer.NumberOfTapsRequired = 1; // single-tap
                fromDateOnsiteTapGestureRecognizer.Tapped += (s, e) =>
                {
                    dtFromOnsiteDate.Focus();
                };

                slFromDateOnsiteTap.GestureRecognizers.Add(fromDateOnsiteTapGestureRecognizer);

                dtFromOnsiteDate.DateSelected += (object sender, DateChangedEventArgs e) =>
                {
                    lblFromDateOnsiteText.Text = e.NewDate.ToString("yyyy-MM-dd");
                };

                //To date
                lblToDateOnsiteText = new Label {
                    Text = "To", HorizontalOptions = LayoutOptions.Center, TextColor = Color.Gray
                };

                StackLayout slblToDateOnsiteText = new StackLayout
                {
                    Children    = { lblToDateOnsiteText },
                    Orientation = StackOrientation.Horizontal,
                    Margin      = new Thickness(0, 8, 0, 0)
                };

                Image imgToDateOnsiteArrow = new Image {
                    Source = "calendar.png", HorizontalOptions = LayoutOptions.End
                };

                StackLayout slToDateOnsiteTap = new StackLayout {
                    Children = { slblToDateOnsiteText, imgToDateOnsiteArrow }, Orientation = StackOrientation.Horizontal
                };

                DatePicker dtToDateOnsite = new DatePicker {
                    IsVisible = false, BackgroundColor = Color.White
                };
                var toDateOnsiteTapGestureRecognizer = new TapGestureRecognizer();

                toDateOnsiteTapGestureRecognizer.NumberOfTapsRequired = 1; // single-tap
                toDateOnsiteTapGestureRecognizer.Tapped += (s, e) =>
                {
                    dtToDateOnsite.Focus();
                };

                slToDateOnsiteTap.GestureRecognizers.Add(toDateOnsiteTapGestureRecognizer);

                dtToDateOnsite.DateSelected += (object sender, DateChangedEventArgs e) =>
                {
                    lblToDateOnsiteText.Text = e.NewDate.ToString("yyyy-MM-dd");
                };

                Label lblFromToToOnsite = new Label {
                    Text = "-", HorizontalOptions = LayoutOptions.Center, TextColor = Color.Gray
                };

                StackLayout slblFromToToOnsite = new StackLayout
                {
                    Children    = { lblFromToToOnsite },
                    Orientation = StackOrientation.Horizontal,
                    Margin      = new Thickness(0, 8, 0, 0)
                };

                StackLayout sOnsiteWorkedCompanyDuration = new StackLayout
                {
                    Children    = { slblOnsiteWorkedCompanyDuration, slFromDateOnsiteTap, dtFromOnsiteDate, slblFromToToOnsite, slToDateOnsiteTap, dtToDateOnsite },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(3, 0, 0, 0)
                };
                #endregion

                #region onsite detail, contacts
                onsiteWorkedCompanyDetail = new CustomEntryForGeneralPurpose {
                    Placeholder = "Onsite Detail", HorizontalOptions = LayoutOptions.FillAndExpand
                };
                StackLayout sOnsiteWorkedCompanyDetail = new StackLayout
                {
                    Children    = { onsiteWorkedCompanyDetail },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 0, 0, 0)
                };


                onsiteWorkedCompanyReferenceContact = new CustomEntryForGeneralPurpose {
                    Placeholder = "Reference Contact", HorizontalOptions = LayoutOptions.FillAndExpand, Keyboard = Keyboard.Numeric
                };
                onsiteWorkedCompanyReferenceContact.Behaviors.Add(new NumberValidationBehavior());
                StackLayout sOnsiteWorkedCompanyReferenceContact = new StackLayout
                {
                    Children    = { onsiteWorkedCompanyReferenceContact },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 0, 0, 0)
                };


                onsiteWorkedCompanyPhoneNo = new CustomEntryForGeneralPurpose {
                    Placeholder = "Phone No", HorizontalOptions = LayoutOptions.FillAndExpand
                };
                StackLayout sOnsiteWorkedCompanyPhoneNo = new StackLayout
                {
                    Children    = { onsiteWorkedCompanyPhoneNo },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 0, 0, 0)
                };
                #endregion

                #region listView

                StackLayout slHeaderText = new StackLayout();
                Label       lblCompany   = new Label {
                    Text = "Company", FontAttributes = FontAttributes.Bold, WidthRequest = 125, HorizontalOptions = LayoutOptions.Start, TextColor = Color.FromHex("5e247f")
                };
                Label lblRole = new Label {
                    Text = "Role", FontAttributes = FontAttributes.Bold, WidthRequest = 125, HorizontalOptions = LayoutOptions.Start, TextColor = Color.FromHex("5e247f")
                };
                Label lblDesigation = new Label {
                    Text = "Designation", FontAttributes = FontAttributes.Bold, WidthRequest = 125, HorizontalOptions = LayoutOptions.Start, TextColor = Color.FromHex("5e247f")
                };
                Label lblEmpty = new Label {
                    Text = "", HorizontalOptions = LayoutOptions.Start, TextColor = Color.Black
                };
                slHeaderText = new StackLayout
                {
                    Children    = { lblCompany, lblRole, lblDesigation, lblEmpty },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 0, 0, 0)
                };

                if (workExperienceList.Count == 0)
                {
                    slHeaderText.IsVisible       = false;
                    sSeparatorListview.IsVisible = false;
                }

                listView.HeightRequest             = 50 * workExperienceList.Count;
                workExperienceObservableCollection = workExperienceList;

                listView.ItemsSource  = workExperienceObservableCollection;
                listView.ItemTemplate = new DataTemplate(() => new WorkExperienceCell(workExperienceObservableCollection));
                StackLayout sListView = new StackLayout
                {
                    Children = { listView },
                    //Orientation = StackOrientation.Horizontal,
                    //Padding = new Thickness(0, 0, 0, 0)
                    VerticalOptions = LayoutOptions.FillAndExpand,
                    Orientation     = StackOrientation.Vertical
                };
                listView.MinimumHeightRequest = listView.Height;
                listView.BackgroundColor      = Color.Transparent;
                #endregion

                #region contents, button
                slForOnsiteInformation = new StackLayout
                {
                    Children = { sOnsiteInformation, slblAddNewOnsiteInfo,         sOnsiteWorkedCompany,
                                 sSeparator7,        sOnsiteWorkedCompanyLocation,
                                 sSeparator8,        sOnsiteWorkedCompanyDuration,
                                 sSeparator9,        sOnsiteWorkedCompanyDetail,   sSeparator10,        sOnsiteWorkedCompanyReferenceContact,sSeparator11, sOnsiteWorkedCompanyPhoneNo, sSeparator12 },
                    IsVisible = false
                };

                Label AfterSaveResponse = new Label {
                    Text = "", HorizontalOptions = LayoutOptions.CenterAndExpand, TextColor = Color.Green
                };
                StackLayout slAfterSaveResponse = new StackLayout
                {
                    Children    = { AfterSaveResponse },
                    Orientation = StackOrientation.Horizontal,
                    Margin      = new Thickness(0, 8, 0, 0)
                };

                Button btnSaveData = new Button {
                    Text = "SAVE", HorizontalOptions = LayoutOptions.CenterAndExpand, BackgroundColor = Color.FromHex("f7cc59"), TextColor = Color.Black, BorderRadius = 50, WidthRequest = 270, FontAttributes = FontAttributes.Bold
                };
                StackLayout sbtnSaveData = new StackLayout
                {
                    Children    = { btnSaveData },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 10, 0, 8)
                };

                #region stack layout for adding all work experience info
                slAddAllExperienceInformation = new StackLayout
                {
                    Children = { slblAddNewWorkExp, sCompanyName, sSeparator1, sWorkDesignation, sSeparator2, sWorkRole, sSeparator3, sWorkDuration, sSeparator4, sWorkReferenceContact, sSeparator5, sWorkPhoneNo, sSeparator6, sSwithForOnsite }
                };
                slAddAllExperienceInformation.IsVisible = false;
                sbtnSaveData.IsVisible    = false;
                btnAddNewWorkExp.Clicked += (object sender, EventArgs e) =>
                {
                    slAddAllExperienceInformation.IsVisible = true;
                    sbtnSaveData.IsVisible = true;
                };
                #endregion

                StackLayout slWorkExperienceInfo = new StackLayout
                {
                    //Children = { sSwithForOnsite, sCompanyWorkExperience, sCompanyName, sWorkDesignation, sWorkRole, sWorkDuration, sWorkReferenceContact, sWorkPhoneNo, sOnsiteInformation, sOnsiteWorkedCompany, sOnsiteWorkedCompanyLocation, sOnsiteWorkedCompanyDuration, sOnsiteWorkedCompanyDetail, sOnsiteWorkedCompanyReferenceContact, slForOnsiteInformation, slAfterSaveResponse, sbtnSaveData },
                    Children          = { sBtnAddNewWorkExp, sCompanyWorkExperience, slHeaderText, sSeparatorListview, sListView, slAddAllExperienceInformation, slForOnsiteInformation, slAfterSaveResponse, sbtnSaveData },
                    HorizontalOptions = LayoutOptions.FillAndExpand,
                    VerticalOptions   = LayoutOptions.FillAndExpand,
                    Padding           = new Thickness(20, 0, 20, 0),
                    BackgroundColor   = Color.White
                };

                ScrollView svMyProfile = new ScrollView {
                    Content = slWorkExperienceInfo
                };

                Content = svMyProfile;
                #endregion

                #region post data to server side
                WorkExperienceModel workExperienceModel = new WorkExperienceModel();
                Onsite onsite = new Onsite();
                switchForOnsite1.Toggled += (object sender, ToggledEventArgs e) =>
                {
                    slForOnsiteInformation.IsVisible = true;
                    if (switchForOnsite1.IsToggled == false)
                    {
                        slForOnsiteInformation.IsVisible = false;
                    }
                };
                btnSaveData.Clicked += (object sender, EventArgs e) =>
                {
                    if (Validate())
                    {
                        if (DateTime.Parse(lblFromDateText.Text) > DateTime.Parse(lblToDateText.Text))
                        {
                            DisplayAlert("Error", "Start date can not be greater than end date.", "OK");
                        }
                        else if (slForOnsiteInformation.IsVisible == true && (DateTime.Parse(lblFromDateOnsiteText.Text) > DateTime.Parse(lblToDateOnsiteText.Text)))
                        {
                            DisplayAlert("Error", "Start date can not be greater than end date for onsite.", "OK");
                        }
                        else
                        {
                            workExperienceModel.UserId           = ACTContext.userId;
                            workExperienceModel.Company          = CompanyName.Text;
                            workExperienceModel.Role             = workRole.Text;
                            workExperienceModel.Designation      = workDesignation.Text;
                            workExperienceModel.FromDate         = DateTime.Parse(lblFromDateText.Text);
                            workExperienceModel.ToDate           = DateTime.Parse(lblToDateText.Text);
                            workExperienceModel.ExperienceBrief  = companyWorkExperience.Text;
                            workExperienceModel.ReferenceContact = workReferenceContact.Text;
                            workExperienceModel.ExperoenceYear   = 5;

                            slHeaderText.IsVisible       = true;
                            sSeparatorListview.IsVisible = true;

                            onsite.OnsiteDetails = onsiteWorkedCompanyDetail.Text;
                            if (slForOnsiteInformation.IsVisible == true)
                            {
                                onsite.StartDate = DateTime.Parse(lblFromDateOnsiteText.Text);
                                onsite.EndDate   = DateTime.Parse(lblToDateOnsiteText.Text);
                            }
                            if (slForOnsiteInformation.IsVisible == false)
                            {
                                onsite.StartDate = DateTime.Now;
                                onsite.EndDate   = DateTime.Now;
                            }
                            if (slForOnsiteInformation.IsVisible == true)
                            {
                                onsite.ContactDetails = int.Parse(onsiteWorkedCompanyReferenceContact.Text);
                            }
                            if (slForOnsiteInformation.IsVisible == false)
                            {
                                onsite.ContactDetails = 0;
                            }
                            onsite.Location = onsiteWorkedCompanyLocation.Text;

                            if (slForOnsiteInformation.IsVisible == false)
                            {
                                workExperienceModel.onsite = null;
                            }
                            if (slForOnsiteInformation.IsVisible == true)
                            {
                                workExperienceModel.onsite = onsite;
                            }


                            Device.BeginInvokeOnMainThread(async() =>
                            {
                                var result                               = await Service.PostWorkExperience(workExperienceModel);
                                CompanyName.Text                         = string.Empty;
                                workDesignation.Text                     = string.Empty;
                                workRole.Text                            = string.Empty;
                                workReferenceContact.Text                = string.Empty;
                                workPhoneNo.Text                         = string.Empty;
                                onsiteWorkedCompany.Text                 = string.Empty;
                                onsiteWorkedCompanyLocation.Text         = string.Empty;
                                onsiteWorkedCompanyDetail.Text           = string.Empty;
                                onsiteWorkedCompanyDetail.Text           = string.Empty;
                                onsiteWorkedCompanyPhoneNo.Text          = string.Empty;
                                onsiteWorkedCompanyReferenceContact.Text = string.Empty;



                                AfterSaveResponse.Text = "Data saved successfully";

                                var resultUpdated = await Service.GetWorkExpById(ACTContext.userId);         //63

                                var resultForOnsiteUpdated = await Service.GetOnsiteInfo(ACTContext.userId); //63

                                if (resultUpdated != null)
                                {
                                    workExperienceList = (List <WorkExperienceModel>)JsonConvert.DeserializeObject <List <WorkExperienceModel> >(resultUpdated);
                                }
                                workExperienceObservableCollection = workExperienceList;
                                listView.HeightRequest             = 50 * workExperienceList.Count;
                                listView.ItemsSource  = workExperienceObservableCollection;
                                listView.ItemTemplate = new DataTemplate(() => new WorkExperienceCell(workExperienceObservableCollection));
                            });
                        }
                    }
                    ;
                };
                #endregion
            }
            else
            {
                Navigation.PushModalAsync(new Login());
            }
        }
 internal void FilterSkill()
 {
     Onsite.Click();
 }
        public void Addshareskilldetails()
        {
            //Click on the "Share Skill" Button
            Addshareskill.Click();
            Thread.Sleep(1000);

            //Send data to the "Title" textbox
            Title.SendKeys("I am the Software test analyst with five years of experience using Selenium");
            Thread.Sleep(1000);

            //Send data to the "Description" textbox
            Description.SendKeys("I love to do projects in the software testing and implementing the Page factory.");
            Thread.Sleep(1000);

            //Click the "Category" and Select the options in it
            IWebElement   Category    = Driver.driver.FindElement(By.XPath("//select[@name='categoryId']"));
            SelectElement Category_dd = new SelectElement(Category);

            Category_dd.SelectByValue("Business");
            Thread.Sleep(1000);

            //Click the "Sub Category" for "business" and Select the options in it
            IWebElement   SubCategory    = Driver.driver.FindElement(By.XPath("//select[@name='subcategoryId']"));
            SelectElement SubCategory_dd = new SelectElement(SubCategory);

            SubCategory_dd.SelectByValue("Other");
            Thread.Sleep(1000);


            //Tags
            Addtag.SendKeys(Keys.Enter);
            Thread.Sleep(1000);


            //Select the "service type" in which options between (1.Hourly basis service, 2- One-off service), Selectin "One-off service"
            Oneoffservice.Click();
            Thread.Sleep(1000);
            //IWebElement Servicetype = Driver.driver.FindElement(By.XPath("//select[@name='categoryId']"));
            //SelectElement Servicetype_dd = new SelectElement(Servicetype);
            //Servicetype_dd.SelectByValue("1");



            //Select the "location type" In which options between (1. Onsite, 2. Off Site), Selecting "Online" option
            //IWebElement Locationtype = Driver.driver.FindElement(By.XPath("//select[@name='categoryId']"));
            //SelectElement Locationtype_dd = new SelectElement(Locationtype);
            //Locationtype_dd.SelectByValue("1");
            Onsite.Click();
            Thread.Sleep(1000);

            //Enter data to the "Available Days"
            Startdate.SendKeys("07132019");
            Thread.Sleep(1000);


            //Select the "Skilltrade"
            //IWebElement Skilltrade = Driver.driver.FindElement(By.XPath("//select[@name='categoryId']"));
            //SelectElement Skilltrade_dd = new SelectElement(Skilltrade);
            //Skilltrade_dd.SelectByValue("1");


            //Select the "Skill-Exchange" option under the "Skill Trade" option
            Skilltrade.Click();
            Thread.Sleep(1000);

            //Sending data in "Skill-Exchange" textbox and press "Enter"
            Skillexchange.SendKeys("Python");
            Skillexchange.SendKeys(Keys.Enter);
            Thread.Sleep(1000);


            //Send data to the "Amount" textbox under the "Credit" field
            //Credit.SendKeys("2");
            //Thread.Sleep(1000);

            //Select the "Active" field in which options (1.Active, 2. Hidden), Selecting "Active" option
            Active.Click();
            Thread.Sleep(1000);
            //IWebElement Active = Driver.driver.FindElement(By.XPath("//h3[contains(text(),'Active')]"));
            //SelectElement Active_dd = new SelectElement(Active);
            //Active_dd.SelectByValue("true");

            //Click on the "Save" Button
            Save.Click();
            Thread.Sleep(1000);
        }