Beispiel #1
0
        internal void DoCreateFile()
        {
            BuildInsertCommand();

            // add new row to the table
            DataRow dr = Table.NewRow();

            Table.Rows.Add(dr);

            // new dummy file, do not add, it can be canceled
            DataRowFile file = new DataRowFile(dr, Map);             //_110330_175246

            // open the record panel
            OpenFileActor(file);
        }
Beispiel #2
0
        ///
        protected override bool CanCloseChild()
        {
            MemberPanel mp = Child as MemberPanel;

            if (mp == null)
            {
                return(true);
            }

            DataRow dr = mp.Value.BaseObject as DataRow;

            if (dr == null)
            {
                return(true);
            }

            var xRowState = dr.RowState;

            if (0 == (xRowState & (DataRowState.Added | DataRowState.Deleted | DataRowState.Modified)))
            {
                return(true);
            }

            switch (Far.Api.Message(Res.AskSaveModified, "Save", MessageOptions.YesNoCancel))
            {
            case 0:
                // save data, update the table
                var result = SaveData();

                // now we can add a new file for the new record
                if (xRowState == DataRowState.Added)                         //_110330_175246
                {
                    DataRowFile file = new DataRowFile(dr, Map);
                    Explorer.Cache.Add(file);
                    PostFile(file);
                    ToUpdateData = true;
                }

                return(result);

            case 1:
                dr.RejectChanges();
                return(true);

            default:
                return(false);
            }
        }
Beispiel #3
0
        ///
        protected override bool CanCloseChild()
        {
            MemberPanel mp = Child as MemberPanel;
            if (mp == null)
                return true;

            DataRow dr = mp.Value.BaseObject as DataRow;
            if (dr == null)
                return true;

            var xRowState = dr.RowState;
            if (0 == (xRowState & (DataRowState.Added | DataRowState.Deleted | DataRowState.Modified)))
                return true;

            switch (Far.Api.Message(Res.AskSaveModified, "Save", MessageOptions.YesNoCancel))
            {
                case 0:
                    // save data, update the table
                    var result = SaveData();

                    // now we can add a new file for the new record
                    if (xRowState == DataRowState.Added) //_110330_175246
                    {
                        DataRowFile file = new DataRowFile(dr, Map);
                        Explorer.Cache.Add(file);
                        PostFile(file);
                        ToUpdateData = true;
                    }

                    return result;

                case 1:
                    dr.RejectChanges();
                    return true;

                default:
                    return false;
            }
        }
Beispiel #4
0
        internal void DoCreateFile()
        {
            BuildInsertCommand();

            // add new row to the table
            DataRow dr = Table.NewRow();
            Table.Rows.Add(dr);

            // new dummy file, do not add, it can be canceled
            DataRowFile file = new DataRowFile(dr, Map); //_110330_175246

            // open the record panel
            OpenFileActor(file);
        }