Exemple #1
0
        public CardManage.Model.UserInfo GetModel(int ID)
        {
            CardManage.Model.UserInfo model = null;

            MySqlParameter[] parameters =
            {
                new MySqlParameter("@SelNum",       MySqlDbType.Int32),
                new MySqlParameter("@Where_String", MySqlDbType.VarChar)
            };
            parameters[0].Value = 1;
            parameters[1].Value = string.Format("ID={0}", ID);

            DataSet ds = DbHelperSQL.RunProcedure(string.Format("{0}_GetBywhere_Num", this._TableName), parameters, "ds");

            if (ds.Tables[0].Rows.Count > 0)
            {
                model = new Model.UserInfo()
                {
                    ID = ID
                };
                DataRow dRow = ds.Tables[0].Rows[0];
                model.UserName = Functions.FormatString(dRow["UserName"]);
                model.Flag     = Functions.FormatInt(dRow["Flag"]);
                model.FlagDesc = Functions.FormatString(dRow["FlagDesc"]);
                model.UserPwd  = Functions.FormatString(dRow["UserPwd"]);
                model.IfFrezen = Convert.ToBoolean(dRow["IfFrezen"]);
                model.Memo     = Functions.FormatString(dRow["Memo"]);
                return(model);
            }
            else
            {
                return(null);
            }
        }
Exemple #2
0
        public CardViewForm(string strTitle, bool bIsModal, CardManage.Model.UserInfo objUserInfo, CardManage.Model.WindowSize objWindowSize = null, CardManage.Model.Flag objFlag = null)
            : base(strTitle, bIsModal, objUserInfo, objWindowSize, objFlag)
        {
            InitializeComponent();
            this.Text = strTitle;

            //初始化时扇区默认为1,不可编辑不可选择,扇区重置按钮默认不可见
            cbCHS.Items.Clear();
            cbCHS.Items.Add(RunVariable.CurrentSetting.OtherSetting.Chs);
            cbCHS.SelectedIndex = 0;

#if DEBUG
            cbCHS.Visible = true;
#else
            cbCHS.Visible = false;
#endif
            //_CurrentAction 判断是类型 是创建还是修改
            this._CurrentAction = (EAction)objFlag.Keyword1;
            if (objFlag.Keyword2 != null)
            {
                switch (this._CurrentAction)
                {
                case EAction.Create:
                    this._CurrentBuildingID = Convert.ToInt32(objFlag.Keyword2);
                    break;

                case EAction.Edit:
                    this._CurrentID = Convert.ToInt32(objFlag.Keyword2);
                    break;
                }
            }
            //渲染界面
            gbDebg.Visible = RunVariable.IfDebug;
        }
        public CommLogManageForm(string strTitle, bool bIsModal, CardManage.Model.UserInfo objUserInfo, CardManage.Model.WindowSize objWindowSize = null, CardManage.Model.Flag objFlag = null)
            : base(strTitle, bIsModal, objUserInfo, objWindowSize, objFlag)
        {
            InitializeComponent();
            this.Text = strTitle;

            this.LVHeaderSetting = "序号,50|创建时间,100|数据包类型,100|数据内容,400";
        }
Exemple #4
0
 public UserManageForm(string strTitle, bool bIsModal, CardManage.Model.UserInfo objUserInfo, CardManage.Model.WindowSize objWindowSize = null, CardManage.Model.Flag objFlag = null)
     : base(strTitle, bIsModal, objUserInfo, objWindowSize, objFlag)
 {
     InitializeComponent();
     this.Text = strTitle;
     this.HideSearchButton();
     //表头
     this.LVHeaderSetting = "序号,50|用户名,100|角色,180|备注,300";
 }
Exemple #5
0
 public CardManageForm(string strTitle, bool bIsModal, CardManage.Model.UserInfo objUserInfo, CardManage.Model.WindowSize objWindowSize = null, CardManage.Model.Flag objFlag = null)
     : base(strTitle, bIsModal, objUserInfo, objWindowSize, objFlag)
 {
     InitializeComponent();
     this.Text = strTitle;
     this.SetCreateButtonText("发卡读卡");
     this.SetEditButtonText("编辑卡片");
     this.SetDeleteButtonText("删除卡片");
     this.LVHeaderSetting = "序号,50|卡号,80|卡片类型,70|小区编码,70|楼栋编码,70|单元编码,70|房间编码,80|卡片系列号,210|卡片有效期,100|发卡时间,100|持卡者姓名,100|联系电话,100|所在房间,100|所在单元,100|所在楼栋,100|所在小区,120";
 }
