Ejemplo n.º 1
0
 private void SetValue(FrameBaseFunction.Model.ClsRoleInfoMod clsMod)
 {
     this.txtRoleID.Text     = clsMod.vchrRoleID;
     this.txtRoleText.Text   = clsMod.vchrRoleText;
     this.txtReamrk.Text     = clsMod.vchrRemark;
     this.dtmCreate.DateTime = clsMod.dtmCreate;
 }
Ejemplo n.º 2
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public void Add(FrameBaseFunction.Model.ClsRoleInfoMod model, DataTable dt)
        {
            AddRoleBll(model.vchrRoleID);
            AddUserBll(dt);

            dal.AddSQL(model, dt);
        }
Ejemplo n.º 3
0
        public void UpdateSQL(FrameBaseFunction.Model.ClsRoleInfoMod model, DataTable dt)
        {
            ArrayList arrList = new ArrayList();
            string    sSQL    = UpdateRole(model);

            arrList.Add(sSQL);

            sSQL = "delete dbo._UserRoleInfo " +
                   "where vchrRoleID = '" + model.vchrRoleID + "' ";
            arrList.Add(sSQL);

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                FrameBaseFunction.Model.ClsUserRoleMod clsMod = new FrameBaseFunction.Model.ClsUserRoleMod();
                if (dt.Rows[i]["bChoosed"].ToString().Trim() == "√")
                {
                    clsMod.vchrUserID = dt.Rows[i]["vchrUID"].ToString().Trim();
                    clsMod.vchrRoleID = model.vchrRoleID;
                    string s = AddUserRole(clsMod);
                    arrList.Add(s);
                }
            }

            clsSQL.ExecSqlTran(arrList);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        private string AddRole(FrameBaseFunction.Model.ClsRoleInfoMod model)
        {
            int           iClose = 0;
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into _RoleInfo(");
            strSql.Append("vchrRoleID,vchrRoleText,vchrRemark,bClosed,dtmCreate");
            strSql.Append(")");
            strSql.Append(" values (");
            strSql.Append("'" + model.vchrRoleID + "',");
            strSql.Append("'" + model.vchrRoleText + "',");
            strSql.Append("'" + model.vchrRemark + "',");
            if (model.bClosed)
            {
                iClose = 1;
            }
            else
            {
                iClose = 0;
            }
            strSql.Append("" + iClose + ",");
            strSql.Append("'" + model.dtmCreate + "'");
            strSql.Append(")");
            return(strSql.ToString());
        }
Ejemplo n.º 5
0
        public FrmRoleEdit(Color color, FrameBaseFunction.Model.ClsRoleInfoMod clsRoleMod)
        {
            InitializeComponent();

            this.BackColor = color;
            sState         = "edit";
            clsMod         = clsRoleMod;
        }
Ejemplo n.º 6
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        private string UpdateRole(FrameBaseFunction.Model.ClsRoleInfoMod model)
        {
            int           iClose;
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update _RoleInfo set ");
            strSql.Append("vchrRoleText='" + model.vchrRoleText + "',");
            strSql.Append("vchrRemark='" + model.vchrRemark + "',");
            if (model.bClosed)
            {
                iClose = 1;
            }
            else
            {
                iClose = 0;
            }
            strSql.Append("bClosed=" + iClose + ",");
            strSql.Append("dtmCreate='" + model.dtmCreate + "'");
            strSql.Append(" where vchrRoleID='" + model.vchrRoleID + "'");
            return(strSql.ToString());
        }
Ejemplo n.º 7
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(FrameBaseFunction.Model.ClsRoleInfoMod model, DataTable dt)
 {
     dal.UpdateSQL(model, dt);
 }