private void editdesbutton_Click(object sender, RoutedEventArgs e)
        {
            EditDescription edes = new EditDescription(bolayer, currentTaskid, tasknow.description);

            edes.ShowDialog();
            bolayer.load_task_form_server();
        }
Exemple #2
0
        public RowItem CommitAddNew(RowItem rowItem)
        {
            var listItem = rowItem.Value as ListItem;

            if (listItem == null)
            {
                return(null);
            }
            var values = ((ListItem.NewRecordData)listItem.GetRecord()).UncommittedValues;

            if (values.Count == 0)
            {
                return(null);
            }
            ListItemId?listItemId = null;

            SkylineDataSchema.ModifyDocument(EditDescription.Message(ListRef.PROTOTYPE.ChangeName(ListName), string.Format(Resources.ListViewContext_CommitAddNew_Add_new_item_to_list___0__, ListName)), doc =>
            {
                var listData = doc.Settings.DataSettings.FindList(ListName);
                ListItemId newItemId;
                listData   = listData.AddRow(((ListItem.NewRecordData)listItem.GetRecord()).UncommittedValues, out newItemId);
                listItemId = newItemId;
                return(doc.ChangeSettings(
                           doc.Settings.ChangeDataSettings(doc.Settings.DataSettings.ReplaceList(listData))));
            }, AuditLogEntry.SettingsLogFunction);
            if (!listItemId.HasValue)
            {
                return(null);
            }
            return(new RowItem(ConstructListItem(listItemId.Value)));
        }
Exemple #3
0
        internal void EditProfile()
        {
            //Populate the Excel Sheet
            GlobalDefinitions.ExcelLib.PopulateInCollection(Base.ExcelPath, "Profile");
            Thread.Sleep(1000);

            // Click the write icon of Availability
            AvailablityIcon.Click();
            // Select the Availability
            AvailablityType.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "AvailableTime"));
            Base.test.Log(LogStatus.Info, "Availability updated");

            //Click on Hours write icon
            HoursIcon.Click();
            Thread.Sleep(1500);
            Hours.SendKeys(Keys.ArrowDown + Keys.Enter);

            //Click on EarnTarget write icon
            EarnTargetIcon.Click();
            //Availability Hours option
            //EarnTarget.SendKeys(Keys.ArrowDown + Keys.ArrowDown + Keys.Enter);
            EarnTarget.SendKeys("More than $1000 per month");

            //Click on Discription Edit button
            EditDescription.Click();
            //Add Description
            Description.Clear();
            Thread.Sleep(1000);
            Description.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Description"));
            Save.Click();
            Assert.That(Description != null);
            Base.test.Log(LogStatus.Info, "Added Description successfully");
        }
Exemple #4
0
 protected void ModifyDocument(EditDescription editDescription, Func<SrmDocument, SrmDocument> action)
 {
     var skylineWindow = DataSchema.SkylineWindow;
     if (skylineWindow == null)
     {
         throw new InvalidOperationException();
     }
     skylineWindow.ModifyDocument(editDescription.GetUndoText(DataSchema.DataSchemaLocalizer), action);
 }
        protected void ModifyDocument(EditDescription editDescription, Func <SrmDocument, SrmDocument> action)
        {
            var skylineWindow = DataSchema.SkylineWindow;

            if (skylineWindow == null)
            {
                throw new InvalidOperationException();
            }
            skylineWindow.ModifyDocument(editDescription.GetUndoText(DataSchema.DataSchemaLocalizer), action);
        }
Exemple #6
0
        //Enter the Description in Profile Section
        internal void AddDescription()
        {
            EditDescription.Click();
            Thread.Sleep(1000);
            EnterDescription.Clear();
            EnterDescription.SendKeys(ExcelLib.ReadData(2, "Description"));
            SaveDescription.Click();
            Base.Image = SaveScreenShotClass.SaveScreenshot(Driver, "Report");

            //Validate message
            Extension.MessageValidation("Description has been saved successfully");
        }
