Пример #1
0
        public int SaveMemberAndDetail(Member m, MemberAddress[] ma)
        {
            int    MemberId = 0;
            int    result   = 0;
            Member member   = new Member();

            member.LoginName = m.LoginName;
            member.PassWord  = m.PassWord;
            //
            MemberId = member.Save();
            if (MemberId > 0)
            {
                for (int i = 0; i < ma.Length; i++)
                {
                    MemberAddress memberAddress = new MemberAddress();
                    memberAddress.MemberId = ma[i].MemberId;
                    //
                    if (memberAddress.Save() > 0)
                    {
                        result += 1;
                    }
                }
            }
            return(result);
        }
Пример #2
0
        private Order GetOrderInfoByApply(ViewVIPApply apply, int RowNum, Customer customer)
        {
            Order order = new Order();

            order.Address = apply.Address;
            order.ComId   = apply.ComId;
            order.Company = apply.CompanyName;

            VIPApply va = new VIPApply(apply.Id);

            if (va.NewDeptId != 0)
            {
                order.DeptId = va.NewDeptId;
                Dept dept = new Dept(va.NewDeptId);
                order.DeptName = dept.Name;
            }
            else
            {
                order.DeptId   = apply.DeptId;
                order.DeptName = apply.DeptName;
            }
            order.GrossProfit = 0;
            order.MemberId    = apply.MemberId;
            order.Memo        = apply.Memo;
            order.Mobile      = apply.Mobile;
            order.OrderTime   = DateTime.Now;
            order.OrderType   = CommenClass.OrderType.网上订单.ToString();
            order.PayStatus   = CommenClass.PayStatus.未付款.ToString();
            order.PlanDate    = DateTime.Now.AddDays(1);
            order.Point       = 0;
            order.PrintNum    = 0;
            order.RealName    = apply.RealName;
            order.RowNum      = RowNum;
            order.SaveNum     = 0;
            order.SumMoney    = apply.SumMoney;
            order.Telphone    = apply.Telphone;
            order.UpdateTime  = DateTime.Now;
            order.UserId      = 0;
            order.ApplyId     = apply.Id;

            MemberAddress address = new MemberAddress();

            address.Id = apply.MemberAddressId;
            address.Load();
            string city = address.City;

            order.BranchId        = GetVIPBranchId(city, order.ComId);//按默认地址的branchId走,没有的是0。add by luochunhui
            order.TaxRate         = customer.TaxRate;
            order.Invoice_Name    = customer.Invoice_Name;
            order.Invoice_Type    = customer.InvoiceType;
            order.Invoice_Content = customer.Invoice_Content;
            return(order);
        }
Пример #3
0
        private void InitMemberAddress(int MemberId)
        {
            Member member = new Member();

            member.Id = MemberId;
            member.Load();
            MemberAddress Maddress = new MemberAddress();

            Maddress.MemberId  = MemberId;
            Maddress.RealName  = member.RealName;
            Maddress.Address   = member.Address;
            Maddress.Province  = member.Province;
            Maddress.City      = member.City;
            Maddress.Area      = member.Area;
            Maddress.Street    = member.Street;;
            Maddress.Mansion   = member.Mansion;
            Maddress.Room      = member.Room;
            Maddress.TelPhone  = member.Telphone;
            Maddress.Mobile    = member.Mobile;
            Maddress.Email     = member.Email;
            Maddress.IsDefault = 1;
            Maddress.Save();
        }
