protected void SaveInfo()
        {
            ListCooperative_Info info = new ListCooperative_Info(Session["CooperativeVenturesKey"].ToString(), (txtKey.Text));

            info.Cooperative_Key        = int.Parse(DDLCooperative.SelectedValue);
            info.CooperativeVenturesKey = int.Parse(Session["CooperativeVenturesKey"].ToString());
            info.Save();
        }
        protected void LoadInfo(string Key)
        {
            ListCooperative_Info info;

            if (Key == "0")
            {
                info = new ListCooperative_Info();
            }
            else
            {
                info = new ListCooperative_Info(Session["CooperativeVenturesKey"].ToString(), Key);
            }
            DDLCooperative.SelectedValue = info.Cooperative_Key.ToString();
            //DDLListCooperative.SelectedValue = info.UserKey;
        }
Ejemplo n.º 3
0
        protected void GrDelete(object sender, CommandEventArgs e)
        {
            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
                {
                    string mKey = (e.CommandArgument.ToString());
                    ListCooperative_Info info = new ListCooperative_Info(txtKey.Text, mKey);
                    //if ((DateTime.Now - info.DatetimeBuy).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(int.Parse(txtKey.Text.ToString()));//.GetLits();''xtKey.Text));
                        if (nTable.Rows.Count == 0)
                        {
                            nTable.Rows.Add(0, "");
                        }
                        GV_Cooperative.DataSource = nTable;
                        GV_Cooperative.DataBind();
                        //LoadPages();
                    }
                }
                catch
                {
                    Response.Write("<script >alert('Có lỗi gì đó vui lòng thử lại!')</script>");
                }
            }
        }