Exemplo n.º 1
0
 private void AddingButton_Click(object sender, RoutedEventArgs e)
 {
     if (!string.IsNullOrWhiteSpace(AddName.Text) && !string.IsNullOrWhiteSpace(AddDescription.Text) && !string.IsNullOrWhiteSpace(AddPrice.Text) && !string.IsNullOrWhiteSpace(AddQuantity.Text))
     {
         try
         {
             string InsertQuery = "insert into items(ITEM_NAME,ITEM_PRICE,ITEM_DESCRIPTION,ITEM_QUANTATY) VALUES('" + AddName.Text + "','" + int.Parse(AddPrice.Text) + "','" + AddDescription.Text + "'," + int.Parse(AddQuantity.Text) + ")";
             connection.Open();
             MySqlCommand cmd = new MySqlCommand(InsertQuery, connection);
             cmd.ExecuteNonQuery();
         }
         catch (MySqlException ex)
         {
             MessageBox.Show(ex.ToString());
         }
         finally
         {
             connection.Close();
             MessageBox.Show("Successfully Added", "Success");
             AddName.Clear();
             AddDescription.Clear();
             AddPrice.Clear();
             AddQuantity.Clear();
         }
     }
     else
     {
         MessageBox.Show("incorrect input", "ERROR");
     }
 }
Exemplo n.º 2
0
        public void Describe(AddDescription describe, ScriptScope scope)
        {
            describe(JsonType.Function, "html2Text(text)",
                     Resources.ScriptingHtml2Text);

            describe(JsonType.Function, "markdown2Text(text)",
                     Resources.ScriptingMarkdown2Text);

            describe(JsonType.Function, "toCamelCase(text)",
                     Resources.ScriptingToCamelCase);

            describe(JsonType.Function, "toPascalCase(text)",
                     Resources.ScriptingToPascalCase);

            describe(JsonType.Function, "md5(text)",
                     Resources.ScriptingMD5);

            describe(JsonType.Function, "sha256(text)",
                     Resources.ScriptingSHA256);

            describe(JsonType.Function, "sha512(text)",
                     Resources.ScriptingSHA512);

            describe(JsonType.Function, "slugify(text)",
                     Resources.ScriptingSlugify);

            describe(JsonType.Function, "guid()",
                     Resources.ScriptingGuid);
        }
Exemplo n.º 3
0
        public void Describe(AddDescription describe, ScriptScope scope)
        {
            describe(JsonType.Function, "wordCount(text)",
                     Resources.ScriptingWordCount);

            describe(JsonType.Function, "characterCount(text)",
                     Resources.ScriptingCharacterCount);
        }
Exemplo n.º 4
0
        public void Describe(AddDescription describe, ScriptScope scope)
        {
            describe(JsonType.Function, "getReferences(ids, callback)",
                     Resources.ScriptingGetReferences);

            describe(JsonType.Function, "getReference(ids, callback)",
                     Resources.ScriptingGetReference);
        }
Exemplo n.º 5
0
        public void Describe(AddDescription describe, ScriptScope scope)
        {
            describe(JsonType.Function, "formatDate(data, pattern)",
                     Resources.ScriptingFormatDate);

            describe(JsonType.Function, "formatTime(text)",
                     Resources.ScriptingFormatTime);
        }
Exemplo n.º 6
0
        public void Describe(AddDescription describe, ScriptScope scope)
        {
            describe(JsonType.Function, "incrementCounter(name)",
                     Resources.ScriptingIncrementCounter);

            describe(JsonType.Function, "resetCounter(name, value)",
                     Resources.ScriptingResetCounter);
        }
Exemplo n.º 7
0
        public void Describe(AddDescription describe, ScriptScope scope)
        {
            describe(JsonType.Function, "getAssets(ids, callback)",
                     Resources.ScriptingGetAssets);

            describe(JsonType.Function, "getAsset(ids, callback)",
                     Resources.ScriptingGetAsset);

            describe(JsonType.Function, "getAssetText(asset, callback, encoding)",
                     Resources.ScriptingGetAssetText);
        }
Exemplo n.º 8
0
        public void Describe(AddDescription describe, ScriptScope scope)
        {
            if (!scope.HasFlag(ScriptScope.Async))
            {
                return;
            }

            describe(JsonType.Function, "getReferences(ids, callback)",
                     Resources.ScriptingGetReferences);

            describe(JsonType.Function, "getReference(ids, callback)",
                     Resources.ScriptingGetReference);
        }
