Exemple #1
0
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public static tblMaintain Create()
        {
            tblMaintain mt = new tblMaintain();
            mt.tblMaintainLevel = MaintainLevelFactory.Default;
            mt.tblOperator = App.Default.LoginOperator;

            mt.mt_create_dt = DateTime.Now;
            mt.mt_pose_dt = DateTime.Now;
            mt.mt_begin_dt = DateTime.Now;
            mt.mt_timeout_dt = mt.mt_begin_dt + TimeSpan.FromMinutes((int)mt.tblMaintainLevel.ml_arrive_hl);
            //fl.SetMTStatus(FLStatus.Created);

            return mt;
        }
Exemple #2
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="db"></param>
        /// <param name="mt"></param>
        /// <returns></returns>
        public tblMaintain UpdateMaintain(BxdbDataContext db, tblMaintain mt)
        {
            tblMaintain old = this.Maintain;

            //tblMaintain mt = new tblMaintain();
            mt.mt_id = old.mt_id;
            mt.mt_create_dt = old.mt_create_dt;
            mt.mt_pose_dt = old.mt_pose_dt;
            mt.mt_begin_dt = old.mt_begin_dt;
            mt.mt_content = old.mt_content;
            mt.mt_timeout_dt = old.mt_timeout_dt;
            mt.tblMaintainLevel = GetMaintainLevel(db, (tblMaintainLevel)this.cmbML.SelectedItem);
            mt.tblOperator = db.tblOperator.First(c => c.op_id == App.Default.LoginOperator.op_id);
            return mt;
        }