Ejemplo n.º 1
0
 /// <summary>
 /// 广告语修改赋值
 /// </summary>
 /// <param name="id"></param>
 public void updatead(int id)
 {
     try
     {
         Exam.Entity.tb_AdEntity model = Exam.BLL.tb_AdBLL.GetInstance().GetAdminSingle(id);
         if (model != null)
         {
             Response.Write(model.AdContent + "+" + model.AdLink);
         }
         else
         {
             Response.Write("");
         }
     }
     catch (Exception ex)
     {
         Response.Write("");
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// 添加广告语 /修改广告语
 /// </summary>
 /// <param name="adContent"></param>
 public void addad(string adContent, string adLink, string adId)
 {
     if (identity != null)
     {
         if (adId == "")
         {
             try
             {
                 Exam.Entity.tb_AdEntity model = new Exam.Entity.tb_AdEntity();
                 model.UserId     = identity.UserID;
                 model.RoleId     = identity._roleID;
                 model.AdContent  = SqlInject(adContent);
                 model.AdLink     = SqlInject(adLink);
                 model.Status     = 1;
                 model.Addtime    = DateTime.Now;
                 model.Updatetime = DateTime.Now;
                 Exam.BLL.tb_AdBLL.GetInstance().Insert(model);
                 Response.Write(1);
             }
             catch (Exception ex)
             {
                 Response.Write(2);
             }
         }
         else
         {
             try
             {
                 Exam.Entity.tb_AdEntity model = Exam.BLL.tb_AdBLL.GetInstance().GetAdminSingle(int.Parse(adId));
                 model.AdContent  = adContent;
                 model.AdLink     = adLink;
                 model.Updatetime = DateTime.Now;
                 Exam.BLL.tb_AdBLL.GetInstance().Update(model);
                 Response.Write(1);
             }
             catch (Exception ex)
             {
                 Response.Write(3);
             }
         }
     }
 }
Ejemplo n.º 3
0
 /// <summary>
 /// 删除广告
 /// </summary>
 /// <param name="id"></param>
 public void deletead(int id)
 {
     try
     {
         Exam.Entity.tb_AdEntity model = Exam.BLL.tb_AdBLL.GetInstance().GetAdminSingle(id);
         if (model != null)
         {
             model.Status     = 0;
             model.Updatetime = DateTime.Now;
             Exam.BLL.tb_AdBLL.GetInstance().Update(model);
             Response.Write(1);
         }
         else
         {
             Response.Write(2);
         }
     }
     catch (Exception ex)
     {
         Response.Write(2);
     }
 }