Example #1
0
        protected void cmdDelete_Click(object sender, ImageClickEventArgs e)
        {
            string confirmValue = Request.Form["confirm_value"];

            if (confirmValue == "Có")
            {
                string keylb = this.Request["Key"].ToString();
                if (keylb == "")
                {
                    keylb = "0";
                }
                Cooperative_Info info = new Cooperative_Info(Convert.ToInt32(keylb));
                info.Delete();
                CloseForm();
            }
            else
            {
            }
        }
Example #2
0
        protected void GrDelete(object sender, CommandEventArgs e)
        {
            //int nPageNumber = int.Parse(txtPageNumber.Text);
            //int nPageSize = int.Parse(txtPageSize.Text);
            SessionUserLogin nUserLogin = (SessionUserLogin)Session["UserLogin"];

            nUserLogin.CheckRole("CA0014");
            if (!nUserLogin.Role.Del)
            {
                Response.Write("<script >alert('Bạn không có quyền xóa danh mục này!')</script>");
            }
            else
            {
                try
                {
                    int mKey = int.Parse(e.CommandArgument.ToString());
                    Cooperative_Info info = new Cooperative_Info(mKey);
                    //if ((DateTime.Now - info.Datetime).TotalDays > 7)
                    //{
                    //    Response.Write("<script >alert('Dữ liệu đã quá 7 ngày, không được phép xóa!')</script>");
                    //}
                    //else
                    {
                        info.Delete();
                        DataTable nTable = Cooperative_Data.GetList(0);
                        if (nTable.Rows.Count == 0)
                        {
                            nTable.Rows.Add("", 0, "", "", "", "", 0, 0, null);
                        }
                        GV_CooperativeVentures.DataSource = nTable;
                        GV_CooperativeVentures.DataBind();
                        //LoadPages();
                    }
                }
                catch
                {
                    Response.Write("<script >alert('Có lỗi gì đó vui lòng thử lại!')</script>");
                }
            }
        }