示例#1
0
 public bool Audit(Task item)
 {
     using (ISession session = NHibernateHelper.OpenSession())
     {
         ITransaction tran = session.BeginTransaction();
         try
         {
             session.Update(item);
             if (item.Status == 3)
             {
                 AppDAL dal = new AppDAL();
                 App app = dal.Get(item.AppID);
                 app.Status = 0;
                 if (!dal.Update(app))
                 {
                     tran.Rollback();
                     return false;
                 }
             }
             tran.Commit();
             return true;
         }
         catch (Exception ex)
         {
             tran.Rollback();
             throw ex;
         }
     }
 }
示例#2
0
 public ActionResult Apply(int AppID,int UserID)
 {
     ViewBag.AmIn = "task";
     AdminUser user = CheckLogin.Instance.GetUser();
     TaskBLL bll = new TaskBLL();
     AppBLL appBll = new AppBLL();
     App app = appBll.Get(AppID);
     Task task = new Task();
     task.AppID = app.ID;
     task.ApplyTime = DateTime.Now;
     task.AppName = app.AppName;
     task.ChannelPrice = app.ChannelPrice;
     task.CPID = app.Cpid;
     task.CustomServiceID = user.ID;
     task.CustomServiceName = user.RealName;
     task.LinkManID = app.LinkManID;
     task.LinkManName = app.LinkManName;
     task.Price = app.Price;
     task.Remain = app.Remain;
     task.Result = 0;
     task.Status = 0;
     task.ChannelID = UserID;
     bll.Apply(task);
     app.Status = 1;
     appBll.Update(app);
     return MyContent("申请任务成功,等待商务审核!", "/Task/TaskCanApplyList");
 }
示例#3
0
 public bool Audit(Task item)
 {
     return dal.Audit(item);
 }
示例#4
0
 public bool Apply(Task item)
 {
     return dal.Apply(item);
 }