Exemple #7
0
 public void ChangeChromatogramSet(EditDescription editDescription, ChromatogramSet chromatogramSet)
 {
     ModifyDocument(editDescription.ChangeElementRef(GetElementRef()), document =>
     {
         var measuredResults           = document.Settings.MeasuredResults;
         var chromatograms             = measuredResults.Chromatograms.ToArray();
         chromatograms[ReplicateIndex] = chromatogramSet;
         measuredResults = measuredResults.ChangeChromatograms(chromatograms);
         return(document.ChangeMeasuredResults(measuredResults));
     }
                    );
 }
Exemple #8
0
        //Edit Earn Target on the Profile page
        public void EditdescriptionOnProfile(string description)
        {
            //Click on EditDescription icon
            driver.WaitForElementIsVisible(EditDescription);
            EditDescription.Click();

            //Enter Description based on Excel data
            Description.Clear();
            Description.SendKeys(description);

            //Click on save button to save the description
            SaveButton.Click();
        }
Exemple #9
0
        public override void SetAnnotation(AnnotationDef annotationDef, object value)
        {
            // Ignore setting of the old q value and mProphet score annoations. They are
            // displayed for backward compatibility. Setting them manually never made and sense.
            if (Equals(annotationDef.Name, MProphetResultsHandler.AnnotationName) ||
                Equals(annotationDef.Name, MProphetResultsHandler.MAnnotationName))
            {
                return;
            }

            ChangeChromInfo(EditDescription.SetAnnotation(annotationDef, value),
                            chromInfo => chromInfo.ChangeAnnotations(chromInfo.Annotations.ChangeAnnotation(annotationDef, value)));
        }
        private void EditDescription_Click(object sender, RoutedEventArgs e)
        {
            MenuItem        mi    = sender as MenuItem;
            int             index = ListViewImages.Items.IndexOf(mi.DataContext);
            EditDescription edit  = new EditDescription(this.album.MediaFiles[index].Description);

            edit.ShowDialog();
            if (edit.DialogResult == true)
            {
                this.album.MediaFiles[index].Description = edit.GetNewDescription();
                ListViewImages.Items.Refresh();
                SerializationHelper.Serialize(albumManager);
            }
        }
        private void SubmitEdits_Click(object sender, RoutedEventArgs e)
        {
            if (!string.IsNullOrWhiteSpace(EditName.Text) && !string.IsNullOrWhiteSpace(EditDescription.Text) && !string.IsNullOrWhiteSpace(EditPrice.Text) && !string.IsNullOrWhiteSpace(EditQuantity.Text))
            {
                try
                {
                    connection.Open();

                    MySqlCommand cmd = new MySqlCommand();
                    cmd.CommandText = "update items set ITEM_NAME=@ItemName,ITEM_PRICE=@ItemPrice,ITEM_DESCRIPTION=@ItemDescription,ITEM_QUANTATY=@ItemQuantity where ITEM_ID=@ItemId";
                    cmd.Parameters.AddWithValue("@ItemName", EditName.Text);
                    cmd.Parameters.AddWithValue("@ItemPrice", EditPrice.Text);
                    cmd.Parameters.AddWithValue("@ItemDescription", EditDescription.Text);
                    cmd.Parameters.AddWithValue("@ItemQuantity", EditQuantity.Text);
                    cmd.Parameters.AddWithValue("@ItemId", EditId.Text);
                    cmd.Connection = connection;
                    cmd.ExecuteNonQuery();
                    MySqlCommand Com = new MySqlCommand("Select * from items ", connection);

                    MySqlDataAdapter adp = new MySqlDataAdapter(Com);
                    DataSet          ds  = new DataSet();
                    adp.Fill(ds, "LoadDataBinding");
                    EditDataGrid.DataContext = ds;
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.ToString());
                }
                finally
                {
                    connection.Close();
                    MessageBox.Show("Successfully updated", "Success");
                    EditName.Clear();
                    EditDescription.Clear();
                    EditPrice.Clear();
                    EditQuantity.Clear();
                    EditId.Clear();
                }
            }
            else
            {
                MessageBox.Show("Cannot Edit Empty Row ", "ERROR");
            }
        }
        private void DeleteEdits_Click(object sender, RoutedEventArgs e)
        {
            if (!string.IsNullOrWhiteSpace(EditName.Text) && !string.IsNullOrWhiteSpace(EditDescription.Text) && !string.IsNullOrWhiteSpace(EditPrice.Text) && !string.IsNullOrWhiteSpace(EditQuantity.Text))
            {
                MessageBoxResult choice = MessageBox.Show("delete selected item ?", "confirmation", MessageBoxButton.YesNo);
                if (choice == MessageBoxResult.Yes)
                {
                    try
                    {
                        connection.Open();
                        MySqlCommand cmd = new MySqlCommand("delete from items where ITEM_ID='" + int.Parse(EditId.Text) + "'", connection);
                        cmd.ExecuteNonQuery();
                        MySqlCommand Com = new MySqlCommand("Select * from items ", connection);

                        MySqlDataAdapter adp = new MySqlDataAdapter(Com);
                        DataSet          ds  = new DataSet();
                        adp.Fill(ds, "LoadDataBinding");
                        EditDataGrid.DataContext = ds;
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.ToString());
                    }
                    finally
                    {
                        connection.Close();
                        EditId.Clear();
                        EditName.Clear();
                        EditQuantity.Clear();
                        EditPrice.Clear();
                        EditDescription.Clear();
                        MessageBox.Show("item deleted", "confirmed");
                    }
                }
            }
            else
            {
                MessageBox.Show("Select a row to delete", "ERROR");
            }
        }
