示例#1
0
        private void gridPosition_RowEditEnded(object sender, GridViewRowEditEndedEventArgs e)
        {
            if (e.EditAction == GridViewEditAction.Cancel)
            {
                return;
            }
            if (e.EditOperationType == GridViewEditOperationType.Insert)
            {
                try
                {
                    db.SaveChanges();
                    binddatagrid();
                }
                catch { MessageBox.Show("Invalid"); }
            }
            else if (e.EditOperationType == GridViewEditOperationType.Edit)
            {
                try
                {
                    foreach (var data in gridPosition.SelectedItems)
                    {
                        t_Position myData = data as t_Position;
                        code = myData.Code;
                        desc = myData.Description;

                        t_Position pos = db.t_Position.First(p => p.DeptCode == Department.SelectedValue.ToString() && p.Code == code);
                        pos.Description = desc;

                        db.SaveChanges();
                        binddatagrid();
                    }
                }
                catch { }
            }
        }
示例#2
0
 private void DataGrid_RowEditEnded(object sender, GridViewRowEditEndedEventArgs e)
 {
     NameColumn.IsReadOnly      = true;
     CaseColumn.IsReadOnly      = true;
     SegmentColumn.IsReadOnly   = true;
     ReservoirColumn.IsReadOnly = true;
 }
示例#3
0
        private void gridShuttleDestination_RowEditEnded(object sender, GridViewRowEditEndedEventArgs e)
        {
            if (e.EditAction == GridViewEditAction.Cancel)
            {
                return;
            }
            if (e.EditOperationType == GridViewEditOperationType.Insert)
            {
                try
                {
                    db.SaveChanges();
                    binddatagrid();
                }
                catch { MessageBox.Show("Invalid"); }
            }
            else if (e.EditOperationType == GridViewEditOperationType.Edit)
            {
                try
                {
                    foreach (var data in gridShuttleDestination.SelectedItems)
                    {
                        t_ShuttleDestination myData = data as t_ShuttleDestination;
                        destid = myData.DestinationID;
                        destin = myData.Destination;

                        t_ShuttleDestination dest = db.t_ShuttleDestination.First(p => p.DestinationID == destid);
                        dest.Destination = destin;
                        db.SaveChanges();
                        binddatagrid();
                    }
                }
                catch { }
            }
        }
示例#4
0
        private void gridDepartment_RowEditEnded(object sender, GridViewRowEditEndedEventArgs e)
        {
            if (e.EditAction == GridViewEditAction.Cancel)
            {
                return;
            }
            if (e.EditOperationType == GridViewEditOperationType.Insert)
            {
                try
                {
                    db.SaveChanges();
                    binddatagrid();
                }
                catch { MessageBox.Show("already exist"); }
            }
            else if (e.EditOperationType == GridViewEditOperationType.Edit)
            {
                try
                {
                    foreach (var data in gridDepartment.SelectedItems)
                    {
                        t_Department myData = data as t_Department;
                        deptcode = myData.DeptCode;
                        depdesc  = myData.DeptName;

                        t_Department dept = db.t_Department.First(p => p.DeptCode == deptcode);
                        dept.DeptName = depdesc;
                        db.SaveChanges();
                        binddatagrid();
                    }
                }
                catch { }
            }
        }
示例#5
0
        private void OnRowEditEndedExecuted(object obj)
        {
            GridViewRowEditEndedEventArgs e = obj as GridViewRowEditEndedEventArgs;

            BookmarkViewModel bookmarkViewModel = e.NewData as BookmarkViewModel;

            if (e.EditAction == GridViewEditAction.Cancel)
            {
                return;
            }
            else if (e.EditOperationType == GridViewEditOperationType.Insert)
            {
                RadFixedPage page = this.document.Pages[bookmarkViewModel.PageNumber - 1];
                bookmarkViewModel.UpdateBookmarkItem(page);

                this.document.Bookmarks.Add(bookmarkViewModel.BookmarkItem);
            }
            else if (e.EditOperationType == GridViewEditOperationType.Edit)
            {
                RadFixedPage page = this.document.Pages[bookmarkViewModel.PageNumber - 1];

                BookmarkViewModel viewModel = e.EditedItem as BookmarkViewModel;
                viewModel.UpdateBookmarkItem(page);
            }
        }
