Beispiel #1
0
        /// <summary>
        /// 注册用户
        /// <param name="User">用户注册资料</param>
        /// <param name="UserEX">用户附加详细资料</param>
        /// </summary>
        /// <returns></returns>
        public bool UserReg(User_ViewModel User, aspnet_UsersEX UserEX)
        {
            String guid = Guid.NewGuid().ToString();

            User = User ?? new User_ViewModel()
            {
                UserName     = guid,
                UserPassword = guid,
                Email        = "",
                Answer       = "no",
                Question     = "no"
            };
            MembershipCreateStatus state     = new MembershipCreateStatus();
            MembershipUser         Temp_User = Membership.CreateUser(User.UserName, User.UserPassword, User.Email, User.Question, User.Answer, false, out state);

            if (state == MembershipCreateStatus.Success)
            {
                UserEX.User_ID = (Guid)Temp_User.ProviderUserKey;
            }
            else
            {
                return(false);
            }

            if (!DB_UserEX.Insert(UserEX))
            {
                Membership.DeleteUser(Temp_User.UserName);
            }
            else
            {
                Roles.AddUserToRole(User.UserName, "普通会员");
            }
            return(true);
        }
Beispiel #2
0
        /// <summary>
        /// 删除所有的过期订单
        /// </summary>
        /// <returns></returns>
        public int Delete_OverTime(int ShopID)
        {
            TimeSpan TS_Now = new TimeSpan(DateTime.Now.Ticks);

            List <Car_Order>    List_CarOrder = DB_CarOrder.Select(P => new TimeSpan(P.Order_Time.Ticks).Subtract(TS_Now).Duration().Days >= 2 && P.Order_Shop == ShopID).ToList();
            List <Car_Checkout> List_Check    = new List <Car_Checkout>();

            foreach (Car_Order temp in List_CarOrder)
            {
                List_Check.Add(DB_Checkout.Select(P => P.Checkout_Order == temp.Order_ID).SingleOrDefault());
            }


            if (DB_Checkout.Delete_ALL(List_Check))
            {
                foreach (Car_Order temp in List_CarOrder)
                {
                    DB_CarOrder.Delete(temp);
                }
                return(List_Check.Count());
            }
            else
            {
                foreach (Car_Checkout Temp in List_Check)
                {
                    DB_Checkout.Insert(Temp);
                }
                return(0);
            }
        }
Beispiel #3
0
 /// <summary>
 /// 添加员工到一个店铺
 /// </summary>
 /// <param name="UserID">用户ID</param>
 /// <param name="ShopID">店铺ID</param>
 /// <returns></returns>
 public bool UserPutInShop(Guid UserID, int ShopID)
 {
     return(DB_UserInShop.Insert(new UserInShop()
     {
         UserID = UserID, ShopID = ShopID
     }));
 }
Beispiel #4
0
 /// <summary>
 /// 新增店铺信息
 /// </summary>
 /// <param name="Shop">要增加的店铺实体</param>
 /// <returns></returns>
 public bool AddShop(Car_Shop Shop)
 {
     if (DB_Shop.Select(P => P.Shop_Name == Shop.Shop_Name && P.Shop_City == Shop.Shop_City).Count() == 0)
     {
         return(DB_Shop.Insert(Shop));
     }
     else
     {
         return(false);
     }
 }
Beispiel #5
0
 /// <summary>
 /// 新增城市信息
 /// </summary>
 /// <param name="City">要增加的城市实体</param>
 /// <returns></returns>
 public bool AddCity(Car_City City)
 {
     if (DB_City.Select(P => P.City_Name == City.City_Name && P.City_Province == City.City_Province).Count() == 0)
     {
         return(DB_City.Insert(City));
     }
     else
     {
         return(false);
     }
 }
        /// <summary>
        /// 领工资
        /// </summary>
        /// <param name="SalaryLogID">工资单号</param>
        /// <returns></returns>
        public bool GetSalary(int SalaryLogID, Guid UID, String RealName, decimal Price)
        {
            User_SalaryLog OldLog = DB_SalaryLog.Select(P => P.SalaryLog_ID == SalaryLogID).SingleOrDefault();
            User_SalaryLog NewLog = OldLog;

            NewLog.SalaryLog_Mark = true;
            UserManager s      = new UserManager();
            int         ShopID = s.SelectShopID_UserID(OldLog.SalaryLog_User);

            using (TransactionScope TS = new TransactionScope())
            {
                try
                {
                    DB_Account.dt = DB_SalaryLog.dt;
                    DB_Account.Insert_NoSub(new Car_Account()
                    {
                        Account_Info  = String.Format("这笔款项属于工资发放,店铺编号:{0},工资领取人:{1},工资领取时间:{2}", ShopID, RealName, DateTime.Now),
                        Account_Price = Price,
                        Account_Shop  = ShopID,
                        Account_Time  = DateTime.Now,
                        Account_User  = UID
                    });
                    DB_SalaryLog.Update_NoSub(OldLog, NewLog);
                    DB_SalaryLog.dt.SubmitChanges();
                    TS.Complete();
                    return(true);
                }
                catch (Exception EX)
                {
                    DB_Error.Insert(new Error()
                    {
                        Error_Messege = EX.Message, Error_Time = DateTime.Now
                    });
                    return(false);
                }
            }
        }