Exemple #13
0
        public override void Delete()
        {
            var selectedItems = GetSelectedListItems(BoundDataGridView);

            if (selectedItems.Count == 0)
            {
                return;
            }
            string message = string.Format(Resources.ListViewContext_Delete_Are_you_sure_you_want_to_delete_the__0__selected_items_from_the_list___1___, selectedItems.Count, ListName);

            if (MultiButtonMsgDlg.Show(BoundDataGridView, message, MultiButtonMsgDlg.BUTTON_OK) != DialogResult.OK)
            {
                return;
            }
            SkylineDataSchema.ModifyDocument(EditDescription.Message(ListRef.PROTOTYPE.ChangeName(ListName), string.Format(Resources.ListViewContext_Delete_Delete_from_list___0__, ListName)),
                                             doc =>
            {
                var listData = doc.Settings.DataSettings.FindList(ListName);
                listData     = listData.DeleteItems(selectedItems);
                return(doc.ChangeSettings(
                           doc.Settings.ChangeDataSettings(doc.Settings.DataSettings.ReplaceList(listData))));
            }, AuditLogEntry.SettingsLogFunction);
        }
Exemple #14
0
        //Enter the Description in Profile Section
        internal void AddDescription()
        {
            //Clicking on Edit button
            GenericWait.ElementIsVisible(GlobalDefinitions.driver, "XPath", "//h3[text()='Description']//i[@class='outline write icon']", 6);
            EditDescription.Click();
            Thread.Sleep(1000);

            //Clearing the description textarea if any text already existing
            GenericWait.ElementIsVisible(GlobalDefinitions.driver, "XPath", "//textarea[@name='value']", 6);
            DescriptionTextBox.Clear();

            //Entering new description
            GenericWait.ElementIsVisible(GlobalDefinitions.driver, "XPath", "//textarea[@name='value']", 6);
            DescriptionTextBox.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "ProfileDescription"));

            //Clicking on Save button
            GenericWait.ElementIsVisible(GlobalDefinitions.driver, "XPath", "//h3[text()='Description']/../..//button[text()='Save']", 6);
            SaveDescription.Click();
            string img = SaveScreenShotClass.SaveScreenshot(GlobalDefinitions.driver, "Profile Description");

            //Validate message
            GlobalDefinitions.MessageValidation("Description has been saved successfully");
        }
Exemple #15
0
 public void ChangeChromatogramSet(EditDescription editDescription, ChromatogramSet chromatogramSet)
 {
     ModifyDocument(editDescription, document =>
         {
             var measuredResults = document.Settings.MeasuredResults;
             var chromatograms = measuredResults.Chromatograms.ToArray();
             chromatograms[ReplicateIndex] = chromatogramSet;
             measuredResults = measuredResults.ChangeChromatograms(chromatograms);
             return document.ChangeMeasuredResults(measuredResults);
         }
     );
 }
