private void SearchButton_Click(object sender, EventArgs e) { PostData Require = new PostData(); Require.InData = "action=search" + "&&username="******"&&password="******"&&filename=" + SearchInput.Text; string response = Require.postPackge(); //ResourceGridView.Dispose(); string[] tmp = response.Split('#'); int len = tmp.Length - 1; string[,] info = new string[len, 4]; ResourceGridView.ColumnCount = 4; ResourceGridView.RowCount = len; for (int i = 0; i < ResourceGridView.RowCount; i++) { string[] buff = tmp[i].Split('&'); for (int j = 0; j < ResourceGridView.ColumnCount; j++) { info[i, j] = buff[j]; } } for (int i = 0; i < ResourceGridView.RowCount; i++) { for (int j = 0; j < ResourceGridView.ColumnCount; j++) { ResourceGridView.Rows[i].Cells[j].Value = info[i, j]; } } ResourceGridView.Show(); }
private bool AddGroup(string arabic_name, string english_name) { try { db.Configuration.LazyLoadingEnabled = false; Resource group = db.Resources.Create(); group.Resource_Name_Ar = arabic_name; group.Resource_Name_En = english_name; db.Resources.Add(group); db.SaveChanges(); /* Add it to log file */ LogData = "data:" + JsonConvert.SerializeObject(group, logFileModule.settings); logFileModule.logfile(10, "إنشاء مصدر معرفة", "create new Resources", LogData); db.Entry(group).Reload(); ResourceGridView.DataBind(); } catch { return(false); } return(true); }