FORM INTIAT
dataTable2.Columns.Add("Clash Test");
dataTable2.Columns.Add("Clash Name");
dataTable2.Columns.Add("From");
dataTable2.Columns.Add("TO");
قبل التيم ايفينت
DataTable dataTable2 = new DataTable();
List<ClashData> LN1 = new List<ClashData>();
var dataFromXml2233 = from clashTestsHeader in xDocument.Descendants("clashtest")
select new
{
test = clashTestsHeader.Attribute("name").Value,
clashName =
clashTestsHeader.Elements("clashresults").Elements("clashresult"),
clashName1 = clashTestsHeader,
clashpointx =
clashTestsHeader.Elements("clashresults").Elements("clashresult").Elements("clashpo
int").Elements("pos3f"),
clashpointy =
clashTestsHeader.Elements("clashresults").Elements("clashresult").Elements("clashpo
int").Elements("pos3f"),
handleId =
clashTestsHeader.Elements("clashresults").Elements("clashresult").Elements("clashob
jects").Elements("clashobject").Elements("objectattribute").Elements("value"),
status =
clashTestsHeader.Elements("clashresults").Elements("clashresult").Elements("results
tatus"),
Comment =
clashTestsHeader.Elements("clashresults").Elements("clashresult").Elements("comment
s").Elements("comment").Elements("body"),
File =
clashTestsHeader.Elements("clashresults").Elements("clashresult").Elements("clashob
jects").Elements("clashobject").Elements("pathlink").Elements("node"),
//user =
clashTestsHeader.Elements("clashresults").Elements("clashresult").Elements("comment
s").Elements("comment").Elements("user"),
//id =
clashTestsHeader.Elements("clashresults").Elements("clashresult").Elements("comment
s").Elements("comment").Attributes("id"),
//statusc =
clashTestsHeader.Elements("clashresults").Elements("clashresult").Elements("comment
s").Elements("comment").Attributes("status"),
};
foreach (var lv1 in dataFromXml2233)
{
//Test test = new Test();
//test.DataTableDataTable = test.createDatatabl(lv1.test);
for (int i = 0; i < lv1.clashName.Count(); i++)
{
ClashData clashData = new ClashData();
//DataTable dataTable = new DataTable();
//dataTable.TableName = lv1.test +
lv1.clashName.ElementAt(i).Attribute("name").Value;
//dataTable.Columns.Add("ID");
//dataTable.Columns.Add("Comment");
//dataTable.Columns.Add("User");
//foreach (var item in lv1.Comment)
//{
// DataRow row1 = dataTable.NewRow();
// if (item.Parent.Parent.Parent.Attribute("name").Value ==
lv1.clashName.ElementAt(i).Attribute("name").Value &&
item.Parent.Parent.Parent.Parent.Parent.Attribute("name").Value == lv1.test)
// {
// dataTable.Rows.Add(item.Parent.FirstAttribute.Value,
item.Value, item.ElementsBeforeSelf("user").ElementAt(0).Value);
// }
//}
//tables.Add(dataTable);
clashData.Item1 = lv1.File.Where(dt =>
dt.Parent.Parent.Parent.Parent.FirstAttribute.Value ==
lv1.clashName.ElementAt(i).Attribute("name").Value).ElementAt(2).Value;
clashData.Item2 = lv1.File.Where(dt =>
dt.Parent.Parent.Parent.Parent.FirstAttribute.Value ==
lv1.clashName.ElementAt(i).Attribute("name").Value).ElementAt(7).Value;
clashData.clashtests = lv1.test;
clashData.ClashName =
lv1.clashName.ElementAt(i).Attribute("name").Value;
clashData.Status = lv1.status.ElementAt(i).Value;
clashData.PointX =
lv1.clashpointx.ElementAt(i).Attribute("x").Value;
clashData.PointY =
lv1.clashpointy.ElementAt(i).Attribute("y").Value;
clashData.ItemHandle1 = lv1.handleId.Where(dt =>
dt.Parent.Parent.Parent.Parent.FirstAttribute.Value ==
lv1.clashName.ElementAt(i).Attribute("name").Value).First().Value;
clashData.ItemHandle2 = lv1.handleId.Where(dt =>
dt.Parent.Parent.Parent.Parent.FirstAttribute.Value ==
lv1.clashName.ElementAt(i).Attribute("name").Value).Last().Value;
//clashData.Comment = lv1.Comment.ElementAt(i).Value;
clashData.Comment = lv1.Comment.Where(t =>
t.Parent.Parent.Parent.Attribute("name").Value ==
lv1.clashName.ElementAt(i).Attribute("name").Value).Count().ToString();
//test.clashDatas.Add(clashData);
//clashData.Comment= lv1.Comment.ElementAt(i).Value;
LN1.Add(clashData);
// DataRow row = test.DataTableDataTable.NewRow();
// test.DataTableDataTable.Rows.Add(clashData.clashtests,
clashData.ClashName, clashData.ItemHandle1, clashData.ItemHandle2,
clashData.PointX, clashData.PointY, clashData.Status, clashData.Comment,
clashData.Item1, clashData.Item2);
}
//Data1.Add(test.DataTableDataTable);
//accordionControl1.SelectElement(accordionControl1.Elements.Where(d=>d.Name=="STRE
ET LIGHTeeeeING VS TREES").FirstOrDefault());
//accordionControl1.Elements.Where(d => d.Name == "STREET LIGHTeeeeING
VS TREES").FirstOrDefault().Style=accordionco
//if (vv)
//{
// listcompary = clashes;
//}
var CHANGES= clashes.Where(item1 =>
LN1.Any(item2 => item1.clashtests == item2.clashtests
&& item1.ClashName == item2.ClashName && item1.Status !=
item2.Status)).ToList();
dataTable2.Clear();
DataRow row = dataTable2.NewRow();
foreach (var item in CHANGES)
{
dataTable2.Rows.Add(clashes.Where(d=>d.clashtests==item.clashtests).Where(d=>d.Clas
hName==item.ClashName).FirstOrDefault().clashtests, clashes.Where(d => d.clashtests
== item.clashtests).Where(d => d.ClashName ==
item.ClashName).FirstOrDefault().ClashName, clashes.Where(d => d.clashtests ==
item.clashtests).Where(d => d.ClashName == item.ClashName).FirstOrDefault().Status,
LN1.Where(d => d.clashtests == item.clashtests).Where(d => d.ClashName ==
item.ClashName).FirstOrDefault().Status);
}
private void alertControl1_AlertClick(object sender, AlertClickEventArgs e)
{
XtraForm7 xtraForm7 = new XtraForm7();
xtraForm7.gridControl1.DataSource = dataTable2;
xtraForm7.Show();
}
List<DateTime> us = new List<DateTime>();
foreach (var item in dataFromXml22)
{
us.Add(DateTime.Parse( item.Attribute("sync").Value));
}
alertControl1.Show(this, "Data Updated", "Please sync \n" +
CHANGES.Count.ToString() + " New Changes" + "\n Last Sync By " +
dataFromXml22.Where(d => d.Attribute("sync").Value ==
max.ToString()).FirstOrDefault().Value);
private void gridView1_PopupMenuShowing(object sender, PopupMenuShowingEventArgs
e)
{
if (e.MenuType == DevExpress.XtraGrid.Views.Grid.GridMenuType.Column)
{
e.Menu.Items[GridLocalizer.Active.GetLocalizedString(GridStringId.MenuColumnAutoFil
terRowShow)].Visible = false;
}
}
FileInfo file1 = new FileInfo(ff);
if (file1.Exists)
{
pictureBox1.Image = System.Drawing.Image.FromFile(ff);
private void xrChart1_CustomDrawSeries(object sender, CustomDrawSeriesEventArgs
e)
{
e.Series.Label.TextPattern = "{A}\n{V} Clashes\n{VP:P0}";
}