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

            PspType objCopy = new PspType();

            DataConverter.CopyTo <PspType>(obj, objCopy);

            FrmPspTypeDialog dlg = new FrmPspTypeDialog();

            dlg.Text   = progName;
            dlg.Object = objCopy;

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

            DataConverter.CopyTo <PspType>(objCopy, obj);
            treeList1.FocusedNode.SetValue("Title", obj.Title);
        }
Example #2
0
        private void barAdd1item_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (treeList1.FocusedNode == null)
            {
                return;
            }
            string uid = treeList1.FocusedNode["UID"].ToString();


            PspType obj = new PspType();

            obj.UID        = obj.UID + "|" + ProjectUID;
            obj.Contents   = bts;
            obj.ParentID   = uid;
            obj.CreateDate = DateTime.Now;
            obj.Col1       = progName;
            FrmPspTypeDialog dlg = new FrmPspTypeDialog();

            dlg.Text     = progName;
            dlg.Object   = obj;
            dlg.IsCreate = true;

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

            dataTable.Rows.Add(DataConverter.ObjectToRow(obj, dataTable.NewRow()));
        }
Example #3
0
        private void barAdditem_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            PspType obj = new PspType();

            obj.Contents   = bts;
            obj.ParentID   = "";
            obj.CreateDate = DateTime.Now;
            obj.Col1       = progName;
            FrmPspTypeDialog dlg = new FrmPspTypeDialog();

            dlg.Text     = progName;
            dlg.Object   = obj;
            dlg.IsCreate = true;

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

            string uid = treeList1.FocusedNode["UID"].ToString();

            uid1 = uid;
            PspType obj1 = Services.BaseService.GetOneByKey <PspType>(uid);

            WaitDialogForm wait = null;

            try
            {
                wait = new WaitDialogForm("", "正在加载数据, 请稍候...");
                System.IO.MemoryStream ms = new System.IO.MemoryStream(obj1.Contents);
                //  by1 = obj.Contents;
                string str = "";
                str = filename;
                string fname = filepath + Guid.NewGuid().ToString() + ".xls";
                filename = fname;
                dsoExcelControl1.saveStreamFile(fname, ms.ToArray());
                dsoExcelControl1.FileOpen(fname);
                //  dsoExcelControl1.FileNew();
                dsoExcelControl1.AxFramerControl.Titlebar = false;
                dsoExcelControl1.Onisdispalymenubar(false);
                dsoExcelControl1.Onisdispalytoolbar(false);
                if (File.Exists(str))
                {
                    File.Delete(str);
                }
                //  fpSpread1.Open(ms);
                wait.Close();

                //fpSpread1.ActiveSheet.Columns[0, fpSpread1.ActiveSheet.Columns.Count - 1].AllowAutoFilter = true;//查询
                //fpSpread1.Sheets[0].SetColumnAllowAutoSort(-1, true);//排序
            }
            catch { wait.Close(); }


            dataTable.Rows.Add(DataConverter.ObjectToRow(obj, dataTable.NewRow()));
        }
Example #4
0
        private void barAdd1item_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (treeList1.FocusedNode == null)
            {
                return;
            }
            string uid = treeList1.FocusedNode["UID"].ToString();

            PspType obj = new PspType();

            obj.UID        = obj.UID + "|" + ProjectUID;
            obj.Contents   = bts;
            obj.ParentID   = uid;
            obj.CreateDate = DateTime.Now;
            obj.Col1       = ProjectUID;
            FrmPspTypeDialog dlg = new FrmPspTypeDialog();

            dlg.Text     = progName;
            dlg.Object   = obj;
            dlg.IsCreate = true;

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

            try
            {
                wait = new WaitDialogForm("", "正在加载数据, 请稍候...");
                //System.IO.MemoryStream ms = new System.IO.MemoryStream(obj1.Contents);
                ////  by1 = obj.Contents;
                string str = "";
                str = filename;
                string fname = filepath + Guid.NewGuid().ToString() + ".xls";
                filename = fname;
                dsoExcelControl1.AxFramerControl.Save(fname, false, null, null);
                //dsoExcelControl1.FileOpen(fname);

                //dsoExcelControl1.AxFramerControl.Titlebar = false;
                //dsoExcelControl1.Onisdispalymenubar(false);
                //dsoExcelControl1.Onisdispalytoolbar(false);

                wait.Close();
            }
            catch { wait.Close(); }
            dataTable.Rows.Add(DataConverter.ObjectToRow(obj, dataTable.NewRow()));
        }