Beispiel #7
0
 /// <summary>
 /// 新增工资领取状况信息
 /// </summary>
 /// <param name="SalaryLog">要增加的工资领取状况实体</param>
 /// <returns></returns>
 public bool AddSalaryLog(User_SalaryLog SalaryLog)
 {
     return(DB_SalaryLog.Insert(SalaryLog));
 }
Beispiel #8
0
 /// <summary>
 /// 新增员工工资情况信息
 /// </summary>
 /// <param name="Salary">要增加的员工工资情况实体</param>
 /// <returns></returns>
 public bool AddSalary(User_Salary Salary)
 {
     return(DB_Salary.Insert(Salary));
 }
Beispiel #9
0
 /// <summary>
 /// 新增员工奖惩方案信息
 /// </summary>
 /// <param name="RAP">要增加的员工奖惩方案实体</param>
 /// <returns></returns>
 public bool AddRAP(User_RAP RAP)
 {
     return(DB_RAP.Insert(RAP));
 }
Beispiel #10
0
 /// <summary>
 /// 新增订单信息
 /// </summary>
 /// <param name="Order">要增加的订单实体</param>
 /// <returns></returns>
 public bool AddOrder(Car_Order Order)
 {
     return(DB_Order.Insert(Order));
 }
Beispiel #11
0
 /// <summary>
 /// 新增活动信息
 /// </summary>
 /// <param name="Action">要增加的活动实体</param>
 /// <returns></returns>
 public bool AddAction(Car_Action Action)
 {
     DB_Action.Insert(Action);
     return(DB_Action.SubmitChanges());
 }
Beispiel #12
0
 /// <summary>
 /// 新增车型信息
 /// </summary>
 /// <param name="Type">要增加的车型实体</param>
 /// <returns></returns>
 public bool AddType(Car_Type Type)
 {
     return(DB_Type.Insert(Type));
 }
Beispiel #13
0
 /// <summary>
 /// 新增资金变动信息
 /// </summary>
 /// <param name="Account">要增加的资金变动实体</param>
 /// <returns></returns>
 public bool AddAccount(Car_Account Account)
 {
     return(DB_Account.Insert(Account));
 }
Beispiel #14
0
 /// <summary>
 /// 新增员工制度奖惩情况信息
 /// </summary>
 /// <param name="WorkRAP">要增加的员工制度奖惩情况实体</param>
 /// <returns></returns>
 public bool AddWorkRAP(User_WorkRAP WorkRAP)
 {
     return(DB_WorkRAP.Insert(WorkRAP));
 }
Beispiel #15
0
 /// <summary>
 /// 新增收款单信息
 /// </summary>
 /// <param name="Checkout">要增加的收款单实体</param>
 /// <returns></returns>
 public bool AddCheckout(Car_Checkout Checkout)
 {
     return(DB_Checkout.Insert(Checkout));
 }
Beispiel #16
0
 /// <summary>
 /// 新增省份信息
 /// </summary>
 /// <param name="province">要增加的省份实体</param>
 /// <returns></returns>
 public bool AddProvince(Car_Province province)
 {
     return(DB_Province.Insert(province));
 }
Beispiel #17
0
 /// <summary>
 /// 新增活动信息
 /// </summary>
 /// <param name="Action">要增加的活动实体</param>
 /// <returns></returns>
 public bool AddAction(Car_Action Action)
 {
     return(DB_Action.Insert(Action));
 }
Beispiel #18
0
 /// <summary>
 /// 新增员工额外奖惩情况信息
 /// </summary>
 /// <param name="SalaryAppend">要增加的员工额外奖惩情况实体</param>
 /// <returns></returns>
 public bool AddSalaryAppend(User_SalaryAppend SalaryAppend)
 {
     return(DB_SalaryAppend.Insert(SalaryAppend));
 }
Beispiel #19
0
 /// <summary>
 /// 新增资金变动信息
 /// </summary>
 /// <param name="CarGet">要增加的资金变动实体</param>
 /// <returns></returns>
 public bool AddCarGet(Car_Get CarGet)
 {
     return(DB_CarGet.Insert(CarGet));
 }
Beispiel #20
0
 /// <summary>
 /// 新增车名信息
 /// </summary>
 /// <param name="Version">要增加的车名实体</param>
 /// <returns></returns>
 public bool AddVersion(Car_Version Version)
 {
     return(DB_Version.Insert(Version));
 }
Beispiel #21
0
 /// <summary>
 /// 新增品牌信息
 /// </summary>
 /// <param name="Brand">要增加的品牌实体</param>
 /// <returns></returns>
 public bool AddBrand(Car_Brand Brand)
 {
     return(DB_Brand.Insert(Brand));
 }