示例#6
0
        private void gridView_RowEditEnded(object sender, GridViewRowEditEndedEventArgs e)
        {
            if (e.EditAction == GridViewEditAction.Cancel)
            {
                e.UserDefinedErrors.Clear();

                return;
            }
        }
 /// <summary>
 /// Row-Edit ended event of DataGrid
 /// </summary>
 /// <param name="sender">Sender of the Event</param>
 /// <param name="e">Event Arguement</param>
 private void dgDCFSummary_RowEditEnded(object sender, GridViewRowEditEndedEventArgs e)
 {
     if (MinorityInvestment != null)
     {
         if (MinorityInvestment != "")
         {
             this.DataContextSource.MinorityInvestments = Convert.ToDecimal(MinorityInvestment);
         }
     }
 }
 /// <summary>
 /// Event that occurs after the Editing is completed
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void dgDCFAnalysisSummary_RowEditEnded(object sender, GridViewRowEditEndedEventArgs e)
 {
     if (stockSpecificDiscount != null)
     {
         if (stockSpecificDiscount != "")
         {
             this.DataContextSource.StockSpecificDiscount = Convert.ToDecimal(stockSpecificDiscount);
         }
     }
 }
示例#9
0
        private void DataGrid_RowEditEnded(object sender, GridViewRowEditEndedEventArgs e)
        {
            //NameColumn.IsReadOnly = true;
            //IndiceIniColumn.IsReadOnly = true;
            //IndiceFinColumn.IsReadOnly = true;

            NameColumn.IsReadOnly      = false;
            IndiceIniColumn.IsReadOnly = false;
            IndiceFinColumn.IsReadOnly = false;
        }
示例#10
0
 private void gvData_RowEditEnded(object sender, GridViewRowEditEndedEventArgs e)
 {
     if (e.EditOperationType.ToString() == "Insert")
     {
         DataRowView row = (DataRowView)e.Row.Item;
         Datos       dt  = new Datos();
         dt.GuardarCatNewRow(row, cmbCatalogos.Text);
     }
     else
     {
     }
 }
示例#11
0
        private void DataGrid_RowEditEnded(object sender, GridViewRowEditEndedEventArgs e)
        {
            //NameColumn.IsReadOnly = true;
            //BlockColumn.IsReadOnly = true;
            //ReductionFactor.IsReadOnly = true;
            //Case.IsReadOnly = true;
            //Id.IsReadOnly = true;

            CurrentColumn              = NameColumn;
            NameColumn.IsReadOnly      = false;
            BlockColumn.IsReadOnly     = false;
            ReductionFactor.IsReadOnly = false;
            Case.IsReadOnly            = false;
            Id.IsReadOnly              = false;
        }
        private void gridDependent_RowEditEnded(object sender, GridViewRowEditEndedEventArgs e)
        {
            if (e.EditAction == GridViewEditAction.Cancel)
            {
                return;
            }
            if (e.EditOperationType == GridViewEditOperationType.Insert)
            {
                try
                {
                    db.SaveChanges();
                    bindDependents();
                }
                catch { }
            }
            else if (e.EditOperationType == GridViewEditOperationType.Edit)
            {
                // try
                //{
                int ss = 0;

                foreach (var data in gridDependent.SelectedItems)
                {
                    t_EmpDependents myData = data as t_EmpDependents;
                    depName         = myData.Name;
                    depBirthDate    = Convert.ToString(myData.BirthDate);
                    depRelationship = myData.Relationship;
                    depOccupation   = myData.Occupation;
                    depMaidenName   = myData.MaidenName;
                    ss = Convert.ToInt32(myData.DependentID);
                }

                var dep = db.t_EmpDependents.Where(x => x.DependentID == ss).FirstOrDefault();

                dep.BirthDate    = Convert.ToDateTime(depBirthDate);
                dep.Relationship = depRelationship;
                dep.Occupation   = depOccupation;
                dep.MaidenName   = depMaidenName;

                db.Entry(dep).State = EntityState.Modified;

                db.SaveChanges();

                bindDependents();
                // }
                //catch { }
            }
        }
        private void gridWorkExp_RowEditEnded(object sender, GridViewRowEditEndedEventArgs e)
        {
            if (e.EditAction == GridViewEditAction.Cancel)
            {
                return;
            }
            if (e.EditOperationType == GridViewEditOperationType.Insert)
            {
                try
                {
                    db.SaveChanges();
                    bindWorkExp();
                }
                catch { }
            }
            else if (e.EditOperationType == GridViewEditOperationType.Edit)
            {
                try
                {
                    foreach (var data in gridWorkExp.SelectedItems)
                    {
                        t_TempEmpWorkExp myData = data as t_TempEmpWorkExp;
                        compName     = myData.CompanyName;
                        compAddress  = myData.CompanyAddress;
                        compPosition = myData.Position;
                        compFrom     = Convert.ToString(myData.DateFrom);
                        compTo       = Convert.ToString(myData.DateTo);


                        t_TempEmpWorkExp workexp = db.t_TempEmpWorkExp.First(p => p.EmpID == adminusers.Text);
                        workexp.CompanyName    = compName;
                        workexp.CompanyAddress = compAddress;
                        workexp.Position       = compPosition;
                        workexp.DateFrom       = Convert.ToDateTime(compFrom);
                        workexp.DateTo         = Convert.ToDateTime(compTo);

                        db.SaveChanges();
                        bindWorkExp();
                    }
                }
                catch { }
            }
        }
