protected string LoadDSHTX(string id) { DataTable nTable = Cooperative_Data.GetList_City(); string listCooperative = ""; for (int i = 0; i < nTable.Rows.Count; i++) { //listMember += nMember.Rows[j]["Cooperative_Key"] + " " + nMember.Rows[j]["Name"] + "</p>"; listCooperative += "{Cooperative_Key:'" + nTable.Rows[i]["Cooperative_Key"] + "',Cooperative_Name:'" + nTable.Rows[i]["Cooperative_Name"] + "',Lat:" + nTable.Rows[i]["Lat"] + ",Lng:" + nTable.Rows[i]["Lng"] + ",Icon:'" + nTable.Rows[i]["Images"] + "',Phone:'" + nTable.Rows[i]["Phone"] + "',Address:'" + nTable.Rows[i]["Address"] + "',Cooperative_ID:'" + nTable.Rows[i]["Cooperative_ID"] + "'},"; } return(listCooperative); }
protected void cmdView_Click1(object sender, ImageClickEventArgs e) { SessionUserLogin nUserLogin = (SessionUserLogin)Session["UserLogin"]; DataTable nTable = Cooperative_Data.GetList(int.Parse(txtKey.Text)); if (nTable.Rows.Count == 0) { nTable.Rows.Add(0, ""); } GV_Cooperative.DataSource = nTable; GV_Cooperative.DataBind(); //LoadPages(); }
public void LoadData() { SessionUserLogin nUserLogin = (SessionUserLogin)Session["UserLogin"]; DataTable nTable = Cooperative_Data.GetList(int.Parse(txtKey.Text)); if (nTable.Rows.Count == 0) { nTable.Rows.Add(0, "");//, null, "", 0, 0, 0, "", "", "", "", 0); } nTable.Columns.Add(); GV_Cooperative.DataSource = nTable; GV_Cooperative.DataBind(); DateTime dt = DateTime.Now; }
public static string ListCooperative() { DataTable nTable = Cooperative_Data.GetList(); string cities = ""; for (int i = 0; i < nTable.Rows.Count; i++) { if (i + 1 < nTable.Rows.Count) { cities += "{\"Key\":\"" + nTable.Rows[i]["Cooperative_Key"].ToString() + "\",\"Name\":\"" + nTable.Rows[i]["Cooperative_Name"].ToString() + "\"},"; } else { cities += "{\"Key\":\"" + nTable.Rows[i]["Cooperative_Key"].ToString() + "\",\"Name\":\"" + nTable.Rows[i]["Cooperative_Name"].ToString() + "\"}"; } } cities = "[" + cities + "]"; return(cities); }
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>"); } } }