/// <summary> /// Helper routine for drawing picture in covered range of column Employees_Photo. /// </summary> void TableModel_QueryCoveredRange(object sender, GridQueryCoveredRangeEventArgs e) { GridTableModel model = (GridTableModel)sender; GridTable table = model.Table; if (e.RowIndex < table.DisplayElements.Count) { // Get the element displayed at the row Element el = table.DisplayElements[e.RowIndex]; // Check if element is a record (could also be a column header or group caption ...) if (Element.IsRecord(el) && el.ParentGroup != null) { GridTableCellStyleInfo style = model[e.RowIndex, e.ColIndex]; GridTableCellStyleInfoIdentity id = style.TableCellIdentity; // The cell identity contains column information. We check if the column is Employees_Photo if (id.Column != null && id.Column.MappingName == Employees_Photo) { Group group = el.ParentGroup; // Grouped by Customers_ContactName - Do not cover cells if not grouped by Employee ... if (group != null && group.CategoryColumns.Count > 0 && group.CategoryColumns[0].Name == Customers_ContactName) { int tablePos = table.DisplayElements.IndexOf(group); int firstRow = tablePos + 1; int lastRow = tablePos + group.GetVisibleCount() - 1; e.Range = GridRangeInfo.Cells(firstRow, e.ColIndex, lastRow, e.ColIndex); gridGroupingControl1.TableModel.CoveredRanges.Add(e.Range); e.Handled = true; } } } } }
private void OnRelease(GridTableModel item) { var action = new Proto.Action_ClickSkillIndex { MagicKey = item.MagicData.MagicKey }; var gate = UAppliaction.Singleton.GetGate() as BattleGate; if (gate == null) { return; } gate.SendAction(action); }
private void FillJournalDetails() { dgJOURNAL_DETAILS.Rows.Clear(); ConnectionToDB cnn = new ConnectionToDB(); DataTable dtJournal = cnn.GetDataTable("select " + " d.swid, CASE when(d.jour_value > 0) then d.jour_value else 0 end as \"مدين\" , " + "CASE when(d.jour_value < 0) then d.jour_value * -1 else 0 end as \" دائن\", " + " CASE when(d.jour_main_value > 0) then d.jour_main_value else jour_main_value * -1 end as \"المقابل\", " + " a.acc_no as \"رقم الحساب\", " + " a.acc_name as \"اسم الحساب\", " + " (select c.curr_name from currency c where c.swid = d.curr_id) as \" العملة\", " + " d.curr_price as \"سعر الصرف\", " + " (select cc.cost_center_name" + " from costcenter cc" + " where cc.swid = d.cost_center) as \"مركز الربحية\", " + " d.jour_details as \"ملاحظات\", " + "d.stat,to_char(d.created_date,'dd/mm/yyyy') as \" تاريخ الانشاء\", (select user_name from userinfo where swid=d.created_user) as \" المستخدم\"" + " from journal_details d, accounts a where d.acc_id = a.swid and d.stat = N'فعال' and d.jour_id = " + dgJourHeader[1, dgJourHeader.CurrentRow.Index].Value.ToString()); DataTable dtJournalHistory = cnn.GetDataTable("select " + " CASE when(d.jour_value > 0) then d.jour_value else 0 end as \" مدين\", " + "CASE when(d.jour_value < 0) then d.jour_value * -1 else 0 end as \" دائن\", " + " CASE when(d.jour_main_value > 0) then d.jour_value else jour_main_value * -1 end as \" المقابل\", " + " a.acc_no as \" رقم الحساب\", " + " a.acc_name as \" اسم الحساب\", " + " (select c.curr_name from currency c where c.swid = d.curr_id) as \" العملة\" , " + " d.curr_price as \" سعر الصرف\", " + " (select cc.cost_center_name" + " from costcenter cc" + " where cc.swid = d.cost_center) as \" مركز الربحية\", " + " d.jour_details as \" ملاحظات\" " + ",to_char(d.created_date,'dd/mm/yyyy') as \" تاريخ الانشاء\", (select user_name from userinfo where swid=d.created_user) as \"المستخدم\",d.JOURNAL_DETAILS_ID" + " from JOURNAL_DETAILS_HISTORY d, accounts a where d.acc_id = a.swid and d.jour_id = " + dgJourHeader[1, dgJourHeader.CurrentRow.Index].Value.ToString()); DataSet dsDataset = new DataSet(); //Add two DataTables in Dataset dsDataset.Tables.Add(dtJournal); dsDataset.Tables.Add(dtJournalHistory); DataRelation Datatablerelation = new DataRelation("DetailsMarks", dsDataset.Tables[0].Columns[0], dsDataset.Tables[1].Columns[11], true); dsDataset.Relations.Add(Datatablerelation); dgJOURNAL_DETAIL.DataSource = dsDataset.Tables[0]; dgJOURNAL_DETAILS.Columns[0].Visible = false; dgJOURNAL_DETAIL.ShowRowHeaders = false; dgJOURNAL_DETAIL.ShowRelationFields = Syncfusion.Grouping.ShowRelationFields.Hide; dgJOURNAL_DETAIL.TableDescriptor.VisibleColumns.Remove("SWID"); GridTableModel tableModel = this.dgJOURNAL_DETAIL.GetTableModel("dtJournalHistory"); //dgJOURNAL_DETAILS.Rows.Clear(); //for (int i = 0; i < dtJournal.Rows.Count; i++) //{ // dgJOURNAL_DETAILS.Rows.Add(); // dgJOURNAL_DETAILS[0, dgJOURNAL_DETAILS.Rows.Count - 1].Value = dtJournal.Rows[i]["swid"].ToString(); // dgJOURNAL_DETAILS[1, dgJOURNAL_DETAILS.Rows.Count - 1].Value = dtJournal.Rows[i]["credit"].ToString(); // dgJOURNAL_DETAILS[2, dgJOURNAL_DETAILS.Rows.Count - 1].Value = dtJournal.Rows[i]["dept"].ToString(); // dgJOURNAL_DETAILS[3, dgJOURNAL_DETAILS.Rows.Count - 1].Value = dtJournal.Rows[i]["jour_main_value"].ToString(); // dgJOURNAL_DETAILS[4, dgJOURNAL_DETAILS.Rows.Count - 1].Value = dtJournal.Rows[i]["acc_id"].ToString(); // dgJOURNAL_DETAILS[5, dgJOURNAL_DETAILS.Rows.Count - 1].Value = dtJournal.Rows[i]["acc_no"].ToString(); // dgJOURNAL_DETAILS[6, dgJOURNAL_DETAILS.Rows.Count - 1].Value = dtJournal.Rows[i]["acc_name"].ToString(); // dgJOURNAL_DETAILS[7, dgJOURNAL_DETAILS.Rows.Count - 1].Value = dtJournal.Rows[i]["curr_id"].ToString(); // dgJOURNAL_DETAILS[8, dgJOURNAL_DETAILS.Rows.Count - 1].Value = dtJournal.Rows[i]["curr_name"].ToString(); // dgJOURNAL_DETAILS[9, dgJOURNAL_DETAILS.Rows.Count - 1].Value = dtJournal.Rows[i]["curr_price"].ToString(); // dgJOURNAL_DETAILS[10, dgJOURNAL_DETAILS.Rows.Count - 1].Value = dtJournal.Rows[i]["cost_center"].ToString(); // dgJOURNAL_DETAILS[11, dgJOURNAL_DETAILS.Rows.Count - 1].Value = dtJournal.Rows[i]["costcenter_name"].ToString(); // dgJOURNAL_DETAILS[12, dgJOURNAL_DETAILS.Rows.Count - 1].Value = dtJournal.Rows[i]["jour_details"].ToString(); // dgJOURNAL_DETAILS[13, dgJOURNAL_DETAILS.Rows.Count - 1].Value = dtJournal.Rows[i]["stat"].ToString(); // dgJOURNAL_DETAILS[14, dgJOURNAL_DETAILS.Rows.Count - 1].Value = dtJournal.Rows[i]["created_date"].ToString(); // dgJOURNAL_DETAILS[15, dgJOURNAL_DETAILS.Rows.Count - 1].Value = dtJournal.Rows[i]["created_user"].ToString(); //} }