private void gvDetails_CellEditEnded(object sender, GridViewCellEditEndedEventArgs e)
        {
            var row  = e.Cell.ParentRow;
            var item = (ProductForProductExchange)row.DataContext;
            //在有编辑器模板的情况下,e.OldData,e.NewData不准确
            var editor = e.EditingElement as RadNumericUpDown;

            if (editor != null)
            {
                var nowValue = (int)editor.Value;
                item.Quantity = nowValue;

                var result = _dataContext.UpdateDetails(item);
                if (result.IsSucceed)
                {
                    //更新主表状态
                    var parentRow   = row.GridViewDataControl.ParentRow;
                    var subcontract = (BillProductExchangeSearchEntity)parentRow.DataContext;
                    this.SetQuantityForOrderEntity(subcontract, parentRow);
                }
                else
                {
                    MessageBox.Show(result.Message);
                }
            }
        }
        private void StcDocumentItemsRadGridView_CellEditEnded(object sender, GridViewCellEditEndedEventArgs e)
        {
            if (e.Cell.Column.UniqueName == "description1" || e.Cell.Column.UniqueName == "description2")
            {
                RadComboBox combo = e.Cell.ChildrenOfType <RadComboBox>().FirstOrDefault();
                if (combo != null)
                {
                    List <SLStandardDescription> comboItems = combo.ItemsSource as List <SLStandardDescription>;

                    string textEntered = e.Cell.ChildrenOfType <RadComboBox>().First().Text;

                    bool result = comboItems.Contains(comboItems.Where(x => x.SLStandardDescriptionTitle == textEntered).FirstOrDefault());
                    if (!result)
                    {
                        comboItems.Add(new SLStandardDescription {
                            SLStandardDescriptionTitle = textEntered
                        });
                        combo.SelectedItem = new SLStandardDescription {
                            SLStandardDescriptionTitle = textEntered
                        };
                    }
                    if (_viewModel.StcDocumentItem != null)
                    {
                        //if (e.Cell.Column.UniqueName == "description1")
                        //    _viewModel.StcDocumentItem.Description1 = textEntered;
                        //else if (e.Cell.Column.UniqueName == "description2")
                        //    _viewModel.StcDocumentItem.Description2 = textEntered;
                    }
                }
            }
        }
Example #3
0
 void grdThuTuCATK_CellEditEnded(object sender, GridViewCellEditEndedEventArgs e)
 {
     ClearEventHanler();
     SoTienNopCATK = lstThongTinRutTK.Sum(f => f.SO_TIEN_RUT_RA);
     radNumSoNopCA.SetBinding(RadMaskedNumericInput.ValueProperty, CreateValueBinding(this, "SoTienNopCATK"));
     TinhToanTraGocLai();
     TinhToanGocLaiTraTruoc();
     TinhToanTienThuaNopTKBB();
     InitEventHanler();
 }
Example #4
0
        private void CommentBlocksGridView_CellEditEnded(object sender, GridViewCellEditEndedEventArgs e)
        {
            var columnName = e.Cell.Column.UniqueName;
            var row        = e.Cell.ParentRow.Item as EvidenceRow;

            var command = new CellEditCommand(row, columnName, this.SelectedVertex, e.NewData, e.OldData);

            command.Execute();

            this.UpdateCommandStack(command);
        }
Example #5
0
 private void DtgSubReports_CellEditEnded(object sender, GridViewCellEditEndedEventArgs e)
 {
     if (e.Cell.Column == colRelationshipTail)
     {
         if (e.Cell.DataContext is EntityListReportSubsDTO)
         {
             var subReport = (e.Cell.DataContext as EntityListReportSubsDTO);
             SetSubListReports(subReport);
         }
     }
 }
 void gvwBookingPayment_CellEditEnded(object sender, GridViewCellEditEndedEventArgs e)
 {
     if (e.NewData != null && e.Cell.ParentRow.Item != null)
     {
         BookingPayment currentRow = (BookingPayment)e.Cell.ParentRow.Item;
         string         columnName = e.Cell.Column.UniqueName;
         if (currentRow != null && columnName == "CustomerPaid")
         {
             currentRow.MoneyLeft = currentRow.TotalPrice - currentRow.CustomerPaid;
         }
     }
 }
 private void grDuChiDS_CellEditEnded(object sender, GridViewCellEditEndedEventArgs e)
 {
     try
     {
         //DataRowView dr = (DataRowView)grDuChiDS.CurrentCellInfo.Item;
         //dr["LAI_DU_CHI"] = Convert.ToDecimal(dr["LAI_DU_CHI"]);
         //grDuChiDS.CurrentItem = dr;
     }
     catch (Exception ex)
     {
         CommonFunction.ThongBaoLoi(ex);
         LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex);
     }
 }
