Ejemplo n.º 1
0
        public void UpdateUserInfo(Models.UserDo entity)
        {
            db.CreateCommand(new Utils.SQL.SQLCommandHandler((Utils.SQL.ASQLDbCommand command) =>
            {
                command.CommandText = "[dbo].[sp_Update_UserInfo]";
                command.CommandType = System.Data.CommandType.StoredProcedure;

                command.AddParameter(typeof(string), "UserID", entity.UserID);
                command.AddParameter(typeof(string), "FirstName", entity.FirstName);
                command.AddParameter(typeof(string), "LastName", entity.LastName);

                command.AddParameter(typeof(string), "NickName", entity.NickName);
                command.AddParameter(typeof(string), "CitizenID", entity.CitizenID);
                command.AddParameter(typeof(DateTime), "BirthDate", entity.BirthDate);
                command.AddParameter(typeof(string), "Address", entity.Address);
                command.AddParameter(typeof(string), "TelNo", entity.TelNo);
                command.AddParameter(typeof(string), "Gender", entity.Gender);
                command.AddParameter(typeof(string), "Email", entity.Email);

                command.AddParameter(typeof(DateTime), "UpdateDate", entity.UpdateDate);
                command.AddParameter(typeof(string), "UpdateUser", entity.UpdateUser);

                command.ExecuteScalar();
            }));
        }
Ejemplo n.º 2
0
        public Models.UserDo GetUser(Models.UserCriteriaDo criteria)
        {
            Models.UserDo result = null;

            db.CreateCommand(new Utils.SQL.SQLCommandHandler((Utils.SQL.ASQLDbCommand command) =>
            {
                command.CommandText = "[dbo].[sp_Get_User]";
                command.CommandType = System.Data.CommandType.StoredProcedure;

                command.AddParameter(typeof(string), "UserName", criteria.UserName);

                List <Models.UserDo> list = command.ToList <Models.UserDo>();
                if (list != null)
                {
                    if (list.Count > 0)
                    {
                        result = list[0];
                    }
                }
            }));

            return(result);
        }