//ThienTD EDIT: xóa dữ liệu trong bảng News_Extesion
 protected void btnSend_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(Request.QueryString["NewsRef"]))
     {
         NewsEditHelper.DeleteNews_Extension(Request.QueryString["NewsRef"]);
     }
     if (!String.IsNullOrEmpty(referUrl))
     {
         Response.Redirect(referUrl);
     }
 }
        protected void btnPublish_Click(object sender, EventArgs e)
        {
            if (Validate())
            {
                // Get CatID cac chuyen muc khac
                string strOtherCat = "";
                foreach (ListItem item in lstOtherCat.Items)
                {
                    if (item.Selected)
                    {
                        strOtherCat += item.Value + ",";
                    }
                }
                //string Tags = "";

                foreach (ListItem item in cblTags.Items)
                {
                    if (item.Selected)
                    {
                        hidLuongSuKien.Value += item.Value + ",";
                    }
                }
                hidLuongSuKien.Value = hidLuongSuKien.Value.TrimEnd(',');
                if (strOtherCat != "")
                {
                    strOtherCat = strOtherCat.Substring(0, strOtherCat.Length - 1);
                }

                string strNewsID = "";
                string strcpmode = Request.QueryString["cpmode"].ToString().Replace("add,", "").Replace("#", "");
                //xet 2 truong hop: 1 la tao va xuat ban, 2 sua va xuất bản
                if (!string.IsNullOrEmpty(Request.QueryString["NewsRef"]))
                {
                    strNewsID = Request.QueryString["NewsRef"].ToString();

                    objsoure.UpdateParameters[9].DefaultValue = "3";

                    // Neu chon ngay xuat ban voi truong hop chua Published
                    // thi check xem da chon PublishedDate chua
                    //if (getPublishTime().Year == 2000)
                    //    objsoure.UpdateParameters[13].DefaultValue = DateTime.Now.ToString();
                    //else
                    objsoure.UpdateParameters[13].DefaultValue = getPublishTime().ToString();

                    objsoure.UpdateParameters[12].DefaultValue = strOtherCat;
                    objsoure.UpdateParameters["_str_Extension3"].DefaultValue = txtSourceLink.Text.Trim();
                    objsoure.UpdateParameters["_thread_id"].DefaultValue      = hidLuongSuKien.Value.Trim();
                    // Get ViewNum cua Category
                    int template = CategoryHelper.getCatInfoAsCategoryRow(Convert.ToInt32(lstCat.SelectedValue)).Cat_ViewNum;
                    objsoure.UpdateParameters[17].DefaultValue        = template.ToString();
                    objsoure.UpdateParameters[4].DefaultValue         = txtSelectedFile.Text.Trim();
                    objsoure.UpdateParameters["_isSend"].DefaultValue = "true";
                    objsoure.Update();

                    NewsEditHelper.DeleteNews_Extension(Request.QueryString["NewsRef"]);


                    if (!String.IsNullOrEmpty(referUrl))
                    {
                        Response.Redirect(referUrl);
                    }
                }
            }
        }