Exemplo n.º 9
0
        public void AddSkill()

        {
            //initialize excel sheet by calling the ExcelLib
            GlobalDefinitions.ExcelLib.PopulateInCollection(Base.ExcelPath, "AddShareSkill");

            ShareSkillTab.Click();
            //GlobalDefinitions.wait(10);
            //wait for Title
            GlobalDefinitions.WaitForElement(GlobalDefinitions.driver, By.XPath("//input[@name='title']"), 10);
            AddTitle.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Title"));
            AddDescription.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Description"));
            AddCategory.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Category"));
            AddSubCategory.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Sub Category"));

            AddTags.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Tags"));
            //will perform the enter button's functionality
            enterBtn.SendKeys(Keys.Return).Perform();
            // AddTags.SendKeys(Keys.Enter);
            AddServiceOneOff.Click();
            AddLocationOnline.Click();
            AvailableStartDate.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Start Date"));
            AvailableEndDate.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "End Date"));

            AvailableDays.Click();
            AvailableStartTime.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Start Time"));
            AvailableEndTime.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "End Time"));
            TradeSKillExchange.Click();
            SKillExchangeTag.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Skill Exchange Tage"));
            //will perform the enter button's functionality
            enterBtn.SendKeys(Keys.Return).Perform();
            //Thread.Sleep(2000);
            //find work sample icon and click
            AddWorkSample.Click();
            Process.Start(@"V:\marsframework-master\marsframework-master\Upload.exe");

            // Uploading File path
            //var GetCurrentDirectory = Directory.GetCurrentDirectory();
            //String path = GetCurrentDirectory + @"\MarsFramework\Upload Files\Samplework.txt";
            //AddWorkSample.SendKeys(path);

            //AddWorkSample.SendKeys("file path");
            //GlobalDefinitions.wait(10);
            //Thread.Sleep(5000);
            SelectActive.Click();
            //Thread.Sleep(5000);
            SaveSkill.Click();
        }
Exemplo n.º 10
0
        public void Describe(AddDescription describe, ScriptScope scope)
        {
            describe(JsonType.Function, "getJSON(url, callback, ?headers)",
                     Resources.ScriptingGetJSON);

            describe(JsonType.Function, "postJSON(url, body, callback, ?headers)",
                     Resources.ScriptingPostJSON);

            describe(JsonType.Function, "putJSON(url, body, callback, ?headers)",
                     Resources.ScriptingPutJson);

            describe(JsonType.Function, "patchJSON(url, body, callback, headers)",
                     Resources.ScriptingPatchJson);

            describe(JsonType.Function, "deleteJSON(url, body, callback, headers)",
                     Resources.ScriptingDeleteJson);
        }
Exemplo n.º 11
0
        public void Describe(AddDescription describe, ScriptScope scope)
        {
            if (scope == ScriptScope.Transform)
            {
                describe(JsonType.Function, "replace()",
                         Resources.ScriptingReplace);
            }

            describe(JsonType.Function, "disallow()",
                     Resources.ScriptingDisallow);

            describe(JsonType.Function, "complete()",
                     Resources.ScriptingComplete);

            describe(JsonType.Function, "reject(reason)",
                     Resources.ScriptingReject);
        }
        void ReleaseDesignerOutlets()
        {
            if (AddButton != null)
            {
                AddButton.Dispose();
                AddButton = null;
            }

            if (AddProduct != null)
            {
                AddProduct.Dispose();
                AddProduct = null;
            }

            if (ResetButton != null)
            {
                ResetButton.Dispose();
                ResetButton = null;
            }

            if (ShuffleSwitch != null)
            {
                ShuffleSwitch.Dispose();
                ShuffleSwitch = null;
            }

            if (ViewTouched != null)
            {
                ViewTouched.Dispose();
                ViewTouched = null;
            }

            if (AddLabel != null)
            {
                AddLabel.Dispose();
                AddLabel = null;
            }

            if (AddDescription != null)
            {
                AddDescription.Dispose();
                AddDescription = null;
            }
        }
Exemplo n.º 13
0
        public void Describe(AddDescription describe, ScriptScope scope)
        {
            if (!scope.HasFlag(ScriptScope.Async))
            {
                return;
            }

            describe(JsonType.Function, "getAssets(ids, callback)",
                     Resources.ScriptingGetAssets);

            describe(JsonType.Function, "getAsset(ids, callback)",
                     Resources.ScriptingGetAsset);

            describe(JsonType.Function, "getAssetText(asset, callback, encoding?)",
                     Resources.ScriptingGetAssetText);

            describe(JsonType.Function, "getAssetBlurHash(asset, callback, x?, y?)",
                     Resources.ScriptingGetBlurHash);
        }
