예제 #1
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public void Add(系统服务.Model.ClsRoleInfoMod model, DataTable dt)
        {
            AddRoleBll(model.vchrRoleID);
            AddUserBll(dt);

            dal.AddSQL(model, dt);
        }
예제 #2
0
        public void UpdateSQL(系统服务.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++)
            {
                系统服务.Model.ClsUserRoleMod clsMod = new 系统服务.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);
        }
예제 #3
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        private string AddRole(系统服务.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());
        }
예제 #4
0
 private void SetValue(系统服务.Model.ClsRoleInfoMod clsMod)
 {
     this.txtRoleID.Text     = clsMod.vchrRoleID;
     this.txtRoleText.Text   = clsMod.vchrRoleText;
     this.txtReamrk.Text     = clsMod.vchrRemark;
     this.dtmCreate.DateTime = clsMod.dtmCreate;
 }
예제 #5
0
        public FrmRoleEdit(Color color, 系统服务.Model.ClsRoleInfoMod clsRoleMod)
        {
            InitializeComponent();

            this.BackColor = color;
            sState         = "edit";
            clsMod         = clsRoleMod;
        }
예제 #6
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        private string UpdateRole(系统服务.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());
        }
예제 #7
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(系统服务.Model.ClsRoleInfoMod model, DataTable dt)
 {
     dal.UpdateSQL(model, dt);
 }