Exemplo n.º 1
0
 public void DeQueue(int id)
 {
     tb_ScheduleRelistQueueEntity srqe = new tb_ScheduleRelistQueueEntity();
     srqe.id = id;
     try
     {
         srqe.Retrieve();
         if (srqe.IsPersistent)
         {
             srqe.state = true;
             srqe.Save();
         }
     }catch(PlException plex)
     {
         //获取失败了,主键有误
     }
 }
Exemplo n.º 2
0
 private void Auto(int user_id)
 {
     DateTime scheduleTime;
     try { scheduleTime = Convert.ToDateTime(this.txtScheduleTime.Text); }
     catch (Exception ex) { Alert(this, "日期输入有误!"); return; }
     if (scheduleTime <= DateTime.Now)
     {
         Alert(this, "设定的时间已经过期!"); return;
     }
     IList<tb_ScheduleRelistQueueEntity> list = new List<tb_ScheduleRelistQueueEntity>();
     foreach (DataListItem item in DataList1.Items)
     {
         CheckBox cbo = item.FindControl("cbolist") as CheckBox;
         if (cbo.Checked)
         {
             long iid = Convert.ToInt64((item.FindControl("item") as System.Web.UI.HtmlControls.HtmlInputText).Value);
             string Name = (item.FindControl("lblName") as Label).Text;
             tb_ScheduleRelistQueueEntity srqe = new tb_ScheduleRelistQueueEntity();
             srqe.created = DateTime.Now;
             srqe.item_title = Name;
             srqe.num_iid = iid;
             srqe.Schedule = scheduleTime;
             srqe.state = false;
             srqe.user_id = user_id;
             list.Add(srqe);
         }
     }
     EnQueueByScheduleRelist(list);
     Alert(this, "操作成功完成!");
 }
Exemplo n.º 3
0
        private void Sche(int user_id)
        {
            DateTime goldTime;
            try { goldTime = Convert.ToDateTime(this.txtGoldTime.Text); }
            catch (Exception ex) { Alert(this, "日期输入有误!"); return; }
            if (goldTime <= DateTime.Now)
            {
                Alert(this, "设定的时间已经过期!"); return;
            }

            int hhbegin=0;
            int hhend=0;
            if (this.rdo1.Checked) {
                hhbegin = 10;
                hhend = 11;
            }
            if (this.rdo2.Checked) {
                hhbegin = 13;
                hhend = 16;
            }
            if (this.rdo3.Checked) {
                hhbegin = 20;
                hhend = 22;
            }
            int total = 0;
            int interval = 0;
            foreach (DataListItem item in DataList1.Items)
            {
                CheckBox cbo = item.FindControl("cbolist") as CheckBox;
                if (cbo.Checked)
                {
                    total++;
                }
            }
            interval = (hhend - hhbegin) * 60 / total; //间隔 分钟
            int fen=0;
            IList<tb_ScheduleRelistQueueEntity> list = new List<tb_ScheduleRelistQueueEntity>();
            foreach (DataListItem item in DataList1.Items)
            {
                CheckBox cbo = item.FindControl("cbolist") as CheckBox;
                if (cbo.Checked)
                {
                    long iid = Convert.ToInt64((item.FindControl("item") as System.Web.UI.HtmlControls.HtmlInputText).Value);
                    string Name = (item.FindControl("lblName") as Label).Text;
                    tb_ScheduleRelistQueueEntity srqe = new tb_ScheduleRelistQueueEntity();
                    srqe.created = DateTime.Now;
                    srqe.item_title = Name;
                    srqe.num_iid = iid;
                    srqe.state = false;
                    srqe.user_id = user_id;
                    srqe.Schedule =goldTime.AddHours(hhbegin).AddMinutes(fen);
                    list.Add(srqe);

                    fen = fen + interval;
                    while (fen >= 60) {
                        fen = fen-60;
                        hhbegin++;
                    }
                }
            }
            EnQueueByScheduleRelist(list);
        }
Exemplo n.º 4
0
 public static void Save(tb_ScheduleRelistQueueEntity obj)
 {
     if (obj!=null)
     {
         obj.Save();
     }
 }
Exemplo n.º 5
0
 /// <summary>根据主键获取一个实体</summary>
 public static tb_ScheduleRelistQueueEntity RetrieveAtb_ScheduleRelistQueueEntity(int id)
 {
     tb_ScheduleRelistQueueEntity obj=new tb_ScheduleRelistQueueEntity();
     obj.id=id;
     obj.Retrieve();
     if (obj.IsPersistent)
     {
         return obj;
     }
     else
     {
         return null;
     }
 }