Exemplo n.º 14
0
 public IEnumerable Handle(AddDescription c)
 {
     if (!Created)
     {
         throw new PollNotCreated();
     }
     if (c.User != Owner)
     {
         throw new UnauthorizedUser();
     }
     if (Ended)
     {
         throw new PollAlreadyEnded();
     }
     yield return(new DescriptionAdded
     {
         Id = c.Id,
         Description = c.Description
     });
 }
Exemplo n.º 15
0
        public void EditExistingSkill()
        {
            //initialize excel sheet by calling the ExcelLib

            GlobalDefinitions.ExcelLib.PopulateInCollection(Base.ExcelPath, "EditSkill");

            ManageListinTab.Click();
            EditSkillIcon.Click();

            UpdateTitle.Clear();
            UpdateTitle.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Title"));
            AddDescription.Clear();
            AddDescription.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Description"));
            AddTags.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Tags"));
            enterBtn.SendKeys(Keys.Return).Perform();
            AvailableDays.Click();
            AvailableStartTime.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Start Time"));
            AvailableEndTime.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "End Time"));
            SaveSkill.Click();
            //GlobalDefinitions.WaitForElement(GlobalDefinitions.driver, By.XPath("//div[@class='ns-box ns-growl ns-effect-jelly ns-type-success ns-show']/div"), 10);
        }
        public void EnterMechanicBusinessAbsenceDetails()
        {
            if (NoneinMechanicAbsencePage.Selected)
            {
                CustomWait.FluentWaitbyXPath("addMechanicBusinessAbsenceBtn");
                addMechanicBusinessAbsenceBtn.Click();
                IJavaScriptExecutor js = (IJavaScriptExecutor)Drive.driver;
                js.ExecuteScript("document.getElementById('AbsenceStartDate').value ='20.3.2021 20:25'"); // id has been mentioned into the code of Start date field
                CustomWait.WaitFortheLoadingIconDisappear2000();
                js.ExecuteScript("document.getElementById('AbsenceEndDate').value ='21.3.2021 20:25'");   // id has been mentioned into the code of End date field
                CustomWait.WaitFortheLoadingIconDisappear2000();
                AddDescription.SendKeys("Business absence at Monday and Wednesday");
                Hardwareworking.Hover(saveMechanicBusinessAbsenceBtn);
                CustomWait.WaitFortheLoadingIconDisappear2000();
            }
            //else if(TypeWeeklyinMechanicAbsencePage.Selected)
            //{


            //}
        }