示例#14
0
        private void gridUsers_RowEditEnded(object sender, GridViewRowEditEndedEventArgs e)
        {
            if (e.EditAction == GridViewEditAction.Cancel)
            {
                return;
            }
            if (e.EditOperationType == GridViewEditOperationType.Insert)
            {
                try
                {
                    db.SaveChanges();
                    binddatagrid();
                }
                catch { MessageBox.Show("already exist"); }
            }
            else if (e.EditOperationType == GridViewEditOperationType.Edit)
            {
                try
                {
                    foreach (var data in gridUsers.SelectedItems)
                    {
                        t_Users myData = data as t_Users;
                        uid   = myData.userid;
                        uname = myData.username;
                        upass = myData.userpass;
                        utype = myData.usertype;

                        t_Users us = db.t_Users.First(p => p.userid == uid);
                        us.username = uname;
                        us.userpass = upass;
                        us.usertype = utype;
                        db.SaveChanges();
                        binddatagrid();
                    }
                }
                catch { }
            }
        }
        private void RadGridView_CellEditEnded(object sender, GridViewRowEditEndedEventArgs gridViewRowEditEndedEventArgs)
        {
            var frameworkElement = sender as FrameworkElement;
            var orderViewModel   = frameworkElement?.DataContext as OrderViewModel;

            if (orderViewModel is SparePartsOrderViewModel)
            {
                var spareParts = orderViewModel as SparePartsOrderViewModel;
                if (spareParts.SelectedOrderPosition.Received &&
                    string.IsNullOrEmpty(spareParts.SelectedOrderPosition.StoragePlace))
                {
                    System.Windows.MessageBox.Show(Properties.Resources.StoragePlaceNotSpecifiedText);
                    //var grid = sender as RadGridView;
                    //grid.CurrentColumn = grid.Columns[5];
                    return;
                }
            }

            if (orderViewModel != null)
            {
                orderViewModel.SaveChanges();
            }
        }
        private void gridDependent_RowEditEnded(object sender, GridViewRowEditEndedEventArgs e)
        {
            if (e.EditAction == GridViewEditAction.Cancel)
            {
                return;
            }
            if (e.EditOperationType == GridViewEditOperationType.Insert)
            {
                try
                {
                    db.SaveChanges();
                    bindDependents();
                }
                catch { }
            }
            else if (e.EditOperationType == GridViewEditOperationType.Edit)
            {
                try
                {
                    foreach (var data in gridDependent.SelectedItems)
                    {
                        t_TempEmpDependents myData = data as t_TempEmpDependents;
                        depName         = myData.Name;
                        depBirthDate    = Convert.ToString(myData.BirthDate);
                        depRelationship = myData.Relationship;
                        depOccupation   = myData.Occupation;
                        depMaidenName   = myData.MaidenName;

                        t_TempEmpDependents dep = db.t_TempEmpDependents.First(p => p.EmpID == adminusers.Text);
                        dep.Name         = depName;
                        dep.BirthDate    = Convert.ToDateTime(depBirthDate);
                        dep.Relationship = depRelationship;
                        dep.Occupation   = depOccupation;
                        dep.MaidenName   = depMaidenName;

                        db.SaveChanges();
                        bindDependents();
                    }
                }
                catch { }
            }



            ////try
            ////{
            //foreach (var data in gridDependent.SelectedItems)
            //{
            //    //t_TempEmpDependents myData = data as t_TempEmpDependents;
            //    //depName = myData.Name;
            //    ////depBirthDate = Convert.ToString(myData.BirthDate);
            //    //depRelationship = myData.Relationship;
            //    //depOccupation = myData.Occupation;
            //    //depMaidenName = myData.MaidenName;

            //    t_TempEmpDependents dep = db.t_TempEmpDependents.First(p => p.EmpID == adminusers.Text);
            //    dep.Name = depName;
            //    //dep.BirthDate = Convert.ToDateTime(depBirthDate);
            //    dep.Relationship = depRelationship;
            //    dep.Occupation = depOccupation;
            //    dep.MaidenName = depMaidenName;
            //    db.SaveChanges();

            //}
            ////}
            ////catch { }
        }
 public void CatalogItemPriorityEndEditEvent(object sender, GridViewRowEditEndedEventArgs e)
 {
     AssistantCatalogItemPriorityMode = (int)AssistantViewMode.ReadOnly;
     NotifyOfPropertyChange(() => AssistantCatalogItemPriorityMode);
     NotifyOfPropertyChange(() => CatalogItemPriorityCount);
 }
 void RadGridView_RowEditEnded(object sender, GridViewRowEditEndedEventArgs e)
 {
     this.CommandRow.Template = this.ViewCommandTemplate;
 }
 void gvwOrganisations_RowEditEnded(object sender, GridViewRowEditEndedEventArgs e)
 {
     gvwOrganisations_SelectionChanged(null, null);
 }