Exemple #16
0
        public void ChangeChromInfo(EditDescription editDescription, TransitionGroupChromInfo newChromInfo)
        {
            var newDocNode = Precursor.DocNode.ChangeResults(GetResultFile().ChangeChromInfo(Precursor.DocNode.Results, newChromInfo));

            Precursor.ChangeDocNode(editDescription, newDocNode);
        }
Exemple #17
0
 protected void ModifyDocument(EditDescription editDescription, Func <SrmDocument, SrmDocument> action)
 {
     DataSchema.ModifyDocument(editDescription, action);
 }
Exemple #18
0
        async void SaveCommandExecuted()
        {
            if (IsBusy)
            {
                return;
            }

            var update = await _userDialogs.ConfirmAsync("Update Group?", Group.Name, "Yes", "No");

            if (!update)
            {
                return;
            }

            EditName        = EditName.Trim();
            EditDescription = EditDescription.Trim();

            if (string.IsNullOrWhiteSpace(EditName))
            {
                await _userDialogs.AlertAsync("Enter a name", "Invalid Name", "Ok");

                return;
            }
            if (string.IsNullOrWhiteSpace(EditImageUrl) || !Uri.IsWellFormedUriString(EditImageUrl, UriKind.Absolute))
            {
                var res = await _userDialogs.ConfirmAsync("No group picture, do you want to continue without?", "Group Picture", "Yes", "No");

                if (!res)
                {
                    return;
                }
            }

            IsBusy = true;
            _userDialogs.ShowLoading();

            var wallet = _walletManager.Wallet;

            // Set Name
            var pendingId = await _tokenMessagesQueue.AddAsync(
                wallet.Address,
                Group.TronAddress,
                new ChangeGroupNameTokenMessage { Name = wallet.Encrypt(EditName, AppConstants.PropertyAddressPublicKey) }
                );

            // Set Description
            await _tokenMessagesQueue.AddAsync(
                wallet.Address,
                Group.TronAddress,
                new ChangeGroupDescriptionTokenMessage { Description = wallet.Encrypt(EditDescription, AppConstants.PropertyAddressPublicKey) });

            // Set Image if exist
            var existImage = _walletManager.Wallet.ProfileImageUrl != null && Uri.IsWellFormedUriString(EditImageUrl, UriKind.Absolute);
            await _tokenMessagesQueue.AddAsync(
                wallet.Address,
                Group.TronAddress,
                new ChangeGroupImageTokenMessage
            {
                Clear    = !existImage,
                ImageUrl = existImage ? wallet.Encrypt(EditImageUrl, AppConstants.PropertyAddressPublicKey) : null
            });

            var result = await _tokenMessagesQueue.WaitForAsync(pendingId);


            await _navigationService.GoBackAsync();

            _userDialogs.HideLoading();
            await _userDialogs.AlertAsync("Group edit is pending and will be updated shortly", "Group Edit");

            IsBusy = false;
        }
Exemple #19
0
 public override void SetAnnotation(AnnotationDef annotationDef, object value)
 {
     ChangeChromatogramSet(EditDescription.SetAnnotation(annotationDef, value),
                           ChromatogramSet.ChangeAnnotations(ChromatogramSet.Annotations.ChangeAnnotation(annotationDef, value)));
 }
Exemple #20
0
 public override void SetAnnotation(AnnotationDef annotationDef, object value)
 {
     ChangeChromInfo(EditDescription.SetAnnotation(annotationDef, value),
                     chromInfo => chromInfo.ChangeAnnotations(chromInfo.Annotations.ChangeAnnotation(annotationDef, value)));
 }
 public void ChangeChromInfo(EditDescription editDescription, TransitionGroupChromInfo newChromInfo)
 {
     var newDocNode = Precursor.DocNode.ChangeResults(GetResultFile().ChangeChromInfo(Precursor.DocNode.Results, newChromInfo));
     Precursor.ChangeDocNode(editDescription, newDocNode);
 }