Exemplo n.º 17
0
        public async Task <ActionResult> AddDescription(AddDescription AddDescription)
        {
            var email = "";

            if (AddDescription.Descripton.Trim() != "")
            {
                var user = await UserManager.FindByEmailAsync(User.Identity.Name);

                var Brand      = db.Brand.FirstOrDefault(x => x.Id == AddDescription.BrandId);
                var Body       = db.Body.FirstOrDefault(x => x.Id == AddDescription.BodyId);
                var Generation = db.Generation.FirstOrDefault(x => x.Id == AddDescription.GenerationId);
                var Model      = db.Model.FirstOrDefault(x => x.Id == AddDescription.ModelId);
                var Motor      = db.Motor.FirstOrDefault(x => x.Id == AddDescription.MotorId);
                var model      = new RatingCar()
                {
                    Brand        = Brand,
                    Body         = Body,
                    Generation   = Generation,
                    Model        = Model,
                    Motor        = Motor,
                    Description  = AddDescription.Descripton,
                    UserId       = user.Id,
                    Conveniences = new Rating {
                        Type = "Conveniences", Value = 0
                    },
                    Failure = new Rating {
                        Type = "Failure", Value = 0
                    },
                    Maintenance = new Rating {
                        Type = "Maintenance", Value = 0
                    }
                };
                db.RatingCar.Add(model);
                db.SaveChanges();
                email = user.Email;
            }

            return(Json(email, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 18
0
        public void Describe(AddDescription describe, ScriptScope scope)
        {
            if (!scope.HasFlag(ScriptScope.Async))
            {
                return;
            }

            describe(JsonType.Function, "getJSON(url, callback, headers?)",
                     Resources.ScriptingGetJSON);

            describe(JsonType.Function, "postJSON(url, body, callback, headers?)",
                     Resources.ScriptingPostJSON);

            describe(JsonType.Function, "putJSON(url, body, callback, headers?)",
                     Resources.ScriptingPutJson);

            describe(JsonType.Function, "patchJSON(url, body, callback, headers?)",
                     Resources.ScriptingPatchJson);

            describe(JsonType.Function, "deleteJSON(url, body, callback, headers?)",
                     Resources.ScriptingDeleteJson);
        }
Exemplo n.º 19
0
        public void Describe(AddDescription describe, ScriptScope scope)
        {
            if (scope.HasFlag(ScriptScope.ContentTrigger) || scope.HasFlag(ScriptScope.AssetTrigger))
            {
                return;
            }

            if (scope.HasFlag(ScriptScope.Transform) || scope.HasFlag(ScriptScope.ContentScript))
            {
                describe(JsonType.Function, "replace()",
                         Resources.ScriptingReplace);
            }

            describe(JsonType.Function, "disallow(reason)",
                     Resources.ScriptingDisallow);

            describe(JsonType.Function, "reject(reason)",
                     Resources.ScriptingReject);

            describe(JsonType.Function, "complete()",
                     Resources.ScriptingComplete);
        }
Exemplo n.º 20
0
        public void Describe(AddDescription describe, ScriptScope scope)
        {
            if ((scope & ScriptScope.ContentTrigger) == ScriptScope.ContentTrigger)
            {
                describe(JsonType.Function, "contentAction",
                         Resources.ScriptingContentAction);

                describe(JsonType.Function, "contentUrl",
                         Resources.ScriptingContentUrl);
            }

            if ((scope & ScriptScope.AssetTrigger) == ScriptScope.AssetTrigger)
            {
                describe(JsonType.Function, "assetContentUrl",
                         Resources.ScriptingAssetContentUrl);

                describe(JsonType.Function, "assetContentAppUrl",
                         Resources.ScriptingAssetContentAppUrl);

                describe(JsonType.Function, "assetContentSlugUrl",
                         Resources.ScriptingAssetContentSlugUrl);
            }
        }
Exemplo n.º 21
0
        private void SAveAdd_Click(object sender, EventArgs e)
        {
            string query = ""; int AnnonceKey = ((KeyValuePair <int, string>)AnnonceCombo.SelectedItem).Key;
            String AnnounceValue = ((KeyValuePair <int, string>)AnnonceCombo.SelectedItem).Value;

            if (AddStafID.Text.Trim() == "")
            {
                MessageBox.Show("Please Enter Staff ID");
                AddStafID.Focus();
                return;
            }

            if (AnnonceKey < 1)
            {
                MessageBox.Show("Please Enter Announce Type");
                AnnonceCombo.Focus();
                return;
            }
            if (AddDate.Text == "")
            {
                MessageBox.Show("Please Enter Announce Date");
                AddDate.Focus();
                return;
            }


            if (Addsubject.Text.Trim() == "")
            {
                MessageBox.Show("Please Enter Subject");
                Addsubject.Focus();
                return;
            }
            if (AddDescription.Text.Trim() == "")
            {
                MessageBox.Show("Please  Add Description ");
                AddDescription.Focus();
                return;
            }

            try
            {
                if (hidebox.Text == "")
                {
                    query = "INSERT INTO Announcement_Info(StaffID,AnnounceType,Date,Subject,Description) VALUES(" + Convert.ToInt32(AddStafID.Text) + ",  '" + AnnounceValue + "',  '" + AddDate.Value.ToString("yyyy/MM/dd") + "', '" + Addsubject.Text + "', '" + AddDescription.Text + "' )";
                }


                else
                {
                    query = "UPDATE Announcement_Info SET AnnounceType = '" + AnnounceValue + "', Date = '" + AddDate.Text + "', Subject= '" + Addsubject.Text + "',Description = '" + Addsubject.Text + "' WHERE Id = " + Convert.ToInt32(hidebox.Text);
                }

                if (DbAccess.ExecuteToDB(query))
                {
                    if (hidebox.Text == "")
                    {
                        MessageBox.Show("Saved Successfully!!!");
                    }
                    else
                    {
                        MessageBox.Show("Updated Successfully!!!");
                    }
                }
                else
                {
                    MessageBox.Show("Failed To Save!!!");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Connection Error!!!");
            }
            finally
            {
                Reset();
            }
        }