示例#1
0
文件: data.aspx.cs 项目: Hizcy/exam
 /// <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("");
     }
 }
示例#2
0
文件: data.aspx.cs 项目: Hizcy/exam
 /// <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);
             }
         }
     }
 }
示例#3
0
文件: data.aspx.cs 项目: Hizcy/exam
 /// <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);
     }
 }