Example #1
0
        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); }
        }
Example #2
0
        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); }
        }
Example #3
0
        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); }
        }