15,885,063 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by MitchCZ (Top 3 by date)
MitchCZ
14-May-20 8:07am
View
That's true, static variables are a way to hell..(convinced :))
So, I should the excel files import to the database first and then manage the data with gridviews on the page standardly.
However, there is still a problem with the variable number of excel files. It depends on the the user's input. So it's not clear to me how to create a variable count of gridviews on the one page, select a rows from all grids at one time and continue by click on the button (save selected rows to new data table and forward to the next page..) It seems that I have to save the checked rows (true/false) to the database as a special column first and only then press the button..??
MitchCZ
14-May-20 5:25am
View
Thank you Richard.
It seems there is no good solution.
I do not know if it is a clear programming solution, but I will try to create one gridview in aspx page for all excel files, iteratively add records and separate it by empty row in grid. If I think correctly..
What I need to do next is select some rows and than save to the data table in the database.
Btw. Is there the same problem with ASP.NET MVC where everything is created dynamically?
MitchCZ
24-Jun-19 5:05am
View
Uff, you are right! :) it looks like on a absolutly bad solution...
main Login.aspx:
protected void LoginMain_LoggedIn(object sender, EventArgs e)
{
GlobalSettings gSet = new GlobalSettings(LoginMain.UserName.ToString());
}
Constructor of GlobalSettings:
public GlobalSettings(string uName)
{
UserName = uName;
User_Name = GetNameLogged();
UserDepartmentNo = GetDepartmentNoLogged();
UserRole = GetUserRole();
IdOrder = 0;
IdOrderURL = 0;
IdOrderQString = 0;
OrderState = 1;
OrderWorking = false;
OrderJustReleased = false;
AHUCount = 0;
UserTrade = IsUserRoleTRADE(UserName);
UserOdbyt = IsUserRoleODBYT(UserName);
UserOdbytDep = IsUserRoleODBYTDEP(UserName);
UserRoleMain = SetUserRole(UserName);
}
Private variables:
private static string userName;
public static string UserName
{
get { return userName; }
set { userName = value; }
}
private static string user_Name;
public static string User_Name
{
get { return user_Name; }
set { user_Name = value; }
}
private static string userRole;
public static string UserRole
{
get { return userRole; }
set { userRole = value; }
}
...
What now?