Exemple #22
0
 protected void ModifyDocument(EditDescription editDescription, Func <SrmDocument, SrmDocument> action, Func <SrmDocumentPair, AuditLogEntry> logFunc = null)
 {
     DataSchema.ModifyDocument(editDescription, action, logFunc);
 }
 public void ChangeChromInfo(EditDescription editDescription, TransitionChromInfo newChromInfo)
 {
     var newDocNode = Transition.DocNode.ChangeResults(GetResultFile().ChangeChromInfo(Transition.DocNode.Results, newChromInfo));
     Transition.ChangeDocNode(editDescription, newDocNode);
 }
Exemple #24
0
        //Edit a Property
        internal void EditProperty()
        {
            Global.ExcelLib.PopulateInCollection(Config.PropertyManagementResource.ExcelPath, "Property");
            //Explicit Wait
            Thread.Sleep(1000);
            //Click on Owners tab
            Owners.Click();
            //Click Properties option
            Properties.Click();
            // Explicit Wait
            Thread.Sleep(1000);
            // Click on the menu
            menulink.Click();
            // Explicit Wait
            Thread.Sleep(1000);
            //Click on Edit Button
            EditBtn.Click();
            Thread.Sleep(500);
            //Modify Property Name
            EditPropertyName.Clear();
            EditPropertyName.SendKeys(Global.ExcelLib.ReadData(2, "PropertyName_Modified"));
            EditDescription.Clear();
            EditDescription.SendKeys(Global.ExcelLib.ReadData(2, "Description_Modified"));
            Thread.Sleep(1000);
            EditCar.SendKeys(Global.ExcelLib.ReadData(2, "Car_Modified"));
            Thread.Sleep(1000);
            // Approach 1 to upload file
            ChooseFilesbtn.SendKeys(@"C:\Users\Shahabuddin\Desktop\Rumana\house1_image.png");
            Thread.Sleep(1000);

            /*
             * //File Upload Approach2: AutoIt- Handles windows that do not belong to browser
             * FileUploadbtn.Click();
             * AutoItX3 AutoIt = new AutoItX3();
             * AutoIt.ControlFocus("Open", "", "Edit1");
             * Thread.Sleep(2000);
             * AutoIt.ControlSetText("Open", "", "Edit1", @"C:\Users\Shahabuddin\Desktop\Rumana\Afraz.jpg");
             * Thread.Sleep(1000);
             * AutoIt.ControlClick("Open", "", "Button1");
             */
            EditSaveBtn.Click();
            //Verification
            //Click on Owners tab
            Owners.Click();
            //Click Properties option
            Properties.Click();
            string msg2    = Global.GlobalDefinition.driver.FindElement(By.XPath("//*[@id='main-content']/section/div[1]/div/div[3]/div/div[1]/div[2]/div[1]/div[1]/a/h3")).Text;
            string Actmsg2 = Global.ExcelLib.ReadData(2, "EditPropertyVerification");

            Thread.Sleep(2000);
            if (msg2 == Actmsg2)
            {
                Thread.Sleep(200);
                Global.Base.test.Log(LogStatus.Pass, "Test Passed, Record has been updated successfully");
                Global.SaveScreenShotClass.SaveScreenshot(Global.GlobalDefinition.driver, "PropertyListEdited");
            }

            else
            {
                Thread.Sleep(200);
                Global.Base.test.Log(LogStatus.Pass, "Test Failed, Record has not updated");
            }
        }
Exemple #25
0
 public void ChangeChromInfo(EditDescription editDescription, Func <TransitionChromInfo, TransitionChromInfo> newChromInfo)
 {
     Transition.ChangeDocNode(editDescription, docNode => docNode.ChangeResults(GetResultFile().ChangeChromInfo(docNode.Results, newChromInfo)));
 }
        public void ChangeChromInfo(EditDescription editDescription, TransitionChromInfo newChromInfo)
        {
            var newDocNode = Transition.DocNode.ChangeResults(GetResultFile().ChangeChromInfo(Transition.DocNode.Results, newChromInfo));

            Transition.ChangeDocNode(editDescription, newDocNode);
        }