Exemple #6
0
        public TreeFormBase(string strTitle, bool bIsModal, CardManage.Model.UserInfo objUserInfo, CardManage.Model.WindowSize objWindowSize = null, CardManage.Model.Flag objFlag = null)
            : base(strTitle, bIsModal, objUserInfo, objWindowSize, objFlag)
        {
            InitializeComponent();
            this.Text = strTitle;

            //普通管理员没有修改功能
            bool bIsSupper = objUserInfo.Flag.Equals(0);

            newToolStripButton.Visible    = bIsSupper;
            editToolStripButton.Visible   = bIsSupper;
            deleteToolStripButton.Visible = bIsSupper;
        }
        public BuildingManageForm(string strTitle, bool bIsModal, CardManage.Model.UserInfo objUserInfo, CardManage.Model.WindowSize objWindowSize = null, CardManage.Model.Flag objFlag = null)
            : base(strTitle, bIsModal, objUserInfo, objWindowSize, objFlag)
        {
            InitializeComponent();
            this.Text = strTitle;
            HideSearchButton();

            this._DataType = (this.Flag == null) ? 0 : Functions.FormatInt(this.Flag.Keyword1);
            if (this._DataType < 0 || this._DataType > 4)
            {
                this._DataType = 0;
            }

            //模块表头
            switch (this._DataType)
            {
            case 0:
                this._DataTypeName   = "小区";
                this.LVHeaderSetting = "序号,50|小区名称,100|小区编码,80|小区序列号,220|管理员姓名,100|管理员联系电话,110";
                HideTree();
                break;

            case 1:
                this._DataTypeName   = "楼栋";
                this.LVHeaderSetting = "序号,50|楼栋名称,100|楼栋编码,80|所在小区,100|管理员姓名,100|管理员联系电话,110";
                break;

            case 2:
                this._DataTypeName   = "单元";
                this.LVHeaderSetting = "序号,50|单元名称,100|单元编码,80|所在楼栋,100|所在小区,120|管理员姓名,100|管理员联系电话,110";
                break;

            case 3:
                this._DataTypeName   = "房间";
                this.LVHeaderSetting = "序号,50|房间名称,100|房间编码,80|所在单元,100|所在楼栋,100|所在小区,120|管理员姓名,100|管理员联系电话,110";
                break;
            }
        }
Exemple #8
0
        public int Add(CardManage.Model.UserInfo model, out string strErrorInfo)
        {
            strErrorInfo = "";
            MySqlParameter[] parameters =
            {
                new MySqlParameter("@ErrorInfo", MySqlDbType.VarChar,  500),
                new MySqlParameter("@NewID",     MySqlDbType.Int32),
                new MySqlParameter("@Tag",       MySqlDbType.Int32),   //类型
                new MySqlParameter("@iID",       MySqlDbType.Int32),
                new MySqlParameter("@iUserName", MySqlDbType.VarChar),
                new MySqlParameter("@iUserPwd",  MySqlDbType.VarChar),
                new MySqlParameter("@iFlag",     MySqlDbType.Int32),
                new MySqlParameter("@iIfFrezen", MySqlDbType.Int32),
                new MySqlParameter("@iMemo",     MySqlDbType.VarChar)
            };
            parameters[0].Direction = ParameterDirection.Output;
            parameters[1].Direction = ParameterDirection.Output;
            parameters[2].Value     = 0;//新增
            parameters[3].Value     = 0;
            parameters[4].Value     = model.UserName;
            parameters[5].Value     = model.UserPwd;
            parameters[6].Value     = model.Flag;
            parameters[7].Value     = model.IfFrezen;
            parameters[8].Value     = model.Memo;

            try
            {
                DbHelperSQL.RunProcedure(string.Format("{0}_ADD_UPDATE", this._TableName), parameters, out int rowsAffected);
                strErrorInfo = Functions.FormatString(parameters[0].Value);
                int iNewID = Functions.FormatInt(parameters[1].Value);
                return(iNewID);
            }
            catch (MySqlException ex)
            {
                strErrorInfo = ex.Message;
                return(0);
            }
        }
Exemple #9
0
        public SetFormBase(string strTitle, bool bIsModal, CardManage.Model.UserInfo objUserInfo, CardManage.Model.WindowSize objWindowSize = null, CardManage.Model.Flag objFlag = null)
            : base(strTitle, bIsModal, objUserInfo, objWindowSize, objFlag)
        {
            InitializeComponent();
            this.Text = strTitle;

            if (this.Text == "数据库备份")
            {
                this.label100.Text = "备份时请选择您要保存的位置与备份文件名";
                this.btnOK.Text    = "备份";
            }
            else if (this.Text == "数据库还原")
            {
                this.label100.Text = "还原时请选择您要还原的数据库备份文件";
                this.btnOK.Text    = "还原";
            }
            else
            {
                this.label100.Text    = "";
                this.label100.Visible = false;
            }
            // this.btnOK
            //   this.btnCancel
        }
Exemple #10
0
        public FormBase(string strTitle, bool bIsModal, CardManage.Model.UserInfo objUserInfo, CardManage.Model.WindowSize objWindowSize = null, CardManage.Model.Flag objFlag = null)
        {
            this.CurrentUserInfo = (objUserInfo == null) ? null : (UserInfo)objUserInfo.Clone();
            this.WindowSize      = objWindowSize;
            this.Flag            = objFlag;

            InitializeComponent();
            this.Text          = strTitle;
            this.StartPosition = FormStartPosition.CenterParent;
            if (bIsModal)
            {
                this.MaximizeBox = false;
                this.MinimizeBox = false;

                this.Width       = (objWindowSize == null) ? this._DefaultWidth : objWindowSize.Width;
                this.Height      = (objWindowSize == null) ? this._DefaultHeight : objWindowSize.Height;
                this.MaximumSize = this.Size;
                this.MinimumSize = this.Size;
            }
            else
            {
                this.WindowState = FormWindowState.Maximized;
            }
        }
 public SelectBuildingForm(string strTitle, bool bIsModal, CardManage.Model.UserInfo objUserInfo, CardManage.Model.WindowSize objWindowSize = null, CardManage.Model.Flag objFlag = null)
     : base(strTitle, bIsModal, objUserInfo, objWindowSize, objFlag)
 {
     InitializeComponent();
     this.Text = strTitle;
 }