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

                command.AddParameter(typeof(int), "MemberID", entity.MemberID);

                command.ExecuteNonQuery();
            }));
        }
Ejemplo n.º 2
0
        public void ReNewMember(Models.MemberDo entity)
        {
            db.CreateCommand(new Utils.SQL.SQLCommandHandler((Utils.SQL.ASQLDbCommand command) =>
            {
                command.CommandText = "[dbo].[sp_ReNew_Member]";
                command.CommandType = System.Data.CommandType.StoredProcedure;

                command.AddParameter(typeof(int), "MemberID", entity.MemberID);
                command.AddParameter(typeof(int), "BranchID", entity.BranchID);
                command.AddParameter(typeof(DateTime), "RegisterDate", entity.RegisterDate);
                command.AddParameter(typeof(DateTime), "ExpireDate", entity.ExpireDate);

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

                command.ExecuteNonQuery();
            }));
        }
Ejemplo n.º 3
0
        public Models.UpdateMemberResultDo CreateMember(Models.MemberDo entity)
        {
            Models.UpdateMemberResultDo result = new Models.UpdateMemberResultDo();

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

                command.AddParameter(typeof(string), "MemberCode", entity.MemberCode);
                command.AddParameter(typeof(int), "MemberTypeID", entity.MemberTypeID);
                command.AddParameter(typeof(int), "BranchID", entity.BranchID);
                command.AddParameter(typeof(int), "RenewTime", entity.RenewTime);
                command.AddParameter(typeof(string), "FirstName", entity.FirstName);
                command.AddParameter(typeof(string), "LastName", entity.LastName);
                command.AddParameter(typeof(DateTime), "BirthDate", entity.BirthDate);
                command.AddParameter(typeof(string), "Gender", entity.Gender);
                command.AddParameter(typeof(string), "Email", entity.Email);
                command.AddParameter(typeof(string), "TelNo", entity.TelNo);
                command.AddParameter(typeof(DateTime), "RegisterDate", entity.RegisterDate);
                command.AddParameter(typeof(DateTime), "ExpireDate", entity.ExpireDate);
                command.AddParameter(typeof(DateTime), "ActivateDate", entity.ActivateDate);
                command.AddParameter(typeof(string), "Address", entity.Address);
                command.AddParameter(typeof(string), "ProvinceID", entity.ProvinceID);
                command.AddParameter(typeof(string), "CantonID", entity.CantonID);
                command.AddParameter(typeof(string), "DistrictID", entity.DistrictID);
                command.AddParameter(typeof(string), "ZipCode", entity.ZipCode);
                command.AddParameter(typeof(bool), "FlagActive", entity.FlagActive);

                command.AddParameter(typeof(DateTime), "CreateDate", entity.CreateDate);
                command.AddParameter(typeof(string), "CreateUser", entity.CreateUser);

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

            return(result);
        }
Ejemplo n.º 4
0
        public Models.MemberDo GetMember(Models.MemberCriteriaDo criteria)
        {
            Models.MemberDo result = null;

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

                command.AddParameter(typeof(int), "MemberID", criteria.MemberID);
                command.AddParameter(typeof(DateTime), "CurrentDate", criteria.CurrentDate);

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

            return(result);
        }