Пример #4
0
        public int Save()
        {
            ArrayList arrayList = new ArrayList();

            if (Id > 0)
            {
                arrayList.Add(new SqlParameter("@Id", Id));
            }
            arrayList.Add(new SqlParameter("@LoginName", LoginName));
            arrayList.Add(new SqlParameter("@PassWord", PassWord));
            arrayList.Add(new SqlParameter("@RealName", RealName));
            arrayList.Add(new SqlParameter("@Telphone", Telphone));
            arrayList.Add(new SqlParameter("@Mobile", Mobile));
            arrayList.Add(new SqlParameter("@IsCheckMobile", IsCheckMobile));
            arrayList.Add(new SqlParameter("@Status", Status));
            arrayList.Add(new SqlParameter("@LoginNumber", LoginNumber));
            arrayList.Add(new SqlParameter("@RegisterDate", RegisterDate));
            //arrayList.Add(new SqlParameter("@Point", Point)); //积分通过 pointdetail 的balance 来读取
            arrayList.Add(new SqlParameter("@ComId", ComId));
            arrayList.Add(new SqlParameter("@DeptId", DeptId));
            arrayList.Add(new SqlParameter("@IsMainContact", IsMainContact));
            arrayList.Add(new SqlParameter("@Province", Province));
            arrayList.Add(new SqlParameter("@City", City));
            arrayList.Add(new SqlParameter("@Area", Area));
            arrayList.Add(new SqlParameter("@Street", Street));
            arrayList.Add(new SqlParameter("@Mansion", Mansion));
            arrayList.Add(new SqlParameter("@Room", Room));
            arrayList.Add(new SqlParameter("@Address", GetAddress()));
            arrayList.Add(new SqlParameter("@PostCode", PostCode));
            arrayList.Add(new SqlParameter("@UpdateTime", UpdateTime));
            arrayList.Add(new SqlParameter("@IsThirdLogin", IsThirdLogin));
            arrayList.Add(new SqlParameter("@Email", Email));
            arrayList.Add(new SqlParameter("@IsCheckEmail", IsCheckEmail));
            arrayList.Add(new SqlParameter("@RegisterMethod", RegisterMethod));
            arrayList.Add(new SqlParameter("@IsAdmin", IsAdmin));
            arrayList.Add(new SqlParameter("@BranchId", BranchId));
            arrayList.Add(new SqlParameter("@ConfirmLevel", ConfirmLevel));
            arrayList.Add(new SqlParameter("@ExportDate", ExportDate));
            arrayList.Add(new SqlParameter("@SecrecyId", SecrecyId));
            arrayList.Add(new SqlParameter("@IsOrderAuthority", IsOrderAuthority));
            arrayList.Add(new SqlParameter("@IsVisible", IsVisible));
            arrayList.Add(new SqlParameter("@GoodsVisibleLevel", GoodsVisibleLevel));
            if (this.Id > 0)
            {
                m_dbo.UpdateData("Member", (SqlParameter[])arrayList.ToArray(typeof(SqlParameter)));
            }
            else
            {
                this.Id = m_dbo.InsertData("Member", (SqlParameter[])arrayList.ToArray(typeof(SqlParameter)));
                if (this.Id > 0)
                {
                    MemberAddress Maddress = new MemberAddress();
                    Maddress.MemberId  = Id;
                    Maddress.RealName  = RealName;
                    Maddress.Address   = Address;
                    Maddress.Province  = Province;
                    Maddress.City      = City;
                    Maddress.Area      = Area;
                    Maddress.Street    = Street;;
                    Maddress.Mansion   = Mansion;
                    Maddress.Room      = Room;
                    Maddress.TelPhone  = Telphone;
                    Maddress.Mobile    = Mobile;
                    Maddress.Email     = Email;
                    Maddress.IsDefault = 1;
                    Maddress.Save();
                }
            }
            if (this.Id > 0 && Email != "")
            {
                Memberinfocfg Minfocfg = new Memberinfocfg();
                Minfocfg.MemberId = Id;
                Minfocfg.Load();
                Minfocfg.Type       = CommenClass.MemberEmailTimely.实时发送.ToString();
                Minfocfg.UpdateTime = DateTime.Now;
                Minfocfg.Value      = IsCheckEmail;
                Minfocfg.Save();
            }
            return(this.Id);
        }