private void dgTurma_RowEditEnding(object sender, Microsoft.Windows.Controls.DataGridRowEditEndingEventArgs e) { TurmaDto turmaDto = e.Row.DataContext as TurmaDto; SalvarTurma(turmaDto); }
private void dgConceito_RowEditEnding(object sender, Microsoft.Windows.Controls.DataGridRowEditEndingEventArgs e) { ConceitoDto conceitoDto = e.Row.DataContext as ConceitoDto; SalvarConceito(conceitoDto); }
private void dgDisciplina_RowEditEnding(object sender, Microsoft.Windows.Controls.DataGridRowEditEndingEventArgs e) { DisciplinaDto disciplinaDto = e.Row.DataContext as DisciplinaDto; SalvarDisciplina(disciplinaDto); }
private void dgTipoPessoa_RowEditEnding(object sender, Microsoft.Windows.Controls.DataGridRowEditEndingEventArgs e) { TipoPessoaDto tipoPessoaDto = e.Row.DataContext as TipoPessoaDto; SalvarTipoPessoa(tipoPessoaDto); }
/// <summary> /// Handles the RowEditEnding event of the DGAttachData control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="Microsoft.Windows.Controls.DataGridRowEditEndingEventArgs"/> instance containing the event data.</param> private void DGAttachData_RowEditEnding(object sender, Microsoft.Windows.Controls.DataGridRowEditEndingEventArgs e) { try { Microsoft.Windows.Controls.DataGridRow dgRow = e.Row; if (dgRow != null) { var selectedCallData = dgRow.Item as CallData; string key = selectedCallData.Key.ToString().Trim(); string value = selectedCallData.Value.ToString().Trim(); var updateCallData = new SoftPhone(); if (_dataContext.userAttachData.ContainsKey(key)) { string originalValue = _dataContext.userAttachData[key]; if (value != originalValue) { _dataContext.userAttachData.Remove(key); _dataContext.userAttachData.Add(key, value); updateCallData.UpdateUserData(_dataContext.userAttachData); } } BindGrid(); } } catch (Exception ex) { _logger.Error("Error occurred as " + ex.Message); } }
private void dgSalaDeAula_RowEditEnding(object sender, Microsoft.Windows.Controls.DataGridRowEditEndingEventArgs e) { SalaDeAulaDto SalaDeAulaDto = e.Row.DataContext as SalaDeAulaDto; SalaDeAulaDto.TurmaId = TurmaId; SalvarSalaDeAula(SalaDeAulaDto); }
private void dataGrid2_RowEditEnding(object sender, Microsoft.Windows.Controls.DataGridRowEditEndingEventArgs e) { int defaultselected = 0; decimal discount = 0; int pagid = 0; bool ok = true; string message = ""; DataRowView dv = (DataRowView)e.Row.Item; if (dv != null) { if (dv[7] != null) { if (dv[7].ToString().ToUpper() == "TRUE") { defaultselected = 1; } else { defaultselected = 0; } } try { discount = decimal.Parse(dv[8].ToString()); if (discount > 1 || discount < 0) { ok = false; message = "The discount percentage should be between 0 and 1."; } } catch (Exception ex) { message = "Please enter a valid percentage."; ok = false; } pagid = int.Parse(dv[0].ToString()); if (ok) { client.SQSAdmin_Promotion_UpdateProductForPromotion(promotionid, pagid, defaultselected, discount); } else { MessageBox.Show(message); } } }
private void DGCaseDataInfo_RowEditEnding(object sender, Microsoft.Windows.Controls.DataGridRowEditEndingEventArgs e) { var chatMedia = new ChatMedia(); try { Microsoft.Windows.Controls.DataGridRow dgRow = e.Row; if (dgRow != null) { var selectedCallData = dgRow.Item as ChatCaseData; string key = selectedCallData.Key.ToString().Trim(); string value = selectedCallData.Value.ToString().Trim(); if (_chatUtil.UserData.ContainsKey(key)) { string originalValue = _chatUtil.UserData[key].ToString(); if (value != originalValue) { KeyValueCollection caseData = new KeyValueCollection(); caseData.Add(key, value); OutputValues output = chatMedia.DoUpdateCaseDataProperties(_interactionID, _chatUtil.ProxyId, caseData); if (output.MessageCode == "200") { _chatUtil.UserData.Remove(key); _chatUtil.UserData.Add(key, value); } caseData.Clear(); } } else { KeyValueCollection caseData = new KeyValueCollection(); caseData.Add(key, value); OutputValues output = chatMedia.DoAddCaseDataProperties(_interactionID, _chatUtil.ProxyId, caseData); if (output.MessageCode == "200") { _chatUtil.UserData.Add(key, value); } caseData.Clear(); } BindGrid(); } } catch (Exception commonException) { _logger.Error("Error occurred while DGCaseDataInfo_RowEditEnding(): " + commonException.ToString()); } finally { chatMedia = null; } }
/// <summary> /// Handles the RowEditEnding event of the DGCaseDataInfo control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="Microsoft.Windows.Controls.DataGridRowEditEndingEventArgs"/> instance containing the event data.</param> private void DGCaseDataInfo_RowEditEnding(object sender, Microsoft.Windows.Controls.DataGridRowEditEndingEventArgs e) { try { Microsoft.Windows.Controls.DataGridRow dgRow = e.Row; if (dgRow != null) { var selectedCallData = dgRow.Item as EmailCaseData; string key = selectedCallData.Key.ToString().Trim(); string value = selectedCallData.Value.ToString().Trim(); if (!isEditDone) { isEditDone = true; if (CurrentData.ContainsKey(key)) { string originalValue = CurrentData[key].ToString(); if (value != originalValue) { KeyValueCollection caseData = new KeyValueCollection(); caseData.Add(key, value); InteractionService interactionService = new InteractionService(); Pointel.Interactions.Core.Common.OutputValues result = interactionService.UpdateCaseDataProperties(interactionId, EmailDataContext.GetInstance().ProxyClientID, caseData); if (result.MessageCode == "200") { CurrentData[key] = value; } caseData.Clear(); } } else { KeyValueCollection caseData = new KeyValueCollection(); caseData.Add(key, value); InteractionService interactionService = new InteractionService(); Pointel.Interactions.Core.Common.OutputValues result = interactionService.AddCaseDataProperties(interactionId, EmailDataContext.GetInstance().ProxyClientID, caseData); if (result.MessageCode == "200") { CurrentData.Add(key, value); } caseData.Clear(); } return; } else { if (CurrentData.ContainsKey(key)) { string originalValue = CurrentData[key].ToString(); if (value != originalValue) { CurrentData.Remove(key); CurrentData.Add(key, value); } } else { CurrentData.Add(key, value); } } ConvertUserData(); } } catch (Exception ex) { logger.Error("dgCaseInfo_RowEditEnding: " + ex.Message); } }
protected override void OnRowEditEnding(Microsoft.Windows.Controls.DataGridRowEditEndingEventArgs e) { Logging.Client.DebugFormat("OnRowEditEnding(Row.Item.Type = {0})", e.Row.Item.GetType().Name); Logging.Client.DebugFormat(" continueEdit={0}, isNewItem={1}", continueEdit, isNewItemForContinueEdit); base.OnRowEditEnding(e); }
private void DGAttachData_RowEditEnding(object sender, Microsoft.Windows.Controls.DataGridRowEditEndingEventArgs e) { }
private void dataGrid1_RowEditEnding(object sender, Microsoft.Windows.Controls.DataGridRowEditEndingEventArgs e) { int forregional = 0; int active = 0; decimal promotioncost = 0; decimal capevalue = 0; int multiplepromotionid; bool ok = true; string baseproduct = ""; string message = ""; CommonResource.FullMultiplePromotion dv = (CommonResource.FullMultiplePromotion)e.Row.Item; //DataRowView dv = (DataRowView)e.Row.Item; if (dv != null) { if (dv.BaseProduct != null) { baseproduct = dv.BaseProduct; } try { promotioncost = decimal.Parse(dv.PromotionCost.ToString()); } catch (Exception ex) { message = "Please enter a valid promotion cost."; ok = false; } try { capevalue = decimal.Parse(dv.CapeVale.ToString()); } catch (Exception ex) { message = "Please enter a valid cape value."; ok = false; } multiplepromotionid = int.Parse(dv.MultiplePromotionID.ToString()); if (dv.ForRegional) { forregional = 1; } if (dv.Active) { active = 1; } if (ok) { client = new SQSAdminServiceClient(); client.Endpoint.Address = new System.ServiceModel.EndpointAddress(CommonVariables.WcfEndpoint); client.SQSAdmin_Promotion_UpdatePromotion(multiplepromotionid, baseproduct, promotioncost, capevalue, forregional, active, dv.DisplayCodeID, dv.PromotionName); client.Close(); } else { MessageBox.Show(message); } } }
private void authorsDataGrid_RowEditEnding(object sender, Microsoft.Windows.Controls.DataGridRowEditEndingEventArgs e) { (e.Row.Item as DataRowView).EndEdit(); UpdateAuthorsDB(); }
private void dgData_RowEditEnding(object sender, Microsoft.Windows.Controls.DataGridRowEditEndingEventArgs e) { if (e.EditAction == Microsoft.Windows.Controls.DataGridEditAction.Commit) { OlanetV5DataContext dcOlanetContext = new OlanetV5DataContext(); //aperh_PiezasMalas datosEnGrid = e.Row.DataContext as aperh_PiezasMalas; FichajeCNQ datosEnGrid = e.Row.DataContext as FichajeCNQ; //DataRowView item = (dgFichajesCNQ as DataGrid).SelectedItem as DataRowView; //DataRowView view = (DataRowView)dgFichajesCNQ.SelectedItem; /* * _contacto.Nombre = item.Row.ItemArray[0].ToString(); * _contacto.NumeroCelular = item.Row.ItemArray[1].ToString(); * _contacto.NumeroTrabajo = item.Row.ItemArray[2].ToString(); * _contacto.NumeroParticular = item.Row.ItemArray[3].ToString(); * _contacto.Email = item.Row.ItemArray[4].ToString(); * _contacto.Notas = item.Row.ItemArray[5].ToString(); */ var datosTabla = (from datostabla in dcOlanetContext.GetTable <aperh_PiezasMalas>() where datostabla.IdMalas == datosEnGrid.IdMalas select datostabla).SingleOrDefault(); if (datosTabla == null) { Table <aperh_PiezasMalas> fichCNQTabla = dcOlanetContext.GetTable <aperh_PiezasMalas>(); aperh_PiezasMalas registroTabla = new aperh_PiezasMalas(); registroTabla.IdMalas = datosEnGrid.IdMalas; registroTabla.maquina_id = datosEnGrid.maquina_id; registroTabla.operario_id = datosEnGrid.operario_id; registroTabla.Referencia = datosEnGrid.Referencia; registroTabla.FECHA = datosEnGrid.FECHA; registroTabla.Cantidad = datosEnGrid.Cantidad; registroTabla.EstaEnIFS = datosEnGrid.EstaEnIFS; registroTabla.OT = datosEnGrid.OT; registroTabla.Operacion = datosEnGrid.Operacion; registroTabla.UdMedida = datosEnGrid.UdMedida; registroTabla.Incidente = datosEnGrid.Incidente; registroTabla.TipoPieza = datosEnGrid.TipoPieza; registroTabla.TipoMotivo = datosEnGrid.TipoMotivo; fichCNQTabla.InsertOnSubmit(registroTabla); fichCNQTabla.Context.SubmitChanges(); txtStatus.Text = "Existo: Datos Insertados"; } else { datosTabla.maquina_id = datosEnGrid.maquina_id; datosTabla.operario_id = datosEnGrid.operario_id; datosTabla.Referencia = datosEnGrid.Referencia; datosTabla.FECHA = datosEnGrid.FECHA; datosTabla.Cantidad = datosEnGrid.Cantidad; datosTabla.EstaEnIFS = datosEnGrid.EstaEnIFS; datosTabla.OT = datosEnGrid.OT; datosTabla.Operacion = datosEnGrid.Operacion; datosTabla.UdMedida = datosEnGrid.UdMedida; datosTabla.Incidente = datosEnGrid.Incidente; datosTabla.TipoPieza = datosEnGrid.TipoPieza; datosTabla.IdTipoMotivo = datosEnGrid.IdTipoMotivo; datosTabla.IdMotivoMalas = datosEnGrid.IdMotivoMalas; dcOlanetContext.SubmitChanges(); var datosTablaCons = (from datostablaCons in dcOlanetContext.GetTable <FichajeCNQ>() where datostablaCons.IdMalas == datosEnGrid.IdMalas select datostablaCons).SingleOrDefault(); datosEnGrid.operario_nme = datosTablaCons.operario_nme; datosEnGrid.DescTipoMotivoMalas = datosTablaCons.DescTipoMotivoMalas; datosEnGrid.DescMotivoMalas = datosTablaCons.DescMotivoMalas; txtStatus.Text = "Exito: Datos Actualizados"; } } }
private void dgData_RowEditEnding_xx(object sender, Microsoft.Windows.Controls.DataGridRowEditEndingEventArgs e) { if (e.EditAction == Microsoft.Windows.Controls.DataGridEditAction.Commit) { OlanetV5DataContext dcOlanetContext = new OlanetV5DataContext(); FichajeCNQ datosEnGrid = e.Row.DataContext as FichajeCNQ; var datosTabla = (from datostabla in dcOlanetContext.GetTable <FichajeCNQ>() where datostabla.IdMalas == datosEnGrid.IdMalas select datostabla).SingleOrDefault(); if (datosTabla == null) { Table <FichajeCNQ> fichCNQTabla = dcOlanetContext.GetTable <FichajeCNQ>(); FichajeCNQ registroTabla = new FichajeCNQ(); registroTabla.IdMalas = datosEnGrid.IdMalas; registroTabla.maquina_id = datosEnGrid.maquina_id; registroTabla.operario_id = datosEnGrid.operario_id; registroTabla.Referencia = datosEnGrid.Referencia; registroTabla.FECHA = datosEnGrid.FECHA; registroTabla.Cantidad = datosEnGrid.Cantidad; registroTabla.EstaEnIFS = datosEnGrid.EstaEnIFS; registroTabla.OT = datosEnGrid.OT; registroTabla.Operacion = datosEnGrid.Operacion; registroTabla.UdMedida = datosEnGrid.UdMedida; registroTabla.Incidente = datosEnGrid.Incidente; registroTabla.TipoPieza = datosEnGrid.TipoPieza; registroTabla.TipoMotivo = datosEnGrid.TipoMotivo; fichCNQTabla.InsertOnSubmit(registroTabla); fichCNQTabla.Context.SubmitChanges(); txtStatus.Text = "Existo: Datos Insertados"; } else { datosTabla.maquina_id = datosEnGrid.maquina_id; datosTabla.operario_id = datosEnGrid.operario_id; datosTabla.Referencia = datosEnGrid.Referencia; datosTabla.FECHA = datosEnGrid.FECHA; datosTabla.Cantidad = datosEnGrid.Cantidad; datosTabla.EstaEnIFS = datosEnGrid.EstaEnIFS; datosTabla.OT = datosEnGrid.OT; datosTabla.Operacion = datosEnGrid.Operacion; datosTabla.UdMedida = datosEnGrid.UdMedida; datosTabla.Incidente = datosEnGrid.Incidente; datosTabla.TipoPieza = datosEnGrid.TipoPieza; datosTabla.TipoMotivo = datosEnGrid.TipoMotivo; dcOlanetContext.SubmitChanges(); //var datosTablaConsulta = (from datostablaConsulta in dcOlanetContext.GetTable<FichajeCNQ>() // where datostabla.IdMalas == datosEnGrid.IdMalas // select datostabla).SingleOrDefault(); txtStatus.Text = "Exito: Datos Actualizados"; } } }
private void dgReportGrid_RowEditEnding(object sender, Microsoft.Windows.Controls.DataGridRowEditEndingEventArgs e) { ModifiedRecords.Add(e.Row.DataContext as ReportRecord); }