Exemplo n.º 1
0
        private void barAdd1item_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (treeList1.FocusedNode == null)
                return;
            string uid = treeList1.FocusedNode["UID"].ToString();

            EconomyAnalysis obj = new EconomyAnalysis();
            obj.UID = Guid.NewGuid().ToString() + "|" + ProjectUID;
            obj.Contents = bts;
            obj.ParentID = uid;
            obj.CreateDate = DateTime.Now;
            FrmEconomyAnalysisDialog dlg = new FrmEconomyAnalysisDialog();
            dlg.Object = obj;
            dlg.IsCreate = true;

            if (dlg.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            dataTable.Rows.Add(DataConverter.ObjectToRow(obj, dataTable.NewRow()));
            //InitData1();
            MsgTitle();
            fpSpread1.Sheets[7].Cells[14, 1].Text = "��������˰�Ӽ�(�����ڼ䣩";
            fpSpread1.Sheets[7].Cells[15, 1].Text = "��������˰�Ӽ�(������";
        }
Exemplo n.º 2
0
        private void barEdititem_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (treeList1.FocusedNode == null)
                return;

            if (treeList1.FocusedNode.ParentNode == null)
                return;

            string uid = treeList1.FocusedNode["UID"].ToString();
            EconomyAnalysis obj = Services.BaseService.GetOneByKey<EconomyAnalysis>(uid);

            EconomyAnalysis objCopy = new EconomyAnalysis();
            DataConverter.CopyTo<EconomyAnalysis>(obj, objCopy);

            FrmEconomyAnalysisDialog dlg = new FrmEconomyAnalysisDialog();
            dlg.Object = objCopy;

            if (dlg.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            DataConverter.CopyTo<EconomyAnalysis>(objCopy, obj);
            treeList1.FocusedNode.SetValue("Title", obj.Title);
        }