예제 #1
0
파일: BaseList.cs 프로젝트: pigeon79/GCore
        public virtual void Modify()
        {
            try
            {
                if (this.EditorT != null)
                {
                    DateTime time1 = DateTime.Now;

                    BaseEditor editor = System.Activator.CreateInstance(this.EditorT) as BaseEditor;
                    DateTime   time2  = DateTime.Now;
                    editor.ShowInTaskbar = false;
                    editor.StartPosition = FormStartPosition.CenterScreen;
                    IDbObject obj = gGrid1.GetCurSelect <IDbObject>();
                    editor.KeyId = G.Core.GConvert.ToInt(G.Core.ClassHelper.GetFieldValue(obj, "Id"));

                    var audit = G.Core.ClassHelper.GetFieldValue(obj, AuditField) != null?G.Core.ClassHelper.GetFieldValue(obj, AuditField).ToString() : "";

                    if (audit == "A")
                    {
                        editor.CurEditStatus = EditorStatus.Look;
                    }
                    else
                    {
                        editor.CurEditStatus = EditorStatus.Modify;
                    }
                    string info = (time2 - time1).TotalSeconds.ToString();
                    G.AppInfo.GGlobal.SetInfo(info);
                    editor.ShowDialog();
                    RefreshData();
                }
            }
            catch (Exception e) { MessageBox.Show(e.Message); }
        }
예제 #2
0
파일: BaseList.cs 프로젝트: pigeon79/GCore
        public virtual void Audit()
        {
            try
            {
                if (this.EditorT != null)
                {
                    DateTime   time1  = DateTime.Now;
                    BaseEditor editor = System.Activator.CreateInstance(this.EditorT) as BaseEditor;
                    editor.ShowInTaskbar = false;
                    editor.StartPosition = FormStartPosition.CenterScreen;
                    IDbObject obj = gGrid1.GetCurSelect <IDbObject>();
                    editor.KeyId = G.Core.GConvert.ToInt(G.Core.ClassHelper.GetFieldValue(obj, "Id"));
                    var audit = G.Core.ClassHelper.GetFieldValue(obj, AuditField) != null?G.Core.ClassHelper.GetFieldValue(obj, AuditField).ToString() : "";

                    editor.CurEditStatus = EditorStatus.Audit;
                    editor.listTool      = new List <string>()
                    {
                        "预览", "打印", "|", "审核", "反审", "|", "退出"
                    };

                    DateTime time2 = DateTime.Now;
                    G.AppInfo.GGlobal.SetInfo((time2 - time1).TotalSeconds.ToString());
                    editor.ShowDialog();
                    RefreshData();
                }
            }
            catch (Exception e) { MessageBox.Show(e.Message); }
        }
예제 #3
0
파일: BaseList.cs 프로젝트: pigeon79/GCore
        protected virtual void AddNew()
        {
            try
            {
                if (this.EditorT != null)
                {
                    DateTime time1 = DateTime.Now;

                    BaseEditor editor = System.Activator.CreateInstance(this.EditorT) as BaseEditor;
                    editor.ShowInTaskbar = false;
                    editor.StartPosition = FormStartPosition.CenterScreen;
                    editor.SetData(System.Activator.CreateInstance(EntityT) as IDbObject);
                    editor.CurEditStatus = EditorStatus.New;
                    DateTime time2 = DateTime.Now;
                    G.AppInfo.GGlobal.SetInfo((time2 - time1).Milliseconds.ToString());
                    editor.ShowDialog();
                    RefreshData();
                }
            }
            catch (Exception e) { MessageBox.Show(e.Message); }
        }