static void Main(string[] args) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); if (args.Length == 1 && args[0].CompareTo("DEBUG") == 0) { LoginUserInfo m_currentLoginUser = new LoginUserInfo(); if (AccessAuthorization.getInctance().passwordIsValidate("Manager", "Manager", out m_currentLoginUser)) //if (AccessAuthorization.getInctance().passwordIsValidate("老王", "12345", out m_currentLoginUser)) { DbPublic.getInctance().setCurrentLoginUserName(m_currentLoginUser.staffName); DbPublic.getInctance().setCurrentLoginUserID(m_currentLoginUser.pkey); //Application.Run(new FormProjectInfoTrack(FormProjectInfoTrack.OrderType.ALL)); //Application.Run(new FormTransfer()); //Application.Run(new FormProjectMaterielChangeOrder(1, "123")); //Application.Run(new FormProductionReport()); Application.Run(new FormMain()); return; } } FormLogin login = new FormLogin(); login.ShowDialog(); if (login.loginSuccessful()) { Application.Run(new FormMain()); } }
public FormStorageStockDetails() { InitializeComponent(); // 默认查询得本月第一天开始到本月最后一天的数据 DateTime nowDate = DateTime.Now; DateTime currentMonthFirstDay = new DateTime(nowDate.Year, nowDate.Month, 1); DateTime currentMonthLastDay = currentMonthFirstDay.AddMonths(1).AddDays(-1); m_countStartDate = currentMonthFirstDay.ToString("yyyyMMdd"); m_countEndDate = currentMonthLastDay.ToString("yyyyMMdd"); m_materielList = Materiel.getInctance().getAllMaterielInfo(); if (m_materielList.Count > 0) { m_currentRecordIndex = 0; } // 判断下是否有查看单价的权限 SortedDictionary <int, ActionTable> list = MainProgram.model.Action.getInctance().getActionInfoFromModuleID(m_moduleID); foreach (KeyValuePair <int, ActionTable> index in list) { if (index.Value.uiActionName == "dispaly") { m_isDisplayJG = AccessAuthorization.getInctance().isAccessAuthorization(index.Value.pkey, Convert.ToString(DbPublic.getInctance().getCurrentLoginUserID())); } } }
private void setPageActionEnable() { if (InitSubSystemSign.getInctance().isBusinessSystemInit()) { SortedDictionary <int, ActionTable> list = MainProgram.model.Action.getInctance().getActionInfoFromModuleID(401); foreach (KeyValuePair <int, ActionTable> index in list) { object activeObject = this.GetType().GetField(index.Value.uiActionName, System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.IgnoreCase).GetValue(this); bool isEnable = AccessAuthorization.getInctance().isAccessAuthorization(index.Value.pkey, Convert.ToString(DbPublic.getInctance().getCurrentLoginUserID())); if (activeObject != null) { UserInterfaceActonState.setUserInterfaceActonState(activeObject, ((System.Reflection.MemberInfo)(activeObject.GetType())).Name.ToString(), isEnable); } } } else { SortedDictionary <int, ActionTable> list2 = MainProgram.model.Action.getInctance().getActionInfoFromModuleID(601); foreach (KeyValuePair <int, ActionTable> index in list2) { object activeObject = this.GetType().GetField(index.Value.uiActionName, System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.IgnoreCase).GetValue(this); bool isEnable = AccessAuthorization.getInctance().isAccessAuthorization(index.Value.pkey, Convert.ToString(DbPublic.getInctance().getCurrentLoginUserID())); if (activeObject != null) { UserInterfaceActonState.setUserInterfaceActonState(activeObject, ((System.Reflection.MemberInfo)(activeObject.GetType())).Name.ToString(), isEnable); } } } }
private void FormLogin_Load(object sender, EventArgs e) { // 初始化用户名下拉列表框 SortedDictionary <int, LoginUserInfo> userList = AccessAuthorization.getInctance().getAllLoginUser(); // 需要把Manager用户设置成默认用户 this.comboBoxUserName.Items.Add("Manager"); foreach (KeyValuePair <int, LoginUserInfo> index in userList) { if (index.Value.staffName != "Manager") { this.comboBoxUserName.Items.Add(index.Value.staffName); } } this.comboBoxUserName.SelectedIndex = 0; }
private void buttonEnter_Click(object sender, EventArgs e) { if (AccessAuthorization.getInctance().passwordIsValidate(this.comboBoxUserName.Text.ToString(), this.textBoxPassword.Text.ToString(), out m_currentLoginUser)) { m_loginSuccessful = true; DbPublic.getInctance().setCurrentLoginUserName(m_currentLoginUser.staffName); DbPublic.getInctance().setCurrentLoginUserID(m_currentLoginUser.pkey); // 更新BASE_SYSTEM_CURRENT_LOGIN_USER表 CurrentLoginUser.getInctance().insert(); this.Close(); } else { MessageBoxExtend.messageWarning("密码错误,请重新输入!"); this.textBoxPassword.Text = ""; this.textBoxPassword.Focus(); } }
// 参数isDisplayJG代表实现显示单价列 public FormMaterielStorageAmountInfo(int displayDataType = -1, bool isDisplayJG = true) { InitializeComponent(); if (displayDataType != -1) { m_displayDataType = displayDataType; } else { m_displayDataType = (int)DisplayDataType.All; } if (isDisplayJG) { // 判断下是否有查看单价的权限 SortedDictionary <int, ActionTable> list = MainProgram.model.Action.getInctance().getActionInfoFromModuleID(105); foreach (KeyValuePair <int, ActionTable> index in list) { if (index.Value.uiActionName == "dispaly") { m_isDisplayJG = AccessAuthorization.getInctance().isAccessAuthorization(index.Value.pkey, Convert.ToString(DbPublic.getInctance().getCurrentLoginUserID())); } } } if (m_displayDataType == (int)DisplayDataType.Materiel) { this.Text = "当前库存信息(物料)"; } else if (m_displayDataType == (int)DisplayDataType.Product) { this.Text = "当前库存信息(商品)"; } else { this.Text = "当前库存信息"; } }
private void setPageActionEnable() { this.panelDBBackConfig.Enabled = AccessAuthorization.getInctance().isAccessAuthorization(111, Convert.ToString(DbPublic.getInctance().getCurrentLoginUserID())); }