示例#20
0
        private void gridView_RowEditEnded(object sender, GridViewRowEditEndedEventArgs e)
        {
            Pais newPais = null;

            if (e.EditAction == GridViewEditAction.Cancel)
            {
                e.UserDefinedErrors.Clear();

                return;
            }

            if (e.EditOperationType == GridViewEditOperationType.Insert)
            {
                //Add the new entry to the data base.
                //this.radGridView1.SelectedRows[0].Cells["Picture Name"].Value;

                GridViewRow row = e.Row;
                if (e.Row is GridViewNewRow)
                {
                    newPais = e.NewData as Pais;
                    if (newPais == null)
                    {
                        return;
                    }

                    // TODO:
                    //paisViewModel.Insert(newPais);

                    // Some sort of validation here
                    // empty fields, etc
                    // this is entity specific
                    // The UI should handle this
                    if (string.IsNullOrEmpty(newPais.nombre))
                    {
                        return;
                    }
                    this.customViewModel.InsertEntity <Pais>(newPais, "Paises");

                    //System.Windows.MessageBox.Show(string.Format("New Pais: {0} {1}", newPais.id, newPais.nombre));
                }

                return;
            }



            if (e.EditOperationType == GridViewEditOperationType.Edit)
            {
                GridViewRow row = e.Row;

                newPais = e.NewData as Pais;
                if (newPais == null)
                {
                    return;
                }

                // TODO:
                //bool rst = this.customViewModel.HasModifications(newPais, e.OldValues);
                //if (!rst)
                // {
                //    return;
                //}

                //System.Windows.MessageBox.Show(string.Format("Update Pais: {0} {1}", newPais.id, newPais.nombre));

                //paisViewModel.Update(newPais);
                //this.entityList.ProcessEntity<Pais>(newPais, TrackableEntity.Operation.Update);
                this.customViewModel.UpdateEntity <Pais>(newPais);
            }
        }
示例#21
0
 private void GridView_RowEditEnded(object sender, GridViewRowEditEndedEventArgs e)
 {
 }
示例#22
0
 void gvwOrganisations_RowEditEnded(object sender, GridViewRowEditEndedEventArgs e)
 {
     gvwOrganisations_SelectionChanged(null, null);
 }
示例#23
0
 private void DataGrid_RowEditEnded(object sender, GridViewRowEditEndedEventArgs e)
 {
     NameColumn.IsReadOnly = true;
 }
 void gvwCustomers_RowEditEnded(object sender, GridViewRowEditEndedEventArgs e)
 {
     gvwCustomers_SelectionChanged(null, null);
 }
 void gvwCustomers_RowEditEnded(object sender, GridViewRowEditEndedEventArgs e)
 {
     gvwCustomers_SelectionChanged(null, null);
 }
示例#26
0
 private void DataGrid_RowEditEnded(object sender, GridViewRowEditEndedEventArgs e)
 {
     Contrato.IsReadOnly   = false;
     NameColumn.IsReadOnly = false;
     LLenarContratos();
 }
示例#27
0
        private void CommentBlocksGridView_RowEditEnded(object sender, GridViewRowEditEndedEventArgs e)
        {
            var row = e.Row.Item as EvidenceRow;

            this.Chart.UpdateCommentBlocks(row, VerticalAxis);
        }
示例#28
0
 private void RiversMappingDataGrid_RowEditEnded(object sender, GridViewRowEditEndedEventArgs e)
 {
     RiversMappingNameColumn.IsReadOnly = true;
 }
示例#29
0
        void gridView_RowEditEnded(object sender, GridViewRowEditEndedEventArgs e)
        {
            CommandParameter = e;

            ExecuteCommand();
        }