Example #8
0
 private void grGuiThemDS_CellEditEnded(object sender, GridViewCellEditEndedEventArgs e)
 {
     try
     {
         DataRowView dr = (DataRowView)grGuiThemDS.CurrentCellInfo.Item;
         dr["SO_DU_MOI"]         = Convert.ToDecimal(dr["SO_DU"]) + Convert.ToDecimal(dr["SO_TIEN_GUI_THEM"]);
         grGuiThemDS.CurrentItem = dr;
     }
     catch (Exception ex)
     {
         CommonFunction.ThongBaoLoi(ex);
         LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex);
     }
 }
Example #9
0
 private void grid_CellEditEnded(object sender, GridViewCellEditEndedEventArgs e)
 {
     try
     {
         DataRowView dr = (DataRowView)grid.CurrentCellInfo.Item;
         dr["KH_TONG"]    = Convert.ToDecimal(dr["KE_HOACH_GOC_VAY"]) + Convert.ToDecimal(dr["KE_HOACH_LAI_TRONG_HAN"]);
         dr["TT_TONG"]    = Convert.ToDecimal(dr["THUC_THU_GOC_VAY"]) + Convert.ToDecimal(dr["THUC_THU_LAI_TRONG"]);
         grid.CurrentItem = dr;
     }
     catch (Exception ex)
     {
         CommonFunction.ThongBaoLoi(ex);
         LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex);
     }
 }
        private void gvDetails_CellEditEnded(object sender, GridViewCellEditEndedEventArgs e)
        {
            var row  = e.Cell.ParentRow;
            var item = (ProductForProduceBrush)row.DataContext;

            //在有编辑器模板的情况下,e.OldData,e.NewData不准确
            if (e.EditingElement is RadNumericUpDown || e.EditingElement is RadDatePicker)
            {
                var editor = e.EditingElement as RadNumericUpDown;
                if (editor != null)
                {
                    var nowValue = (int)editor.Value;
                    var tag      = editor.Tag.ToString();
                    if (tag == "QuaCancel")
                    {
                        item.QuaCancel = nowValue;
                    }
                    if (tag == "QuaCompleted")
                    {
                        item.QuaCompleted = nowValue;
                    }
                }
                else
                {
                    RadDatePicker picker = e.EditingElement as RadDatePicker;
                    if (picker != null && picker.SelectedValue != null)//若选择的日期非法则为null
                    {
                        item.DeliveryDate = picker.SelectedValue.Value;
                    }
                    else
                    {
                        return;
                    }
                }
                var result = _dataContext.UpdateDetails(item);
                if (result.IsSucceed)
                {
                    //更新主表状态
                    var parentRow   = row.GridViewDataControl.ParentRow;
                    var subcontract = (BillSubcontractSearchEntity)parentRow.DataContext;
                    this.SetQuantityForOrderEntity(subcontract, parentRow, false);
                }
                else
                {
                    MessageBox.Show(result.Message);
                }
            }
        }
Example #11
0
        private void GridView_CellEditEnded(object sender, GridViewCellEditEndedEventArgs e)
        {
            var columnName     = e.Cell.Column.UniqueName;
            var row            = e.Cell.ParentRow.Item as EvidenceRow;
            var vertexEvidence = this.selectedVertex.States.ParseEvidenceString(e.NewData as string);

            var command = new CellEditCommand(row, columnName, this.SelectedVertex, e.NewData, e.OldData);

            command.Execute();

            this.UpdateCommandStack(command);

            if (vertexEvidence.Type != VertexEvidenceType.Invalid)
            {
                this.Plot(row, columnName);
            }
        }
