/// <summary> /// Check Login /// </summary> private void checkLogin() { CommandResult opResult; BaseBLL.General.FormModelHelper <Common.BLL.Entity.GasStation.User> .fillModel(userDataGroupBox, user); if (isValid(user)) { opResult = lUser.read(user, "username,password"); if ((opResult.status == BaseDAL.Base.EnumCommandStatus.success) && (user.id > 0)) { Common.GlobalData.UserManager.currentUser = user; __Program.hasLogin = 1; Close(); } else { MessageBox.Show(this, "اطلاعات کاربری خود را بررسی نمایید", "اخطار", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } else { MessageBox.Show(this, "اطلاعات کاربری خود را وارد نمایید", "اخطار", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } // Set focus usernameTextBox.Focus(); }
/// <summary> /// Prepare /// </summary> private static void prepare() { // Prepare __Program.hasLogin = 0; // Initilization string exePath = System.Reflection.Assembly.GetExecutingAssembly().Location; Common.Initializer.init(Path.Combine(Application.StartupPath, "log.txt"), exePath); ///FOR TEST Common.BLL.Entity.GasStation.User user = new Common.BLL.Entity.GasStation.User(); Common.BLL.Logic.GasStation.User luser = new Common.BLL.Logic.GasStation.User(Common.Enum.EDatabase.GasStation); user.id = 2; luser.read(user); Common.GlobalData.UserManager.currentUser = user; //Helper.GridHeaderMaker.makeHeaderOwnerUserControls(); //Helper.GridHeaderMaker.makeHeaderCarUserControls(); //Helper.GridHeaderMaker.makeHeaderTrafficUserControls(); Helper.GridHeaderMaker.makeHeaderReportTraffic(); //Helper.GridHeaderMaker.makeHeaderSearchOwner(); //Helper.GridHeaderMaker.makeHeaderOwner(); //Helper.GridHeaderMaker.makeHeaderCarColor(); //Helper.GridHeaderMaker.makeHeaderCarLevel(); //Helper.GridHeaderMaker.makeHeaderCarFuel(); //Helper.GridHeaderMaker.makeHeaderCarSystem(); //Helper.GridHeaderMaker.makeHeaderCarType(); //Helper.GridHeaderMaker.makeHeaderPlateType(); //Helper.GridHeaderMaker.makeHeaderPlateCity(); }