Ejemplo n.º 1
0
 private void SetTimeDefines(WorkDefine wd)
 {
     foreach (Control c in this.flowLayoutPanel1.Controls)
     {
         UC.UCTimeDefine ucTd = c as UC.UCTimeDefine;
         wd.TimeDefines.Add(ucTd.CreateTimeDefineByUI());
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="wd"></param>
        /// <param name="td"></param>
        /// <returns></returns>
        private K.UC.UCTimeDefine CreateTimeDefineControl(WorkDefine wd, TimeDefine td)
        {
            UC.UCTimeDefine ucTd = new K.UC.UCTimeDefine();
            ucTd.WorkDefine = wd;
            ucTd.TimeDefine = td;

            return ucTd;
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 
        /// </summary>
        private void Edit(WorkDefine wd )
        {
            DB db = DBFactory.GetDB();
            tblWorkDefine tblWd = db.tblWorkDefine.First(
                c => c.WorkDefineID == this.TblWorkDefine.WorkDefineID
                );

            tblWd.WorkDefineName = this.txtWorkDefineName.Text.Trim();
            tblWd.WorkDefineContext = WorkDefine.Serialize(wd);
                //ReadWorkDefineString();
            db.SubmitChanges();
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 
        /// </summary>
        private bool Add(WorkDefine wd)
        {
            //WorkDefine wd = this.WorkDefine;
            //wd.Name = this.txtWorkDefineName.Text.Trim();

            //wd.CycleType = this.SelectedCycleType;

            //wd.DayOfCycle = this.SelectedCycleDayCount;
            //wd.StartDateTime = this.StartDateTime;

            //SetTimeDefines(wd);
            //WorkDefine wd = CreateWorkDefine();

            tblWorkDefine tblWorkDefine = new tblWorkDefine();
            tblWorkDefine.WorkDefineName = wd.Name;
            tblWorkDefine.WorkDefineContext = WorkDefine.Serialize(wd);

            DB db = DBFactory.GetDB();
            db.tblWorkDefine.InsertOnSubmit(tblWorkDefine);

            db.SubmitChanges();

            return true;
        }