Example #12
0
 private void DtgRelationships_CellEditEnded(object sender, GridViewCellEditEndedEventArgs e)
 {
     if (e.Cell.Column.UniqueName == "DeleteOption")
     {
         var rel = (e.Cell.DataContext as RelationshipDTO);
         if (rel != null)
         {
             if (!rel.RelationshipColumns.Any(x => x.SecondSideColumn.IsNull))
             {
                 //if ((RelationshipDeleteOption)e.NewData == RelationshipDeleteOption.SetNull)
                 //{
                 //    rel.DeleteOption = RelationshipDeleteOption.None;
                 //}
             }
         }
     }
 }
Example #13
0
        void RadGridView1_CellEditEnded(object sender, GridViewCellEditEndedEventArgs e)
        {
            RadComboBox combo = e.Cell.ChildrenOfType<RadComboBox>().FirstOrDefault();
            if (combo != null)
            {
                ObservableCollection<Country> comboItems = combo.ItemsSource as ObservableCollection<Country>;

                string textEntered = e.Cell.ChildrenOfType<RadComboBox>().First().Text;

                bool result = comboItems.Contains(comboItems.Where(x => x.Name == textEntered).FirstOrDefault());
                if (!result)
                {
                    comboItems.Add(new Country(textEntered, ++maxID));

                    ((Pilot)e.Cell.DataContext).CountryId = maxID;
                }
            }
        }
Example #14
0
 private void RadGridView1_CellEditEnded(object sender, GridViewCellEditEndedEventArgs e)
 {
     ////here you may need to perform a check which column is being edited to be sure it is the one with the combobox
     //// this may be done by checking the e.Cell.Column
     //var x = e.EditingElement as RadComboBox;
     //string newlyTypedText = "";
     //if (x != null)
     //    newlyTypedText = x.Text;
     ////here add the newlyTypedText item to the ComboBoxColumn.ItemsSource collection
     //var qq = ((GridViewComboBoxColumn)this.RadGridView1.Columns["SLStandardDescriptionTitle"]).ItemsSource as HashSet<SLStandardDescription>;
     //SLStandardDescription vv = new SLStandardDescription() ;
     //if (!string.IsNullOrWhiteSpace(newlyTypedText) && !qq.Any(s => s.SLStandardDescriptionTitle == newlyTypedText))
     //{
     //     vv =new SLStandardDescription { SLStandardDescriptionTitle = newlyTypedText };
     //    qq.Add(vv);
     //}
     //if (x != null)
     //    x.SelectedItem = vv;
 }
Example #15
0
        void RadGridView1_CellEditEnded(object sender, GridViewCellEditEndedEventArgs e)
        {
            RadComboBox combo = e.Cell.ChildrenOfType <RadComboBox>().FirstOrDefault();

            if (combo != null)
            {
                ObservableCollection <Country> comboItems = combo.ItemsSource as ObservableCollection <Country>;

                string textEntered = e.Cell.ChildrenOfType <RadComboBox>().First().Text;

                bool result = comboItems.Contains(comboItems.Where(x => x.Name == textEntered).FirstOrDefault());
                if (!result)
                {
                    comboItems.Add(new Country(textEntered, ++maxID));

                    ((Pilot)e.Cell.DataContext).CountryId = maxID;
                }
            }
        }
