示例#1
0
        private void barEdititem_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (treeList1.FocusedNode == null)
                return;
            string uid = treeList1.FocusedNode["UID"].ToString();
            LayoutContentANTL obj = Services.BaseService.GetOneByKey<LayoutContentANTL>(uid);

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

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

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

            DataConverter.CopyTo<LayoutContentANTL>(objCopy, obj);
            treeList1.FocusedNode.SetValue("ChapterName", obj.ChapterName);
            treeList1.FocusedNode.SetValue("Remark", obj.Remark);
        }
示例#2
0
        private void InitExe(string parentid, System.Data.DataTable dts, IList<LayoutContentANTL> ls)
        {
            DataRow[] rows = dts.Select(string.Format("parentid='{0}'", parentid));

            foreach (DataRow row in rows)
            {
                LayoutContentANTL lc = new LayoutContentANTL();
                lc.ChapterName = row["ChapterName"].ToString();
                try
                {
                    if (row["Contents"] != DBNull.Value)
                    {
                        byte[] bt = null;
                        try { bt = (byte[])row["Contents"]; }
                        catch { }
                        if (bt != null)
                        {
                            //ls.Add(bt);
                            lc.Contents = bt;
                        }
                    }

                }
                catch (Exception ex)
                {
                }
                ls.Add(lc);
                InitExe(row["UID"].ToString(), dts, ls);
            }
        }
示例#3
0
        private void barAdditem_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            //����ͬ��Ŀ¼
            string parentid = "";
            if (treeList1.FocusedNode != null)
            {
                parentid = treeList1.FocusedNode["ParentID"].ToString();
            }

            LayoutContentANTL obj = new LayoutContentANTL();
            obj.UID = obj.UID + "|" + Itop.Client.MIS.ProgUID;
            obj.LayoutID = layoutUID;
            obj.ParentID = parentid;
            obj.CreateDate = DateTime.Now;
            FrmLayoutContentDialogANTL dlg = new FrmLayoutContentDialogANTL();
            dlg.Object = obj;
            dlg.IsCreate = true;

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

            dataTable.Rows.Add(DataConverter.ObjectToRow(obj, dataTable.NewRow()));
        }