Пример #1
0
        protected void uiGridViewNews_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "EditNews")
            {
                BLL.News objData = new BLL.News();
                objData.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString()));
                CurrentNews = objData;
                uiTextBoxArTitle.Text = objData.ArTitle;
                uiTextBoxEnTitle.Text = objData.EnTitle;
                uiFCKeditorArBody.Value = Server.HtmlDecode(objData.ArBody);
                uiFCKeditorEnBody.Value = Server.HtmlDecode(objData.EnBody);
                //uiDropDownListCategory.SelectedValue = objData.CategoryID.ToString();
                uiTextBoxEnBreif.Text = objData.EnBrief;
                uiTextBoxArBrief.Text = objData.ArBrief;
                //uiTextBoxDate.Text = ds.Tables[0].Rows[0]["CreatedDate"].ToString();
                uiPanelViewNews.Visible = false;
                uiPanelEdit.Visible = true;
                uiPanelExport.Visible = false;
            }
            else if (e.CommandName == "DeleteNews")
            {
                BLL.News objData = new BLL.News();
                objData.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString()));
                objData.MarkAsDeleted();
                objData.Save();
                CurrentNews = null;
                BindData();

            }
        }