/// <summary> /// Truong hop xoa 1 khoi giao ly /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void gxAddEdit1_DeleteClick(object sender, EventArgs e) { if (gxKhoiGiaoLyList1.CurrentRow != null && (gxKhoiGiaoLyList1.CurrentRow.DataRow as DataRowView) != null) { if (MessageBox.Show("Bạn có chắc muốn xóa khối giáo lý này? Các lớp giáo lý thuộc khối này sẽ bị xóa theo", "Xác nhận xóa", MessageBoxButtons.YesNo) == DialogResult.No) { return; } int count = gxKhoiGiaoLyList1.SelectedItems.Count; List <int> lstDelete = new List <int>(); foreach (Janus.Windows.GridEX.GridEXSelectedItem item in gxKhoiGiaoLyList1.SelectedItems) { lstDelete.Add(item.Position); } for (int i = 0; i < count; i++) { Janus.Windows.GridEX.GridEXRow item = gxKhoiGiaoLyList1.GetRow(lstDelete[i] - i); Memory.ExecuteSqlCommand("Delete from ChiTietLopGiaoLy where MaLop in (select MaLop from LopGiaoLy where MaKhoi = ?)", new object[] { (item.DataRow as DataRowView).Row["MaKhoi"] }); Memory.ExecuteSqlCommand("Delete from LopGiaoLy where MaKhoi = ?", new object[] { (item.DataRow as DataRowView).Row["MaKhoi"] }); Memory.ExecuteSqlCommand("Delete from KhoiGiaoLy where MaKhoi = ?", new object[] { (item.DataRow as DataRowView).Row["MaKhoi"] }); if (Memory.ShowError()) { return; } gxKhoiGiaoLyList1.CurrentRow.Delete(); item.Delete(); } } }
private void legislationGridEX_SelectionChanged(object sender, EventArgs e) { try { Janus.Windows.GridEX.GridEXRow gr = legislationGridEX.CurrentRow; if (gr.Table.Key == AtMng.DB.Legislation.TableName) { pnlProvisionDetail.Closed = true; pnlDetail.Closed = false; } else if (gr.Table.Key == "Provision") { pnlDetail.Closed = true; pnlProvisionDetail.Closed = false; if (gr.RowType == Janus.Windows.GridEX.RowType.Record) { provisionBindingSource.Position = provisionBindingSource.Find("ProvisionId", gr.Cells["ProvisionId"].Value); } } } catch (Exception x) { UIHelper.HandleUIException(x); } }
/// <summary> /// Truong hop xoa 1 gia dinh /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void gxAddEdit1_DeleteClick(object sender, EventArgs e) { if (gxGiaDinhList1.CurrentRow != null && (gxGiaDinhList1.CurrentRow.DataRow as DataRowView) != null) { if (MessageBox.Show("Bạn có chắc muốn xóa (các) gia đình này?", "Xác nhận xóa", MessageBoxButtons.YesNo) == DialogResult.No) { return; } int count = gxGiaDinhList1.SelectedItems.Count; List <int> lstDelete = new List <int>(); foreach (Janus.Windows.GridEX.GridEXSelectedItem item in gxGiaDinhList1.SelectedItems) { lstDelete.Add(item.Position); } for (int i = 0; i < count; i++) { Janus.Windows.GridEX.GridEXRow item = gxGiaDinhList1.GetRow(lstDelete[i] - i); Memory.ExecuteSqlCommand(SqlConstants.DELETE_GIADINH_THEO_ID, new object[] { (item.DataRow as DataRowView).Row[GiaDinhConst.MaGiaDinh] }); if (Memory.ShowError()) { return; } //gxGiaDinhList1.CurrentRow.Delete(); item.Delete(); //gxGiaDinhList1.SelectedItems.Remove(item); } } }
protected virtual void DeleteDetailRowsFromMemory(XGridEx gridEx, IList <XModelBase> selectedModels) { IList <XModelBase> modelLists = gridEx.DataSource as IList <XModelBase>; foreach (XModelBase model in selectedModels) { Janus.Windows.GridEX.GridEXRow row = gridEx.GetRow(model); row.Delete(); modelLists.Remove(model); } }
protected virtual void DeleteRowsFromMemory() { IList <XModelBase> modelLists = this.grdData.DataSource as IList <XModelBase>; foreach (XModelBase model in this.m_SelectedModels) { Janus.Windows.GridEX.GridEXRow row = this.grdData.GetRow(model); row.Delete(); modelLists.Remove(model); } }
private void btnRemover_Click(object sender, System.EventArgs e) { ArrayList array = new ArrayList(); for (int index = 0; index < gridValoresATransferir.SelectedItems.Count; index++) { Janus.Windows.GridEX.GridEXRow row = gridValoresATransferir.SelectedItems[index].GetRow(); array.Add(row.Cells["IdValor"].Value); } _uiController.Remover(array); }
private void dgMesazhe_CurrentCellChanged(object sender, System.EventArgs e) { int j = this.dgMesazhe.Row; Janus.Windows.GridEX.GridEXRow row = this.dgMesazhe.GetRow(j); this.txtModifikoFshi.Text = row.Cells[1].Value.ToString(); this.dtpModifikoFshi.Value = this.ConvertToDateTime(row.Cells[0].Value.ToString()); this.dataVjeter = Convert.ToDateTime(this.dtpModifikoFshi.Value).ToString("dd/MM/yyyy HH:mm"); this.dataVjeterDate = Convert.ToDateTime(this.dtpModifikoFshi.Value); this.tekstiVjeter = this.txtModifikoFshi.Text; this.dtpModifikoFshi.Value = this.dataVjeterDate; }
/// <summary> /// Truong hop xoa 1 gia dinh /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void gxAddEdit1_DeleteClick(object sender, EventArgs e) { if (gxGiaoDanList1.CurrentRow != null && (gxGiaoDanList1.CurrentRow.DataRow as DataRowView) != null) { DialogResult rs = MessageBox.Show("Bạn muốn xóa vĩnh viễn giáo dân được chọn không?\r\nChọn [Yes] để xóa vĩnh viễn.\r\nChọn [No] để đưa vào hồ sơ lưu trữ.\r\nChọn [Cancel] hủy bỏ việc xóa.", "Xác nhận xóa", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question); if (rs == DialogResult.Cancel) { return; } int maGiaoDan = (int)(gxGiaoDanList1.CurrentRow.DataRow as DataRowView).Row[GiaoDanConst.MaGiaoDan]; if (rs == DialogResult.No) { Memory.ExecuteSqlCommand(SqlConstants.DELETE_GIAODAN, new object[] { maGiaoDan }); if (Memory.ShowError()) { return; } } else if (rs == DialogResult.Yes) { Memory.ExecuteSqlCommand("DELETE FROM GiaoDan WHERE MaGiaoDan=?", new object[] { maGiaoDan }); if (Memory.ShowError()) { return; } Memory.ExecuteSqlCommand("DELETE FROM ThanhVienGiaDinh WHERE MaGiaoDan=?", new object[] { maGiaoDan }); if (Memory.ShowError()) { return; } Memory.ExecuteSqlCommand("DELETE FROM BiTichChiTiet WHERE MaGiaoDan=?", new object[] { maGiaoDan }); if (Memory.ShowError()) { return; } Memory.ExecuteSqlCommand("DELETE FROM ChiTietLopGiaoLy WHERE MaGiaoDan=?", new object[] { maGiaoDan }); if (Memory.ShowError()) { return; } } Janus.Windows.GridEX.GridEXRow item = gxGiaoDanList1.GetRow(gxGiaoDanList1.SelectedItems[0].Position); item.Delete(); } }
/// <summary> /// Truong hop xoa 1 gia dinh /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void gxAddEdit1_DeleteClick(object sender, EventArgs e) { if (gxGiaDinhList1.CurrentRow != null && (gxGiaDinhList1.CurrentRow.DataRow as DataRowView) != null) { DialogResult rs = MessageBox.Show("Bạn muốn xóa vĩnh viễn gia đình được chọn không?\r\nChọn [Yes] để xóa vĩnh viễn.\r\nChọn [No] để đưa vào hồ sơ lưu trữ.\r\nChọn [Cancel] hủy bỏ việc xóa.", "Xác nhận xóa", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question); if (rs == DialogResult.Cancel) { return; } //if (MessageBox.Show("Bạn có chắc muốn xóa (các) gia đình này?", "Xác nhận xóa", MessageBoxButtons.YesNo) == DialogResult.No) return; int count = gxGiaDinhList1.SelectedItems.Count; List <int> lstDelete = new List <int>(); foreach (Janus.Windows.GridEX.GridEXSelectedItem item in gxGiaDinhList1.SelectedItems) { lstDelete.Add(item.Position); } for (int i = 0; i < count; i++) { Janus.Windows.GridEX.GridEXRow item = gxGiaDinhList1.GetRow(lstDelete[i] - i); if (rs == DialogResult.Yes) { Memory.ExecuteSqlCommand("DELETE FROM GiaDinh WHERE MaGiaDinh=?", new object[] { (item.DataRow as DataRowView).Row[GiaDinhConst.MaGiaDinh] }); if (Memory.ShowError()) { return; } Memory.ExecuteSqlCommand("DELETE FROM ThanhVienGiaDinh WHERE MaGiaDinh=?", new object[] { (item.DataRow as DataRowView).Row[GiaDinhConst.MaGiaDinh] }); if (Memory.ShowError()) { return; } } else { Memory.ExecuteSqlCommand(SqlConstants.DELETE_GIADINH_THEO_ID, new object[] { (item.DataRow as DataRowView).Row[GiaDinhConst.MaGiaDinh] }); if (Memory.ShowError()) { return; } } //gxGiaDinhList1.CurrentRow.Delete(); item.Delete(); //gxGiaDinhList1.SelectedItems.Remove(item); } } }
private void gridValoresDisponibles_DoubleClick(object sender, System.EventArgs e) { if (gridValoresDisponibles.SelectedItems.Count > 0) { Janus.Windows.GridEX.GridEXRow row = gridValoresDisponibles.SelectedItems[0].GetRow(); string IdTDCompTesoreria = Convert.ToString(row.Cells["IdTDCompTesoreria"].Value); bool agrupado = Convert.ToBoolean(row.Cells["Agrupado"].Value); string IdMoneda = Convert.ToString(row.Cells["IdMoneda"].Value); decimal ValorDefault = Convert.ToDecimal(row.Cells["ValorDestino"].Value); //ver bien el valor 0 q se le pasa al form //ojo modif cheque FrmValores form = new FrmValores(IdTDCompTesoreria, IdMoneda, ValorDefault, 0, agrupado, null, this._uiController, string.Empty); } }
private void dgvFrom_DragDrop(object sender, DragEventArgs e) { Janus.Windows.GridEX.GridEXRow row = (Janus.Windows.GridEX.GridEXRow)e.Data.GetData(typeof(Janus.Windows.GridEX.GridEXRow)); if (row != null) { int indexSource = row.RowIndex; Point p = dgvFrom.PointToClient(new Point(e.X, e.Y)); int rowIndex = dgvFrom.RowPositionFromPoint(p.X, p.Y); if (rowIndex >= 0 && rowIndex < dgvFrom.RowCount && indexSource != rowIndex) { DataRow rowmove = _data.Tables["fromcode"].NewRow(); rowmove.ItemArray = _data.Tables["fromcode"].Rows[indexSource].ItemArray; _data.Tables["fromcode"].Rows.RemoveAt(indexSource); _data.Tables["fromcode"].Rows.InsertAt(rowmove, rowIndex); } } }
private void btnDeleteFile_Click(object sender, EventArgs e) { IList <XModelBase> modelLists = this.grdFiles.DataSource as IList <XModelBase>; IList <XModelBase> selectedModels = new List <XModelBase>(); foreach (Janus.Windows.GridEX.GridEXRow gridRow in this.grdFiles.GetCheckedRows()) { selectedModels.Add(gridRow.DataRow as XModelBase); } foreach (XModelBase model in selectedModels) { Janus.Windows.GridEX.GridEXRow row = grdFiles.GetRow(model); row.Delete(); modelLists.Remove(model); } }
private void gridDetalleConversion_AddingRecord(object sender, CancelEventArgs e) { Janus.Windows.GridEX.GridEXSelectedItem col = this.gridDetalleConversion.SelectedItems[0]; Janus.Windows.GridEX.GridEXRow row = col.GetRow(); row.Cells["IdConversion"].Value = _idConversion; row.Cells["Ordinal"].Value = gridDetalleConversion.RecordCount; row.Cells["FechaCreacion"].Value = mz.erp.businessrules.Sistema.DateTime.Now; row.Cells["IdConexionCreacion"].Value = Security.IdConexion; row.Cells["IdConexionUltimaModificacion"].Value = Security.IdConexion; row.Cells["IdReservado"].Value = 0; row.Cells["RowId"].Value = Guid.Empty; row.Cells["IdEmpresa"].Value = Security.IdEmpresa; row.Cells["IdSucursal"].Value = Security.IdSucursal; if (row.Cells["IdSucursal"].Value == null) { row.Cells["IdSucursal"].Value = false; } }
private void DeleteFiles() { if (this.grdFiles.GetCheckedRows().Length == 0) { XMessageBox.ShowError("请选择要删除的记录!"); return; } IList <XModelBase> deletedModels = new List <XModelBase>(); foreach (Janus.Windows.GridEX.GridEXRow gridExRow in this.grdFiles.GetCheckedRows()) { XModelBase model = gridExRow.DataRow as XModelBase; XTaskFilesInfo taskFilesInfo = model as XTaskFilesInfo; if (taskFilesInfo.InputUserId != XCommon.LoginUsersInfo.RID) { XMessageBox.ShowError("不能删除非本人提交的任务文档!"); return; } deletedModels.Add(model); } if (this.m_TaskFilesBusiness.Delete(deletedModels, XCommon.LoginUsersInfo.RID)) { XMessageBox.ShowRemindMessage("删除成功!"); IList <XModelBase> modelLists = this.grdFiles.DataSource as IList <XModelBase>; foreach (XModelBase model in deletedModels) { Janus.Windows.GridEX.GridEXRow row = this.grdFiles.GetRow(model); row.Delete(); modelLists.Remove(model); } } else { XMessageBox.ShowError("删除失败!"); } }
void MP_MostrarFrmAyuda() { MODEL.ModeloAyuda frmAyuda = new MODEL.ModeloAyuda(Alto, Ancho, Tabla, Context.ToUpper(), listaCelda); if (SelectCol >= 0) { frmAyuda.Columna = SelectCol; frmAyuda.MP_Seleccionar(); } frmAyuda.ShowDialog(); if (frmAyuda.seleccionado) { Row = frmAyuda.filaSelect; Band = true; this.Close(); } else { Band = false; this.Close(); } }
/* * private void gridEX1_CellUpdated(object sender, Janus.Windows.GridEX.ColumnActionEventArgs e) * { * gridEX1.Refresh(); * } */ private void gridEX1_SelectionChanged(object sender, EventArgs e) { bool ok = false; if (gridEX1.SelectedItems.Count > 0 && gridEX1.SelectedItems[0].RowType.Equals(Janus.Windows.GridEX.RowType.Record)) { gridEXValores.Refetch(); object selected = gridEX1.SelectedItems[0].GetRow().DataRow; ArrayList valores = _uiController.GetValores(selected); foreach (object valor in valores) { Janus.Windows.GridEX.GridEXRow row = gridEXValores.GetRow(valor); if (row != null) { Janus.Windows.GridEX.GridEXFormatStyle rowStyle = new Janus.Windows.GridEX.GridEXFormatStyle(); rowStyle.BackColor = System.Drawing.Color.Red; row.RowStyle = rowStyle; } } } }
private void gridEX_SelectionChanged(object sender, EventArgs e) { int countItems = this.gridEXNotification.SelectedItems.Count; try { if (countItems > 0) { if (countItems == 1) { Janus.Windows.GridEX.GridEXRow ger = gridEXNotification.CurrentRow; this.lblSubject.Text = ger.Cells["Subject"].Value.ToString(); DateTime dateTime = (DateTime)ger.Cells["StartDateLocal"].Value; if (currentFM.AppMan.Language.ToUpper() == "ENG") { this.lblStartDate.Text = dateTime.ToString("MMMM dd, yyyy @ hh:mm tt", System.Globalization.CultureInfo.CreateSpecificCulture("en-CA")); } else { this.lblStartDate.Text = dateTime.ToString("dd MMMM yyyy à HH:mm", System.Globalization.CultureInfo.CreateSpecificCulture("fr-CA")); } } else { this.lblSubject.Text = countItems.ToString() + " " + Properties.Resources.ResxRemindersSelected; this.lblStartDate.Text = ""; //if (currentFM.AppMan.Language.ToUpper() == "ENG") // this.lblSubject.Text = countItems.ToString() + " reminders are selected"; //else // this.lblSubject.Text = countItems.ToString() + " rappels sont sélectionnés"; } } } catch (Exception x) { UIHelper.HandleUIException(x); } }
private DataTable cargarTabla(DataTable dataTable, Janus.Windows.GridEX.GridEX _grilla) { /*Janus.Windows.GridEX.GridEXRow[] todasRows=_grilla.GetRows(); * foreach (Janus.Windows.GridEX.GridEXRow row in todasRows) * { * //Esto seria los valores encabezados del grupo entonces sacar los valores para las colum agrup * Janus.Windows.GridEX.GridEXRow prueba=row; * if(prueba.RowType == Janus.Windows.GridEX.RowType.GroupHeader) * { * * DataRow fila=dataTable.NewRow(); * foreach (string s in ColumnasGrupo) * { * fila[s]=prueba.GroupCaption; * prueba=row.GetChildRows()[0]; * } * //No hay mas groupsHeader ahora tengo q totalizar el grupo :S, pipi * foreach (string s1 in ColumnasTotales) * { * if(prueba.RowType== Janus.Windows.GridEX.RowType.GroupHeader) * fila[s1]=prueba.GetSubTotal(_grilla.RootTable.Columns[s1],Janus.Windows.GridEX.AggregateFunction.Sum); * else * fila[s1]=prueba.Parent.GetSubTotal(_grilla.RootTable.Columns[s1],Janus.Windows.GridEX.AggregateFunction.Sum); * } * dataTable.Rows.Add(fila); * } * * * } * return dataTable;*/ Janus.Windows.GridEX.GridEXRow[] todasRows = _grilla.GetRows(); foreach (Janus.Windows.GridEX.GridEXRow row in todasRows) { //Esto seria los valores encabezados del grupo entonces sacar los valores para las colum agrup Janus.Windows.GridEX.GridEXRow prueba = row; DataRow fila = dataTable.NewRow(); recorrerGrillaCargandoInfo(prueba, dataTable, _grilla, ""); } return(dataTable); }
private void activityBFGridEX_MouseMove(object sender, MouseEventArgs e) { try { Janus.Windows.GridEX.GridArea hitTest = activityBFGridEX.HitTest(e.X, e.Y); int rowPos = activityBFGridEX.RowPositionFromPoint(); Janus.Windows.GridEX.GridEXRow ger = activityBFGridEX.GetRow(rowPos); Janus.Windows.GridEX.GridEXColumn gec = activityBFGridEX.ColumnFromPoint(e.X, e.Y); if (ger != null && ger.RowType == Janus.Windows.GridEX.RowType.Record && gec != null && gec.Key == "StepCode" && showTooltip) { ToolTipRow = ger; } else { ToolTipRow = null; } } catch (Exception x) { UIHelper.HandleUIException(x); } }
private void recorrerGrillaCargandoInfo(Janus.Windows.GridEX.GridEXRow prueba, DataTable tabla, Janus.Windows.GridEX.GridEX _grilla, string caption) { /* Silvina 20101118 - Tarea 931 */ //caption = caption + prueba.GroupCaption + ','; caption = caption + prueba.GroupCaption.Replace(',', '.') + ','; /* Fin Silvina */ ArrayList colGrupos = mz.erp.systemframework.Util.Parse(caption); if (!hijasGrupo(prueba)) { DataRow fila = tabla.NewRow(); foreach (string s1 in ColumnasTotales) { if (!this.ColumnasGrupo.Contains(s1)) { fila[s1] = prueba.GetSubTotal(_grilla.RootTable.Columns[s1], Janus.Windows.GridEX.AggregateFunction.Sum); } } int i = 0; foreach (string s in colGrupos) { if (!s.Equals(string.Empty)) { fila[i] = s; i++; } } tabla.Rows.Add(fila); } else { foreach (Janus.Windows.GridEX.GridEXRow row in prueba.GetChildRows()) { recorrerGrillaCargandoInfo(row, tabla, _grilla, caption); } } }
private void _grilla_FormattingRow(object sender, Janus.Windows.GridEX.RowLoadEventArgs e) { Janus.Windows.GridEX.GridEXRow row = e.Row; if (row.RowType == Janus.Windows.GridEX.RowType.Record) { foreach (ConfiguracionStyleGrilla.ConfiguracionGrillaEstilosCondicionalesDet conf in _configuracionDet) { string key = conf.Columna.Name; string cond = conf.Condicion; Janus.Windows.GridEX.GridEXCell cell1 = row.Cells[key]; Janus.Windows.GridEX.GridEXColumn col2 = (Janus.Windows.GridEX.GridEXColumn)conf.Valor; Janus.Windows.GridEX.GridEXCell cell2 = row.Cells[col2.Key]; object valorCol1 = cell1.Value; object valorCol2 = cell2.Value; bool satisfaceCondicion = false; string type = conf.Columna.Type; switch (cond) { case ">": { switch (type) { case "DECIMAL": decimal val1D = (decimal)valorCol1; decimal val2D = (decimal)valorCol2; satisfaceCondicion = val1D > val2D; break; case "INT": int val1I = (int)valorCol1; int val2I = (int)valorCol2; satisfaceCondicion = val1I > val2I; break; case "DATETIME": DateTime val1DT = (DateTime)valorCol1; DateTime val2DT = (DateTime)valorCol2; satisfaceCondicion = val1DT > val2DT; break; } break; } case "<": { switch (type) { case "DECIMAL": decimal val1D = (decimal)valorCol1; decimal val2D = (decimal)valorCol2; satisfaceCondicion = val1D < val2D; break; case "INT": int val1I = (int)valorCol1; int val2I = (int)valorCol2; satisfaceCondicion = val1I < val2I; break; case "DATETIME": DateTime val1DT = (DateTime)valorCol1; DateTime val2DT = (DateTime)valorCol2; satisfaceCondicion = val1DT < val2DT; break; } break; } case "=": { switch (type) { case "DECIMAL": decimal val1D = (decimal)valorCol1; decimal val2D = (decimal)valorCol2; satisfaceCondicion = val1D == val2D; break; case "INT": int val1I = (int)valorCol1; int val2I = (int)valorCol2; satisfaceCondicion = val1I == val2I; break; case "DATETIME": DateTime val1DT = (DateTime)valorCol1; DateTime val2DT = (DateTime)valorCol2; satisfaceCondicion = val1DT == val2DT; break; case "STRING": string val1S = (string)valorCol1; string val2S = (string)valorCol2; satisfaceCondicion = val1S == val2S; break; case "BOOL": bool val1B = (bool)valorCol1; bool val2B = (bool)valorCol2; satisfaceCondicion = val1B == val2B; break; } break; } case ">=": { switch (type) { case "DECIMAL": decimal val1D = (decimal)valorCol1; decimal val2D = (decimal)valorCol2; satisfaceCondicion = val1D >= val2D; break; case "INT": int val1I = (int)valorCol1; int val2I = (int)valorCol2; satisfaceCondicion = val1I >= val2I; break; case "DATETIME": DateTime val1DT = (DateTime)valorCol1; DateTime val2DT = (DateTime)valorCol2; satisfaceCondicion = val1DT >= val2DT; break; } break; } case "<=": { switch (type) { case "DECIMAL": decimal val1D = (decimal)valorCol1; decimal val2D = (decimal)valorCol2; satisfaceCondicion = val1D <= val2D; break; case "INT": int val1I = (int)valorCol1; int val2I = (int)valorCol2; satisfaceCondicion = val1I <= val2I; break; case "DATETIME": DateTime val1DT = (DateTime)valorCol1; DateTime val2DT = (DateTime)valorCol2; satisfaceCondicion = val1DT <= val2DT; break; } break; } case "!=": { switch (type) { case "DECIMAL": decimal val1D = (decimal)valorCol1; decimal val2D = (decimal)valorCol2; satisfaceCondicion = val1D != val2D; break; case "INT": int val1I = (int)valorCol1; int val2I = (int)valorCol2; satisfaceCondicion = val1I != val2I; break; case "DATETIME": DateTime val1DT = (DateTime)valorCol1; DateTime val2DT = (DateTime)valorCol2; satisfaceCondicion = val1DT != val2DT; break; case "STRING": string val1S = (string)valorCol1; string val2S = (string)valorCol2; satisfaceCondicion = val1S != val2S; break; case "BOOL": bool val1B = (bool)valorCol1; bool val2B = (bool)valorCol2; satisfaceCondicion = val1B != val2B; break; } break; } case "like": { switch (type) { case "STRING": string val1D = (string)valorCol1; string val2D = (string)valorCol2; satisfaceCondicion = val1D.IndexOf(val2D) != -1; break; } break; } } if (satisfaceCondicion) { Janus.Windows.GridEX.GridEXFormatStyle fs = conf.Estilo.ToFormatStyle(); row.RowStyle = fs; } } } }
private bool hijasGrupo(Janus.Windows.GridEX.GridEXRow row) { Janus.Windows.GridEX.GridEXRow[] hijas = row.GetChildRows(); return(hijas[0].RowType == Janus.Windows.GridEX.RowType.GroupHeader); }
private void gridStandar_AddingRecord(object sender, CancelEventArgs e) { //Sabrina 20100618 - Tarea 787 DataTable table = ( DataTable )gridStandar.DataSource; DataColumn[] clave = table.PrimaryKey; ArrayList nombresColumnasClaves = new ArrayList(); for (int i = 0; i < clave.Length; i++) { DataColumn c = (DataColumn)clave[i]; nombresColumnasClaves.Add(c.ColumnName); } //Fin Sabrina 20100618 - Tarea 787 Janus.Windows.GridEX.GridEXSelectedItem col = gridStandar.SelectedItems[0]; Janus.Windows.GridEX.GridEXRow row = col.GetRow(); if (row.Table != null) { foreach (Janus.Windows.GridEX.GridEXColumn columns in row.Table.Columns) { //Sabrina 20100618 - Tarea 787 foreach (string nombreColumna in nombresColumnasClaves) { if (row.Cells[nombreColumna].Value == System.DBNull.Value) { if (table.Columns[nombreColumna].DataType.Equals(System.Type.GetType("System.String"))) { row.Cells[nombreColumna].Value = systemframework.Util.NewStringId(); } if (table.Columns[nombreColumna].DataType.Equals(System.Type.GetType("System.Guid"))) { row.Cells[nombreColumna].Value = Guid.Empty; } } } if (columns.Key.Equals("Activo") && row.Cells["Activo"].Value == System.DBNull.Value) { row.Cells["Activo"].Value = false; } if (columns.Key.Equals("IdEmpresa") && row.Cells["IdEmpresa"].Value == System.DBNull.Value) { row.Cells["IdEmpresa"].Value = Security.IdEmpresa; } if (columns.Key.Equals("IdSucursal") && row.Cells["IdSucursal"].Value == System.DBNull.Value) { row.Cells["IdSucursal"].Value = Security.IdSucursal; } if (columns.Key.Equals("isDefault") && row.Cells["isDefault"].Value == System.DBNull.Value) { row.Cells["isDefault"].Value = false; } //Fin Sabrina 20100618 - Tarea 787 if (columns.Key.Equals("FechaCreacion")) { row.Cells["FechaCreacion"].Value = mz.erp.businessrules.Sistema.DateTime.Now; } if (columns.Key.Equals("IdConexionCreacion")) { row.Cells["IdConexionCreacion"].Value = Security.IdConexion; } if (columns.Key.Equals("IdConexionUltimaModificacion")) { row.Cells["IdConexionUltimaModificacion"].Value = Security.IdConexion; } if (columns.Key.Equals("IdReservado")) { row.Cells["IdReservado"].Value = 0; } if (columns.Key.Equals("RowId")) { row.Cells["RowId"].Value = Guid.Empty; } /* Silvina 20110504 - Tarea 0000123 */ if (columns.Key.Equals("BaseDeDatos")) { row.Cells["BaseDeDatos"].Value = _baseDefault; } /* Fin Silvina 20110504 - Tarea 0000123 */ //German 20110602 - Tarea 0000149 if (columns.Key.Equals("FechaInicio")) { row.Cells["FechaInicio"].Value = mz.erp.businessrules.Sistema.DateTime.Now; } //Fin German 20110602 - Tarea 0000149 } } }
private void activityBFGridEX_MouseLeave(object sender, EventArgs e) { ToolTipRow = null; }