Click here to Skip to main content
15,919,613 members

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?