Beispiel #1
0
    public int InsertNotification(BLLNotice objbll)
    {
        SqlParameter[] param = new SqlParameter[8];

        param[0]       = new SqlParameter("@notification_id", SqlDbType.NVarChar);
        param[0].Value = objbll.Notification_id;

        param[1]       = new SqlParameter("@title", SqlDbType.NVarChar);
        param[1].Value = objbll.Title;

        param[2]       = new SqlParameter("@description", SqlDbType.NVarChar);
        param[2].Value = objbll.Description;

        param[3]       = new SqlParameter("@status", SqlDbType.Bit);
        param[3].Value = objbll.Status;

        param[4]       = new SqlParameter("@createdby", SqlDbType.NVarChar);
        param[4].Value = objbll.Createdby;

        param[5]       = new SqlParameter("@modifiedby ", SqlDbType.NVarChar);
        param[5].Value = objbll.Modifiedby;

        param[6]       = new SqlParameter("@Insert_Date", SqlDbType.DateTime);
        param[6].Value = objbll.Insert_date;

        param[7]       = new SqlParameter("@Update_Date", SqlDbType.DateTime);
        param[7].Value = objbll.Update_date;

        objcon.OpenConnection();
        int a = objcon.sqlcmdInsert("sp_insertnotification", param);

        objcon.CloseConnection();
        return(a);
    }
    public void SelectNotice()
    {
        List <BLLNotice> objlist = new List <BLLNotice>();
        BLLNotice        objbll  = new BLLNotice();

        objlist = objbll.SelectNotice();
        if (objlist.Count > 0)
        {
            dgnotice.DataSource = objlist;
            dgnotice.DataBind();
            for (int i = 0; i <= dgnotice.Rows.Count - 1; i++)
            {
                string update = (string)Session["update"];
                string delete = (string)Session["delete"];
                if (update == "yes")
                {
                    dgnotice.Rows[i].Cells[1].Enabled = true;
                }
                else
                {
                    dgnotice.Rows[i].Cells[1].Enabled = false;
                }
                if (delete == "yes")
                {
                    dgnotice.Rows[i].Cells[2].Enabled = true;
                }
                else
                {
                    dgnotice.Rows[i].Cells[2].Enabled = false;
                }
            }
        }
    }
Beispiel #3
0
    public List <BLLNotice> SelectNotice()
    {
        List <BLLNotice> objlist = new List <BLLNotice>();
        BLLNotice        objbll  = new BLLNotice();

        SqlDataReader dr;

        objcon.OpenConnection();
        dr = objcon.sqlcmdSelectAll("sp_selectnotice");
        while (dr.Read())
        {
            objbll             = new BLLNotice();
            objbll.Id          = Convert.ToInt32(dr["id"].ToString());
            objbll.Notice_id   = dr["notice_id"].ToString();
            objbll.Title       = dr["title"].ToString();
            objbll.Description = dr["description"].ToString();
            objbll.Status      = Convert.ToBoolean(dr["status"].ToString());
            objbll.Createdby   = dr["createdby"].ToString();
            objbll.Modifiedby  = dr["modifiedby"].ToString();
            objbll.Insert_date = Convert.ToDateTime(dr["insert_date"].ToString());
            objbll.Update_date = Convert.ToDateTime(dr["update_date"].ToString());
            objlist.Add(objbll);
        }
        objcon.CloseConnection();
        return(objlist);
    }
Beispiel #4
0
    public int UpdateNotification(BLLNotice objbll)
    {
        SqlParameter[] param = new SqlParameter[5];

        param[0]       = new SqlParameter("@notification_id", SqlDbType.NVarChar);
        param[0].Value = objbll.Notification_id;

        param[1]       = new SqlParameter("@title", SqlDbType.NVarChar);
        param[1].Value = objbll.Title;

        param[2]       = new SqlParameter("@description", SqlDbType.NVarChar);
        param[2].Value = objbll.Description;

        param[3]       = new SqlParameter("@modifiedby ", SqlDbType.NVarChar);
        param[3].Value = objbll.Modifiedby;

        param[4]       = new SqlParameter("@Update_Date", SqlDbType.DateTime);
        param[4].Value = objbll.Update_date;

        objcon.OpenConnection();
        int a = objcon.sqlcmdUpdateById("sp_updatenotification", param);

        objcon.CloseConnection();
        return(a);
    }
Beispiel #5
0
 /// <summary>
 /// 判断路径是否可用
 /// </summary>
 /// <param name="path">路径</param>
 /// <returns></returns>
 public JsonResult IsPathAvailable(string path)
 {
     if (String.IsNullOrEmpty(path))
     {
         return(Json(true));
     }
     try
     {
         if (!path.EndsWith(".html"))
         {
             path = path + ".html";
         }
         var existStatus = new BLLNotice().Exist(n => n.NoticePath.ToLower().Equals(path.ToLower()));
         if (existStatus)
         {
             return(Json(false));
         }
         else
         {
             return(Json(true));
         }
     }
     catch (Exception ex)
     {
         Logger.Error(ex);
         throw;
     }
 }
