private void CmpUnitGridView_ValidatingEditor(object sender, DevExpress.XtraEditors.Controls.BaseContainerValidateEditorEventArgs e) { CmpUnitGridView.CloseEditor(); CmpUnitGridView.UpdateCurrentRow(); HOSale(); }
private void FrmSaleReportF2_Load(object sender, EventArgs e) { ProjectFunctions.ToolStripVisualize(Menu_ToolStrip); DataSet dsCmp = ProjectFunctions.GetDataSet("select COMNAME from COMCONF "); if (dsCmp.Tables[0].Rows.Count > 0) { CmpGrid.DataSource = dsCmp.Tables[0]; CmpGridView.BestFitColumns(); } else { CmpGrid.DataSource = null; CmpGridView.BestFitColumns(); } DataSet dsHOTag = ProjectFunctions.GetDataSet("Select ISNULL(HOTag,'N') as HOTag from UNITS"); if (dsHOTag.Tables[0].Rows.Count > 0) { HOTAG = dsHOTag.Tables[0].Rows[0][0].ToString(); } if (HOTAG == "Y") { DataSet dsUnits = ProjectFunctions.GetDataSet("select UNITNAME,UNITID from units"); if (dsUnits.Tables[0].Rows.Count > 0) { dsUnits.Tables[0].Columns.Add("Select", typeof(bool)); foreach (DataRow dr in dsUnits.Tables[0].Rows) { dr["Select"] = true; } CmpUnitGrid.DataSource = dsUnits.Tables[0]; CmpUnitGridView.BestFitColumns(); } else { CmpUnitGrid.DataSource = null; CmpUnitGridView.BestFitColumns(); } } else { DataSet dsUnits = ProjectFunctions.GetDataSet("select UNITNAME,UNITID from units where UnitCode='" + Convert.ToInt32(GlobalVariables.CUnitID) + "'"); if (dsUnits.Tables[0].Rows.Count > 0) { dsUnits.Tables[0].Columns.Add("Select", typeof(bool)); foreach (DataRow dr in dsUnits.Tables[0].Rows) { dr["Select"] = true; } CmpUnitGrid.DataSource = dsUnits.Tables[0]; CmpUnitGridView.BestFitColumns(); } else { CmpUnitGrid.DataSource = null; CmpUnitGridView.BestFitColumns(); } } HOSale(); }