Example #16
0
        private void gvData_CellEditEnded(object sender, GridViewCellEditEndedEventArgs e)
        {
            DAL.Datos    datos = new DAL.Datos();
            GridViewCell cl    = (GridViewCell)e.Cell;
            TextBox      t     = (TextBox)e.EditingElement;
            Int32        c     = e.Cell.TabIndex;

            GridViewCell _id = (GridViewCell)e.Cell.ParentRow.Cells[0];

            RadGridView _gv = (RadGridView)e.Source;

            string _columnHeader = _gv.CurrentColumn.Header.ToString();

            datos.UpdateRequerido(nameBD, _id.Value.ToString(), _columnHeader, t.Text);

            //gvData.Rebind();
            //datos.ObtenerRequerido(sNombre).Tables[0];

            //MessageBox.Show(_id.Value.ToString());
        }
        private void dgFairValueComposition_CellEditEnded(object sender, GridViewCellEditEndedEventArgs e)
        {
            if (e.Cell.Column.UniqueName == "Sell")
            {
                FairValueData data = e.Cell.DataContext as FairValueData;

                if (data != null && DataContextFairValueComposition != null)
                {
                    DataContextFairValueComposition.EditedSellPropertyFairValueRow = data;
                }
            }
            if (e.Cell.Column.UniqueName == "Buy")
            {
                FairValueData data = e.Cell.DataContext as FairValueData;

                if (data != null && DataContextFairValueComposition != null)
                {
                    DataContextFairValueComposition.EditedSellPropertyFairValueRow = data;
                }
            }
        }
Example #18
0
        private void EndEditionHisto(object sender, GridViewCellEditEndedEventArgs e)
        {
            DataRow row = HistoGrid.SelectedItem as DataRow;

            String ISIN          = row["ISIN"].ToString();
            String newDate       = row["Date"].ToString();
            String newRecoMXEU   = row["RecoMXEU"].ToString();
            String newRecoMXEUM  = row["RecoMXEUM"].ToString();
            String newRecoMXEM   = row["RecoMXEM"].ToString();
            String newRecoMXUSLC = row["RecoMXUSLC"].ToString();
            int    id            = int.Parse(row["ID"].ToString());

            if (ISIN != "") //reco valeur
            {
                _viewModel.UpdateRecoValue(id, newDate, newRecoMXEU, newRecoMXEUM, newRecoMXEM, newRecoMXUSLC);
            }
            else //reco secteur
            {
                _viewModel.UpdateRecoSector(_prevDateSelected, _prevTypeSelected, id, newDate, newRecoMXEU, newRecoMXEUM, newRecoMXEM, newRecoMXUSLC);
            }
        }
Example #19
0
        private void gvDetails_CellEditEnded(object sender, GridViewCellEditEndedEventArgs e)
        {
            //在有编辑器模板的情况下,e.OldData,e.NewData不准确
            var editor   = (RadNumericUpDown)e.EditingElement;
            var nowValue = (int)editor.Value;

            var row  = e.Cell.ParentRow;
            var item = (ProductForOrderReport)row.DataContext;

            //更新主表状态
            var parentRow = row.GridViewDataControl.ParentRow;
            var order     = (OrderSearchEntity)parentRow.DataContext;
            var result    = _dataContext.UpdateDetailsCancelQuantity(item.DetailID, nowValue, item.ProductCode, order);

            if (result.IsSucceed)
            {
                item.QuaCancel = nowValue;
                this.SetQuantityForOrderEntity(order, parentRow, false);
            }
            else
            {
                MessageBox.Show(result.Message);
            }
        }
 private void _radGridView_CellEditEnded(object sender, GridViewCellEditEndedEventArgs e){
     // Perform some save persistence operations in the database
     Debug.WriteLine("Saved record to Database");
 }
 void gvwTreatmentService_CellEditEnded(object sender, GridViewCellEditEndedEventArgs e)
 {
     if (e.NewData != null && e.Cell.ParentRow.Item != null)
     {
         TreatmentService rowData = (TreatmentService)e.Cell.ParentRow.Item;
         string columnName = e.Cell.Column.UniqueName;
         if (columnName == "Quantity" || columnName == "Price")
         {
             rowData.TotalPrice = rowData.Quantity * rowData.Price;
             ReCalculateTreatmentTotalPrice(rowData.TreatmentId);
         }
     }
 }
 private void DtgActivityTargets_CellEditEnded(object sender, GridViewCellEditEndedEventArgs e)
 {
     ShowTargetRoleTab(e.Cell.DataContext as ActivityTargetDTO);
 }
Example #23
0
 private void RadGridViewCellEditEnded(object sender, GridViewCellEditEndedEventArgs e)
 {
     PhotoModel.SaveChanges();
 }
