Exemplo n.º 1
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public bool Add(AndroidMvcServer.Model.Tb_MeetingRoom model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("insert into tb_meetingroom(");
            strSql.Append("RoomId,RoomName,RoomAddr,RoomCapacity,RoomDesc,CompId,Phone,Equipments)");
            strSql.Append(" values (");
            strSql.Append("@RoomId,@RoomName,@RoomAddr,@RoomCapacity,@RoomDesc,@CompId,@Phone,@Equipments)");
            MySqlParameter[] parameters = {
                    new MySqlParameter("@RoomId", MySqlDbType.Int32,11),
                    new MySqlParameter("@RoomName", MySqlDbType.VarChar,50),
                    new MySqlParameter("@RoomAddr", MySqlDbType.VarChar,50),
                    new MySqlParameter("@RoomCapacity", MySqlDbType.Int32,11),
                    new MySqlParameter("@RoomDesc", MySqlDbType.LongText),
                    new MySqlParameter("@CompId", MySqlDbType.VarChar,50),
                    new MySqlParameter("@Phone", MySqlDbType.VarChar,11),
                    new MySqlParameter("@Equipments", MySqlDbType.VarChar,5)};
            parameters[0].Value = model.RoomId;
            parameters[1].Value = model.RoomName;
            parameters[2].Value = model.RoomAddr;
            parameters[3].Value = model.RoomCapacity;
            parameters[4].Value = model.RoomDesc;
            parameters[5].Value = model.CompId;
            parameters[6].Value = model.Phone;
            parameters[7].Value = model.Equipments;

            int rows = DbHelperMySQL.ExecuteSql(strSql.ToString(), parameters);
            if (rows > 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public bool Add(AndroidMvcServer.Model.Tb_User model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("insert into tb_user(");
            strSql.Append("UserId,UserName,EnglishName,Pwd,Status,DeptId,Gender,Signature,HeadPic,CellPhone,OfficePhone,Email,Position,DisplayIndex,Comment)");
            strSql.Append(" values (");
            strSql.Append("@UserId,@UserName,@EnglishName,@Pwd,@Status,@DeptId,@Gender,@Signature,@HeadPic,@CellPhone,@OfficePhone,@Email,@Position,@DisplayIndex,@Comment)");
            MySqlParameter[] parameters = {
                    new MySqlParameter("@UserId", MySqlDbType.VarChar,15),
                    new MySqlParameter("@UserName", MySqlDbType.VarChar,10),
                    new MySqlParameter("@EnglishName", MySqlDbType.VarChar,15),
                    new MySqlParameter("@Pwd", MySqlDbType.VarChar,32),
                    new MySqlParameter("@Status", MySqlDbType.Int32,11),
                    new MySqlParameter("@DeptId", MySqlDbType.VarChar,50),
                    new MySqlParameter("@Gender", MySqlDbType.Bit,4),
                    new MySqlParameter("@Signature", MySqlDbType.VarChar,50),
                    new MySqlParameter("@HeadPic", MySqlDbType.Int32,11),
                    new MySqlParameter("@CellPhone", MySqlDbType.VarChar,11),
                    new MySqlParameter("@OfficePhone", MySqlDbType.VarChar,16),
                    new MySqlParameter("@Email", MySqlDbType.VarChar,50),
                    new MySqlParameter("@Position", MySqlDbType.VarChar,50),
                    new MySqlParameter("@DisplayIndex", MySqlDbType.Int32,11),
                    new MySqlParameter("@Comment", MySqlDbType.VarChar,50)};
            parameters[0].Value = model.UserId;
            parameters[1].Value = model.UserName;
            parameters[2].Value = model.EnglishName;
            parameters[3].Value = model.Pwd;
            parameters[4].Value = model.Status;
            parameters[5].Value = model.DeptId;
            parameters[6].Value = model.Gender;
            parameters[7].Value = model.Signature;
            parameters[8].Value = model.HeadPic;
            parameters[9].Value = model.CellPhone;
            parameters[10].Value = model.OfficePhone;
            parameters[11].Value = model.Email;
            parameters[12].Value = model.Position;
            parameters[13].Value = model.DisplayIndex;
            parameters[14].Value = model.Comment;

            int rows = DbHelperMySQL.ExecuteSql(strSql.ToString(), parameters);
            if (rows > 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public bool Add(AndroidMvcServer.Model.Tb_Group model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("insert into tb_group(");
            strSql.Append("groupId,groupName,groupDesc,groupOwner,groupIcon,members,allowInvite,membersSize,maxUsers,isPublic)");
            strSql.Append(" values (");
            strSql.Append("@groupId,@groupName,@groupDesc,@groupOwner,@groupIcon,@members,@allowInvite,@membersSize,@maxUsers,@isPublic)");
            MySqlParameter[] parameters = {
                    new MySqlParameter("@groupId", MySqlDbType.VarChar,50),
                    new MySqlParameter("@groupName", MySqlDbType.VarChar,50),
                    new MySqlParameter("@groupDesc", MySqlDbType.VarChar,250),
                    new MySqlParameter("@groupOwner", MySqlDbType.VarChar,15),
                    new MySqlParameter("@groupIcon", MySqlDbType.Int32,11),
                    new MySqlParameter("@members", MySqlDbType.VarChar,255),
                    new MySqlParameter("@allowInvite", MySqlDbType.Bit,4),
                    new MySqlParameter("@membersSize", MySqlDbType.Int32,11),
                    new MySqlParameter("@maxUsers", MySqlDbType.Int32,11),
                    new MySqlParameter("@isPublic", MySqlDbType.Bit,4)};
            parameters[0].Value = model.groupId;
            parameters[1].Value = model.groupName;
            parameters[2].Value = model.groupDesc;
            parameters[3].Value = model.groupOwner;
            parameters[4].Value = model.groupIcon;
            parameters[5].Value = model.members;
            parameters[6].Value = model.allowInvite;
            parameters[7].Value = model.membersSize;
            parameters[8].Value = model.maxUsers;
            parameters[9].Value = model.isPublic;

            int rows = DbHelperMySQL.ExecuteSql(strSql.ToString(), parameters);
            if (rows > 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public bool Add(AndroidMvcServer.Model.Tb_Dept model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("insert into tb_dept(");
            strSql.Append("DepId,DepName,ParDepId,DisplayIndex,DirectorId,DepEmail,Status,IsLeaf,Comment)");
            strSql.Append(" values (");
            strSql.Append("@DepId,@DepName,@ParDepId,@DisplayIndex,@DirectorId,@DepEmail,@Status,@IsLeaf,@Comment)");
            MySqlParameter[] parameters = {
                    new MySqlParameter("@DepId", MySqlDbType.VarChar,50),
                    new MySqlParameter("@DepName", MySqlDbType.VarChar,50),
                    new MySqlParameter("@ParDepId", MySqlDbType.VarChar,50),
                    new MySqlParameter("@DisplayIndex", MySqlDbType.Int32,11),
                    new MySqlParameter("@DirectorId", MySqlDbType.VarChar,15),
                    new MySqlParameter("@DepEmail", MySqlDbType.VarChar,200),
                    new MySqlParameter("@Status", MySqlDbType.Int32,11),
                    new MySqlParameter("@IsLeaf", MySqlDbType.Int16,4),
                    new MySqlParameter("@Comment", MySqlDbType.VarChar,255)};
            parameters[0].Value = model.DepId;
            parameters[1].Value = model.DepName;
            parameters[2].Value = model.ParDepId;
            parameters[3].Value = model.DisplayIndex;
            parameters[4].Value = model.DirectorId;
            parameters[5].Value = model.DepEmail;
            parameters[6].Value = model.Status;
            parameters[7].Value = model.IsLeaf;
            parameters[8].Value = model.Comment;

            int rows = DbHelperMySQL.ExecuteSql(strSql.ToString(), parameters);
            if (rows > 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(AndroidMvcServer.Model.Tb_MeetingRoom model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("update tb_meetingroom set ");
            strSql.Append("RoomName=@RoomName,");
            strSql.Append("RoomAddr=@RoomAddr,");
            strSql.Append("RoomCapacity=@RoomCapacity,");
            strSql.Append("RoomDesc=@RoomDesc,");
            strSql.Append("CompId=@CompId,");
            strSql.Append("Phone=@Phone,");
            strSql.Append("Equipments=@Equipments");
            strSql.Append(" where RoomId=@RoomId ");
            MySqlParameter[] parameters = {
                    new MySqlParameter("@RoomName", MySqlDbType.VarChar,50),
                    new MySqlParameter("@RoomAddr", MySqlDbType.VarChar,50),
                    new MySqlParameter("@RoomCapacity", MySqlDbType.Int32,11),
                    new MySqlParameter("@RoomDesc", MySqlDbType.LongText),
                    new MySqlParameter("@CompId", MySqlDbType.VarChar,50),
                    new MySqlParameter("@Phone", MySqlDbType.VarChar,11),
                    new MySqlParameter("@Equipments", MySqlDbType.VarChar,5),
                    new MySqlParameter("@RoomId", MySqlDbType.Int32,11)};
            parameters[0].Value = model.RoomName;
            parameters[1].Value = model.RoomAddr;
            parameters[2].Value = model.RoomCapacity;
            parameters[3].Value = model.RoomDesc;
            parameters[4].Value = model.CompId;
            parameters[5].Value = model.Phone;
            parameters[6].Value = model.Equipments;
            parameters[7].Value = model.RoomId;

            int rows = DbHelperMySQL.ExecuteSql(strSql.ToString(), parameters);
            if (rows > 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
Exemplo n.º 6
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(AndroidMvcServer.Model.Tb_User model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("update tb_user set ");
            strSql.Append("UserName=@UserName,");
            strSql.Append("EnglishName=@EnglishName,");
            strSql.Append("Pwd=@Pwd,");
            strSql.Append("Status=@Status,");
            strSql.Append("DeptId=@DeptId,");
            strSql.Append("Gender=@Gender,");
            strSql.Append("Signature=@Signature,");
            strSql.Append("HeadPic=@HeadPic,");
            strSql.Append("CellPhone=@CellPhone,");
            strSql.Append("OfficePhone=@OfficePhone,");
            strSql.Append("Email=@Email,");
            strSql.Append("Position=@Position,");
            strSql.Append("DisplayIndex=@DisplayIndex,");
            strSql.Append("Comment=@Comment");
            strSql.Append(" where UserId=@UserId ");
            MySqlParameter[] parameters = {
                    new MySqlParameter("@UserName", MySqlDbType.VarChar,10),
                    new MySqlParameter("@EnglishName", MySqlDbType.VarChar,15),
                    new MySqlParameter("@Pwd", MySqlDbType.VarChar,32),
                    new MySqlParameter("@Status", MySqlDbType.Int32,11),
                    new MySqlParameter("@DeptId", MySqlDbType.VarChar,50),
                    new MySqlParameter("@Gender", MySqlDbType.Bit,4),
                    new MySqlParameter("@Signature", MySqlDbType.VarChar,50),
                    new MySqlParameter("@HeadPic", MySqlDbType.Int32,11),
                    new MySqlParameter("@CellPhone", MySqlDbType.VarChar,11),
                    new MySqlParameter("@OfficePhone", MySqlDbType.VarChar,16),
                    new MySqlParameter("@Email", MySqlDbType.VarChar,50),
                    new MySqlParameter("@Position", MySqlDbType.VarChar,50),
                    new MySqlParameter("@DisplayIndex", MySqlDbType.Int32,11),
                    new MySqlParameter("@Comment", MySqlDbType.VarChar,50),
                    new MySqlParameter("@UserId", MySqlDbType.VarChar,15)};
            parameters[0].Value = model.UserName;
            parameters[1].Value = model.EnglishName;
            parameters[2].Value = model.Pwd;
            parameters[3].Value = model.Status;
            parameters[4].Value = model.DeptId;
            parameters[5].Value = model.Gender;
            parameters[6].Value = model.Signature;
            parameters[7].Value = model.HeadPic;
            parameters[8].Value = model.CellPhone;
            parameters[9].Value = model.OfficePhone;
            parameters[10].Value = model.Email;
            parameters[11].Value = model.Position;
            parameters[12].Value = model.DisplayIndex;
            parameters[13].Value = model.Comment;
            parameters[14].Value = model.UserId;

            int rows = DbHelperMySQL.ExecuteSql(strSql.ToString(), parameters);
            if (rows > 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
Exemplo n.º 7
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(AndroidMvcServer.Model.Tb_Dept model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("update tb_dept set ");
            strSql.Append("DepName=@DepName,");
            strSql.Append("ParDepId=@ParDepId,");
            strSql.Append("DisplayIndex=@DisplayIndex,");
            strSql.Append("DirectorId=@DirectorId,");
            strSql.Append("DepEmail=@DepEmail,");
            strSql.Append("Status=@Status,");
            strSql.Append("IsLeaf=@IsLeaf,");
            strSql.Append("Comment=@Comment");
            strSql.Append(" where DepId=@DepId ");
            MySqlParameter[] parameters = {
                    new MySqlParameter("@DepName", MySqlDbType.VarChar,50),
                    new MySqlParameter("@ParDepId", MySqlDbType.VarChar,50),
                    new MySqlParameter("@DisplayIndex", MySqlDbType.Int32,11),
                    new MySqlParameter("@DirectorId", MySqlDbType.VarChar,15),
                    new MySqlParameter("@DepEmail", MySqlDbType.VarChar,200),
                    new MySqlParameter("@Status", MySqlDbType.Int32,11),
                    new MySqlParameter("@IsLeaf", MySqlDbType.Bit,1),
                    new MySqlParameter("@Comment", MySqlDbType.VarChar,255),
                    new MySqlParameter("@DepId", MySqlDbType.VarChar,50)};
            parameters[0].Value = model.DepName;
            parameters[1].Value = model.ParDepId;
            parameters[2].Value = model.DisplayIndex;
            parameters[3].Value = model.DirectorId;
            parameters[4].Value = model.DepEmail;
            parameters[5].Value = model.Status;
            parameters[6].Value = model.IsLeaf;
            parameters[7].Value = model.Comment;
            parameters[8].Value = model.DepId;

            int rows = DbHelperMySQL.ExecuteSql(strSql.ToString(), parameters);
            if (rows > 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
Exemplo n.º 8
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public bool Add(AndroidMvcServer.Model.Tb_MeetingRoom model)
 {
     return true;
 }
Exemplo n.º 9
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(AndroidMvcServer.Model.Tb_MeetingRoom model)
 {
     return false;
 }
Exemplo n.º 10
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(AndroidMvcServer.Model.Tb_Group model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("update tb_group set ");
            strSql.Append("groupName=@groupName,");
            strSql.Append("groupDesc=@groupDesc,");
            strSql.Append("groupOwner=@groupOwner,");
            strSql.Append("groupIcon=@groupIcon,");
            strSql.Append("members=@members,");
            strSql.Append("allowInvite=@allowInvite,");
            strSql.Append("membersSize=@membersSize,");
            strSql.Append("maxUsers=@maxUsers,");
            strSql.Append("isPublic=@isPublic");
            strSql.Append(" where groupId=@groupId ");
            MySqlParameter[] parameters = {
                    new MySqlParameter("@groupName", MySqlDbType.VarChar,50),
                    new MySqlParameter("@groupDesc", MySqlDbType.VarChar,250),
                    new MySqlParameter("@groupOwner", MySqlDbType.VarChar,15),
                    new MySqlParameter("@groupIcon", MySqlDbType.Int32,11),
                    new MySqlParameter("@members", MySqlDbType.VarChar,255),
                    new MySqlParameter("@allowInvite", MySqlDbType.Bit,4),
                    new MySqlParameter("@membersSize", MySqlDbType.Int32,11),
                    new MySqlParameter("@maxUsers", MySqlDbType.Int32,11),
                    new MySqlParameter("@isPublic", MySqlDbType.Bit,4),
                    new MySqlParameter("@groupId", MySqlDbType.VarChar,50)};
            parameters[0].Value = model.groupName;
            parameters[1].Value = model.groupDesc;
            parameters[2].Value = model.groupOwner;
            parameters[3].Value = model.groupIcon;
            parameters[4].Value = model.members;
            parameters[5].Value = model.allowInvite;
            parameters[6].Value = model.membersSize;
            parameters[7].Value = model.maxUsers;
            parameters[8].Value = model.isPublic;
            parameters[9].Value = model.groupId;

            int rows = DbHelperMySQL.ExecuteSql(strSql.ToString(), parameters);
            if (rows > 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }