Beispiel #1
0
        //[email protected]
        /// <summary>
        /// 
        /// </summary>
        /// <param name="Fields"></param>
        /// <param name="fc_New"></param>
        /// <returns> 0: Successed, 1:SetValue Fail;2:LoadDataField Fail;3:UpdataToDB Fail;4:Rollback Fail</returns>
        public Int32 UpdateData(IFields Fields, FieldCollection fc_New)
        {
            bool result = false;

            FieldCollection fc_Current = Fields.ToFieldCollection();
            FieldCollection fc_Mark = fc_Current.Clone();
            result = fc_Current.UpdateFieldsValue(fc_New);
            if (!result)
                return 2;
            DataProcessTask task = new DataProcessTask();
            task.AddTaskItem(new DataProcessTaskItem(eDataOPType.OP_Update, fc_Current, null));
            result = Fields.LoadFieldCollection(fc_Current);
            if (!result)
                return 3;
            result = ExeOneTask(task);
            if (!result)
            {
                result = Fields.LoadFieldCollection(fc_Mark);
                if (!result)
                    return 4;
            }
            return 0;
        }
Beispiel #2
0
 public DataProcessTaskItem SaveDataToTask(DataProcessTask task, IFields Fields)
 {
     FieldCollection fc = Fields.ToFieldCollection();
     DataProcessTaskItem item = new DataProcessTaskItem(eDataOPType.OP_Update, fc, null);
     task.AddTaskItem(item);
     return item;
 }
Beispiel #3
0
 public bool LoadData(IFields Fields)
 {
     bool result;
     FieldCollection fc = Fields.ToFieldCollection();
     DataProcessTask task = new DataProcessTask();
     DataProcessTaskItem DPTI = new DataProcessTaskItem(eDataOPType.Select, fc, null);
     task.AddTaskItem(DPTI);
     result = ExeOneTask(task);
     return result && Fields.LoadFieldCollection(DPTI.Fields);
 }
Beispiel #4
0
 public bool SaveData(IFields Fields)
 {
     FieldCollection fc = Fields.ToFieldCollection();
     DataProcessTask task = new DataProcessTask();
     task.AddTaskItem(new DataProcessTaskItem(eDataOPType.OP_Update, fc, null));
     return ExeOneTask(task);
 }
Beispiel #5
0
 public bool CreateData(IFields Fields)
 {
     if (Fields != null)
     {
         FieldCollection fc = Fields.ToFieldCollection();
         DataProcessTask task = new DataProcessTask();
         task.AddTaskItem(new DataProcessTaskItem(eDataOPType.OP_Insert, fc, null));
         return ExeOneTask(task);
     }
     else
         return false;
 }