Example #24
0
 /// <summary>
 /// 控制保存、放弃修改按钮的可用性
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void AgeDeployGridView_CellEditEnded(object sender, GridViewCellEditEndedEventArgs e)
 {
     if (e.Cell.Column.Header.ToString() !="对应颜色" && Convert.ToUInt32(e.NewData) != Convert.ToUInt32(e.OldData))
     {
         this.isChanged = true;
     }
     else if (e.Cell.Column.Header.ToString() == "对应颜色")
     {
         this.isChanged = true;
     }
 }
Example #25
0
 private void _radGridView_CellEditEnded(object sender, GridViewCellEditEndedEventArgs e)
 {
     // Perform some save persistence operations in the database
     Debug.WriteLine("Saved record to Database");
 }
 private void DtgActionTargets_CellEditEnded(object sender, GridViewCellEditEndedEventArgs e)
 {
     CheckRollTypeCell(e.Cell.ParentRow);
 }
Example #27
0
 public void PaymentNoticeListCellEditEnded(object sender, GridViewCellEditEndedEventArgs e)
 {
     if (e.Cell.Column.UniqueName.Equals("Supplier", StringComparison.OrdinalIgnoreCase))
     {
         var comboBox = e.EditingElement as RadComboBox;
         if (comboBox != null)
         {
             var supplier = comboBox.SelectedItem as SupplierDTO;
             if (supplier != null)
             {
                 PaymentNotice.SupplierName = supplier.Name;
                 bankAccountWindow.ViewModel.InitBankAccounts(supplier.BankAccounts);
                 bankAccountWindow.WindowStartupLocation = WindowStartupLocation.CenterScreen;
                 bankAccountWindow.Closed += BankAccountWindowClosed;
                 bankAccountWindow.ShowDialog();
             }
         }
     }
 }
Example #28
0
        void grdUsers_CellEditEnded(object sender, GridViewCellEditEndedEventArgs e)
        {
            var user = e.Cell.DataContext as UserRowViewModel;

            user.SubmitChanges();
        }
 private void gridView_CellEditEnded(object sender, GridViewCellEditEndedEventArgs e)
 {
 }
Example #30
0
 /// <summary>
 ///     控制保存、放弃修改按钮的可用性
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void AgeDeployGridViewCellEditEnded(object sender, GridViewCellEditEndedEventArgs e)
 {
     if (!e.Cell.Column.Header.ToString().Equals("对应颜色", StringComparison.OrdinalIgnoreCase) &&
         Convert.ToUInt32(e.NewData) != Convert.ToUInt32(e.OldData))
     {
         IsChanged = true;
     }
     else if (e.Cell.Column.Header.ToString().Equals("对应颜色", StringComparison.OrdinalIgnoreCase))
     {
         IsChanged = true;
     }
 }
 /// <summary>
 /// 控制保存、放弃修改按钮的可用性
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void FleetColorSetGridView_CellEditEnded(object sender, GridViewCellEditEndedEventArgs e)
 {
     if (Convert.ToString(e.NewData) != Convert.ToString(e.OldData))
     {
         this.isChanged = true;
     }
 }
 void gvwBookingPayment_CellEditEnded(object sender, GridViewCellEditEndedEventArgs e)
 {
     if (e.NewData != null && e.Cell.ParentRow.Item != null)
     {
         BookingPayment currentRow = (BookingPayment)e.Cell.ParentRow.Item;
         string columnName = e.Cell.Column.UniqueName;
         if (currentRow != null && columnName == "CustomerPaid")
         {
             currentRow.MoneyLeft = currentRow.TotalPrice - currentRow.CustomerPaid;
         }
     }
 }
 private void gvDatas_CellEditEnded(object sender, GridViewCellEditEndedEventArgs e)
 {
     gvDatas.CalculateAggregates();
 }
Example #34
0
 private void RadGridView2_CellEditEnded(object sender, GridViewCellEditEndedEventArgs e)
 {
     NotesTemplateViewModel.NoteTemplate ed = (NotesTemplateViewModel.NoteTemplate)e.Cell.DataContext;
     UpdateNoteTemplateName(ed.TemplateID, ed.TemplateName);
 }