Beispiel #6
0
    public List <BLLNotice> SelectNotificationbyid(BLLNotice objbll)
    {
        List <BLLNotice> objlist = new List <BLLNotice>();

        SqlParameter param = new SqlParameter();

        param       = new SqlParameter("@notification_id", SqlDbType.NVarChar);
        param.Value = objbll.Notification_id;

        SqlDataReader dr;

        objcon.OpenConnection();
        dr = objcon.sqlcmdSelectById("sp_selectnotificationbyid", param);
        while (dr.Read())
        {
            objbll    = new BLLNotice();
            objbll.Id = Convert.ToInt32(dr["id"].ToString());
            objbll.Notification_id = dr["notification_id"].ToString();
            objbll.Title           = dr["title"].ToString();
            objbll.Description     = dr["description"].ToString();
            objbll.Status          = Convert.ToBoolean(dr["status"].ToString());
            objbll.Createdby       = dr["createdby"].ToString();
            objbll.Modifiedby      = dr["modifiedby"].ToString();
            objbll.Insert_date     = Convert.ToDateTime(dr["insert_date"].ToString());
            objbll.Update_date     = Convert.ToDateTime(dr["update_date"].ToString());
            objlist.Add(objbll);
        }
        objcon.CloseConnection();
        return(objlist);
    }
    protected void btndelete_Click1(object sender, EventArgs e)
    {
        LinkButton obj    = (LinkButton)(sender);
        string     val    = obj.CommandArgument.ToString();
        BLLNotice  objbll = new BLLNotice();

        objbll.Notice_id = val;
        int a = objbll.DeleteNotice(objbll);

        SelectNotice();
    }
Beispiel #8
0
    public void SelectNotice()
    {
        List <BLLNotice> objlist = new List <BLLNotice>();
        BLLNotice        objbll  = new BLLNotice();

        objlist = objbll.SelectNotice();
        if (objlist.Count > 0)
        {
            dgnotice.DataSource = objlist;
            dgnotice.DataBind();
        }
    }
Beispiel #9
0
    public int DeleteNotification(BLLNotice objbll)
    {
        SqlParameter[] param = new SqlParameter[1];

        param[0]       = new SqlParameter("@notification_id", SqlDbType.NVarChar);
        param[0].Value = objbll.Notification_id;

        objcon.OpenConnection();
        int a = objcon.sqlcmdUpdateById("sp_deletenotification", param);

        objcon.CloseConnection();
        return(a);
    }
Beispiel #10
0
    public void InsertNotice()
    {
        BLLNotice objbll = new BLLNotice();

        objbll.Notice_id   = txtnoticeid.Text;
        objbll.Title       = txttitle.Text;
        objbll.Description = txtdescription.Text;
        objbll.Createdby   = user;
        objbll.Modifiedby  = user;
        int a = objbll.InsertNotice(objbll);

        if (a == 1)
        {
            lblresult.Text  = "Notice save Successfully....";
            BtnSave.Enabled = false;
            BtnNew.Enabled  = true;
        }
    }
        /// <summary>
        /// 公告列表
        /// </summary>
        /// <returns></returns>
        public ActionResult NoticeList(SearchHelperModel search)
        {
            Expression <Func <Notice, bool> > whereLamdba = (n => !n.IsDeleted && n.CheckStatus);

            if (!String.IsNullOrEmpty(search.SearchItem1))
            {
                whereLamdba = n => n.NoticeTitle.Contains(search.SearchItem1) && n.CheckStatus;
            }
            try
            {
                int count;
                var noticeList = new BLLNotice().GetPagedList(search.PageIndex, search.PageSize, out count, whereLamdba,
                                                              n => n.NoticePublishTime, false);
                var data = noticeList.ToPagedList(search.PageIndex, search.PageSize, count);
                return(View(data));
            }
            catch (Exception ex)
            {
                Logger.Error(ex);
                throw;
            }
        }
 /// <summary>
 /// 公告详情
 /// </summary>
 /// <param name="path">访问路径</param>
 /// <returns></returns>
 public ActionResult NoticeDetails(string path)
 {
     if (string.IsNullOrEmpty(path))
     {
         return(RedirectToAction("Notice"));
     }
     try
     {
         var notice = new BLLNotice().Fetch(n => n.NoticePath == path);
         if (notice != null)
         {
             return(View(notice));
         }
         else
         {
             return(RedirectToAction("Notice"));
         }
     }
     catch (Exception ex)
     {
         Logger.Error(ex);
         throw;
     }
 }
    public int DeleteNotification(BLLNotice objbll)
    {
        DALNotice objdal = new DALNotice();

        return(objdal.DeleteNotification(objbll));
    }
    public List <BLLNotice> SelectNotificationbyid(BLLNotice objbll)
    {
        DALNotice objdal = new DALNotice();

        return(objdal.SelectNotificationbyid(objbll));
    }
    public int UpdateNotice(BLLNotice objbll)
    {
        DALNotice objdal = new DALNotice();

        return(objdal.UpdateNotice(objbll));
    }
    public int InsertNotification(BLLNotice objbll)
    {
        DALNotice objdal = new DALNotice();

        return(objdal.InsertNotification(objbll));
    }