protected void Page_Load(object sender, EventArgs e) { DB = new OperationsDB(); UpdateUsersCount(); UpdateFilesCount(); GridView1.DataBound += GridView1_DataBound; FileName.Attributes.Add("onkeypress", "foo"); //this.FileName.Attributes.Add( //"onkeypress", "button_click(this,'" + this.Button1.ClientID + "')"); }
public override string GenerateView(string spName) { try { OperationsDB oDb = new OperationsDB(); DataSet ds = oDb.ExecuteProcedureToGetColumns(spName); return(ds.Tables[0].Rows[0][0].ToString()); } catch (Exception) { return(""); } //throw new NotImplementedException(); }
// Execute when user Log in. private void AddUserFiles(User user, OperationsDB DB) { lock (thisLock) { if (!ActiveUsers.Contains(user)) { ActiveUsers.Add(user); } } foreach (FileDetails file in user.FileList) { if (ServerFileList.ContainsKey(file)) { // This file already exist in list. // Add this user as adition peer to download. lock (thisLock) { if (!ServerFileList[file].Contains(user)) { ServerFileList[file].Add(user); DB.AddPeerToFile(file.FileName, file.FileSize); } } } else { // This file new in list. lock (thisLock) { ServerFileList.Add(file, new List <User>()); ServerFileList[file].Add(user); DB.AddFile(file.FileName, file.FileSize); } } } while (bwUpdateUserList.IsBusy) { ; } bwUpdateUserList.RunWorkerAsync(); }
protected void Page_Load(object sender, EventArgs e) { //redirect user to Login page when not logged in if (Session["UserName"] == null) { Response.Redirect("~/Login.aspx"); } int customerID = Convert.ToInt32(Session["UserName"]); int LeasedSlipID = Convert.ToInt32(Session["LeasedSlipID"]); welcomeLabel.Text = $"<h3>Welcome back {OperationsDB.getCustomerInfoBy(customerID)}</h3>"; docks = OperationsDB.getDocks(); slipInfo = OperationsDB.getSlipInfoBy(customerID); List <string> slipsLeased = new List <string>(); slipsLeased = OperationsDB.getSlipsByCustomer(customerID); ; }
public List <SqlColumns> GetColumnNames(string spName) { OperationsDB oDb = new OperationsDB(); DataSet ds = oDb.ExecuteProcedureToGetColumns(spName); string parameters = ""; foreach (DataRow item in ds.Tables[0].Rows) { parameters += item["ParameterName"] + "=NULL,"; } parameters = parameters.Substring(0, parameters.Length - 1); DataSet resultSet = oDb.ExecuteSql(spName + " " + parameters); return(resultSet.Tables[0].Columns.Cast <DataColumn>() .Select(x => new SqlColumns() { ColumnName = x.ColumnName, SqlDbType = x.DataType.Name }) .ToList()); }
protected void Page_Load(object sender, EventArgs e) { DB = new OperationsDB(); }