Example #5
0
        private void barAdd1item_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (treeList1.FocusedNode == null)
                return;
            string uid = treeList1.FocusedNode["UID"].ToString();

            PspType obj = new PspType();
            obj.UID = obj.UID + "|" + ProjectUID ;
            obj.Contents = bts;
            obj.ParentID = uid;
            obj.CreateDate = DateTime.Now;
            obj.Col1 = progName;
            FrmPspTypeDialog dlg = new FrmPspTypeDialog();
            dlg.Text = progName;
            dlg.Object = obj;
            dlg.IsCreate = true;

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

            dataTable.Rows.Add(DataConverter.ObjectToRow(obj, dataTable.NewRow()));
        }
Example #6
0
        private void barEdititem_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (treeList1.FocusedNode == null)
                return;
            string uid = treeList1.FocusedNode["UID"].ToString();
            PspType obj = Services.BaseService.GetOneByKey<PspType>(uid);

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

            FrmPspTypeDialog dlg = new FrmPspTypeDialog();
            dlg.Text = progName;
            dlg.Object = objCopy;

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

            DataConverter.CopyTo<PspType>(objCopy, obj);
            treeList1.FocusedNode.SetValue("Title", obj.Title);
        }
Example #7
0
        private void barAdditem_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            PspType obj = new PspType();
            obj.Contents = bts;
            obj.ParentID = "";
            obj.CreateDate = DateTime.Now;
            obj.Col1 = progName;
            FrmPspTypeDialog dlg = new FrmPspTypeDialog();
            dlg.Text = progName;
            dlg.Object = obj;
            dlg.IsCreate = true;

            if (dlg.ShowDialog() != DialogResult.OK)
            {

                return;
            }

            string uid = treeList1.FocusedNode["UID"].ToString();
            uid1 = uid;
            PspType obj1 = Services.BaseService.GetOneByKey<PspType>(uid);

            WaitDialogForm wait = null;
            try
            {
                wait = new WaitDialogForm("", "���ڼ�������, ���Ժ�...");
                System.IO.MemoryStream ms = new System.IO.MemoryStream(obj1.Contents);
              //  by1 = obj.Contents;
                string str = "";
                str = filename;
                string fname = filepath + Guid.NewGuid().ToString() + ".xls";
                filename = fname;
                dsoExcelControl1.saveStreamFile(fname, ms.ToArray());
                dsoExcelControl1.FileOpen(fname);
              //  dsoExcelControl1.FileNew();
                dsoExcelControl1.AxFramerControl.Titlebar = false;
                dsoExcelControl1.Onisdispalymenubar(false);
                dsoExcelControl1.Onisdispalytoolbar(false);
                if (File.Exists(str))
                {
                    File.Delete(str);
                }
                //  fpSpread1.Open(ms);
                wait.Close();

                //fpSpread1.ActiveSheet.Columns[0, fpSpread1.ActiveSheet.Columns.Count - 1].AllowAutoFilter = true;//��ѯ
                //fpSpread1.Sheets[0].SetColumnAllowAutoSort(-1, true);//����

            }
            catch { wait.Close(); }

            dataTable.Rows.Add(DataConverter.ObjectToRow(obj, dataTable.NewRow()));
        }
Example #8
0
        private void barAdd1item_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (treeList1.FocusedNode == null)
                return;
            string uid = treeList1.FocusedNode["UID"].ToString();

            PspType obj = new PspType();
            obj.UID = obj.UID + "|" + ProjectUID;
            obj.Contents = bts;
            obj.ParentID = uid;
            obj.CreateDate = DateTime.Now;
            obj.Col1 = ProjectUID;
            FrmPspTypeDialog dlg = new FrmPspTypeDialog();
            dlg.Text = progName;
            dlg.Object = obj;
            dlg.IsCreate = true;

            if (dlg.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            WaitDialogForm wait = null;
            try
            {
                wait = new WaitDialogForm("", "���ڼ�������, ���Ժ�...");
                //System.IO.MemoryStream ms = new System.IO.MemoryStream(obj1.Contents);
                ////  by1 = obj.Contents;
                string str = "";
                str = filename;
                string fname = filepath + Guid.NewGuid().ToString() + ".xls";
                filename = fname;
                dsoExcelControl1.AxFramerControl.Save(fname, false, null, null);
                //dsoExcelControl1.FileOpen(fname);

                //dsoExcelControl1.AxFramerControl.Titlebar = false;
                //dsoExcelControl1.Onisdispalymenubar(false);
                //dsoExcelControl1.Onisdispalytoolbar(false);

                wait.Close();
            }
            catch { wait.Close(); }
            dataTable.Rows.Add(DataConverter.ObjectToRow(obj, dataTable.NewRow()));
        }