Example #1
0
 public void DeQueue(int id)
 {
     tb_ScheduleRecommendQueueEntity srqe = new tb_ScheduleRecommendQueueEntity();
     srqe.id = id;
     try
     {
         srqe.Retrieve();
         if (srqe.IsPersistent)
         {
             srqe.state = true;
             srqe.Save();
         }
     }catch(PlException plex)
     {
         //获取失败了,主键有误
     }
 }
 public static void Save(tb_ScheduleRecommendQueueEntity obj)
 {
     if (obj!=null)
     {
         obj.Save();
     }
 }
 /// <summary>根据主键获取一个实体</summary>
 public static tb_ScheduleRecommendQueueEntity RetrieveAtb_ScheduleRecommendQueueEntity(int id)
 {
     tb_ScheduleRecommendQueueEntity obj=new tb_ScheduleRecommendQueueEntity();
     obj.id=id;
     obj.Retrieve();
     if (obj.IsPersistent)
     {
         return obj;
     }
     else
     {
         return null;
     }
 }
Example #4
0
        private void Sche(int user_id)
        {
            DateTime scheTime;
            try { scheTime = Convert.ToDateTime(this.txtScheduleTime.Text); }
            catch (Exception ex) { Alert(this, "日期输入有误!"); return; }
            if (scheTime <= DateTime.Now)
            {
                Alert(this, "设定的时间已经过期!"); return;
            }

            if (this.lblRemainCount.Text == "0")
            {
                Alert(this, "橱窗空位不足,到时可能无法推荐成功,可以手动取消一些宝贝橱窗推荐,但请先自动橱窗开关!"); return;
            }

            IList<tb_ScheduleRecommendQueueEntity> list = new List<tb_ScheduleRecommendQueueEntity>();
            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_ScheduleRecommendQueueEntity srqe = new tb_ScheduleRecommendQueueEntity();
                    srqe.created = DateTime.Now;
                    srqe.item_title = Name;
                    srqe.num_iid = iid;
                    srqe.state = false;
                    srqe.user_id = user_id;
                    srqe.Schedule = scheTime;
                    list.Add(srqe);
                }
            }
            EnQueueByScheduleRelist(list);
            Alert(this, "操作成功完成!");
        }