/// <summary> /// 查询店内指定车辆在指定时间的存货 /// </summary> /// <param name="ShopID">店铺ID</param> /// <param name="VersionID">车的型号</param> /// <param name="StartYear">开始的年份(默认当前年份</param> /// <param name="StartMonth">开始的月份(默认当前月份</param> /// <param name="StartDay">开始的日(默认当前日</param> /// <param name="EndYear">结束的年份(默认当前年份</param> /// <param name="EndMonth">结束的月份(默认当前月份</param> /// <param name="EndDay">结束日(默认当前日</param> /// <returns></returns> public int SelectCarCount_ShopIDAndTime(int ShopID, int VersionID, int?StartYear, int?StartMonth, int?StartDay, int?EndYear, int?EndMonth, int?EndDay) { OrderSummery OrderSummery_Manager = new OrderSummery(); int OrderCount = OrderSummery_Manager.SelectRentaledCarCount_TimeAndVersion(ShopID, VersionID, StartYear, StartMonth, StartDay, EndYear, EndMonth, EndDay); int TatalCount = DB_ViewModel.Select(P => P.Shop_ID == ShopID && P.Version_ID == VersionID).First().Version_Count; return(TatalCount - OrderCount); }
/// <summary> /// 将员工开除出店铺 /// </summary> /// <param name="UserID">用户ID</param> /// <returns></returns> public bool UserDropShop_UserID(Guid UserID) { UserInShop new_UIS; try { new_UIS = DB_UserInShop.Select(P => P.UserID == UserID).Single(); } catch (Exception) { return(true); } return(DB_UserInShop.Delete(new_UIS)); }
/// <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); } }
/// <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); } }
public bool DropUser(String UserName) { aspnet_UsersEX userEX = DB_UserEX.Select(P => P.User_ID == (Guid)Membership.GetUser(UserName).ProviderUserKey).Single(); if (DB_UserEX.Delete(userEX)) { Membership.DeleteUser(UserName); return(true); } else { DB_UserEX.Insert(userEX); return(false); } }
/// <summary> /// 查找店铺及其下的所有成员 /// </summary> /// <param name="ProvinceID">省份ID</param> /// <param name="CityID">城市ID</param> /// <param name="ShopID">店铺ID</param> /// <returns></returns> public List <Shop_ViewModel> GetAllShops(int?ProvinceID, int?CityID, int?ShopID) { ProvinceID = ProvinceID ?? 0; CityID = CityID ?? 0; ShopID = ShopID ?? 0; List <Shop_ViewModel> List_ShopModel = new List <Shop_ViewModel>(); //搜索规则由窄到宽 if (ShopID != 0) { List_ShopModel = DB_ShopUser.Select(P => P.Shop_ID == ShopID).ToList(); if (CityID != 0) { List_ShopModel = List_ShopModel.Where(P => P.City_ID == CityID).ToList(); if (ProvinceID != 0) { List_ShopModel = List_ShopModel.Where(P => P.Province_ID == ProvinceID).ToList(); } } } else { List_ShopModel = DB_ShopUser.getTable().ToList(); } return(List_ShopModel); }
/// <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); } }
/// <summary> /// 更改活动信息 /// </summary> /// <param name="New_Action">新的活动实体</param> /// <returns></returns> public bool UpdateAction(Car_Action NewAction) { Car_Action OldAction = DB_Action.Select(P => P.Action_ID == NewAction.Action_ID).Single(); DB_Action.Update(OldAction, NewAction); return(DB_Action.SubmitChanges()); }
/// <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); } } }
/// <summary> /// 删除员工工资情况信息 /// </summary> /// <param name="Salary">要删除的员工工资情况实体</param> /// <returns></returns> public bool DeleteSalary(int SalaryID) { User_Salary Sala = DB_Salary.Select(P => P.Salary_ID == SalaryID).Single(); return(DB_Salary.Delete(Sala)); }
/// <summary> /// 删除订单信息 /// </summary> /// <param name="Order">要删除的订单实体</param> /// <returns></returns> public bool DeleteOrder(int OrderID) { Car_Order Ord = DB_Order.Select(P => P.Order_ID == OrderID).Single(); return(DB_Order.Delete(Ord)); }
/// <summary> /// 删除员工奖惩方案信息 /// </summary> /// <param name="RAP">要删除的员工奖惩方案实体</param> /// <returns></returns> public bool DeleteRAP(int RAPID) { User_RAP rap = DB_RAP.Select(P => P.RAP_ID == RAPID).Single(); return(DB_RAP.Delete(rap)); }
/// <summary> /// 查询追加工资项(员工ID /// </summary> /// <param name="UID">员工ID</param> /// <returns></returns> public List <SalaryAppend_ViewModel> SelectSalaryAppend_UID(Guid UID) { return(DB_SalaryAppend.Select(P => P.SalaryAppend_User == UID).ToList()); }
public List <RAP_ViewModel> SelectRAP_UID(Guid UID) { return(DB_RAP.Select(P => P.WorkRAP_User == UID).ToList()); }
/// <summary> /// 删除员工制度奖惩情况信息 /// </summary> /// <param name="WorkRAP">要删除的员工制度奖惩情况实体</param> /// <returns></returns> public bool DeleteWorkRAP(int WorkRAPID) { User_WorkRAP WRAP = DB_WorkRAP.Select(P => P.WorkRAP_ID == WorkRAPID).Single(); return(DB_WorkRAP.Delete(WRAP)); }
/// <summary> /// 查询用户订车的所有订单 /// </summary> /// <param name="ClientName">客户用户名</param> /// <returns></returns> public List <Order_ViewModel> SelectOrderSummery_ClientName(String ClientName) { return(DB_ViewModel.Select(P => P.Client_UserName == ClientName).ToList()); }
/// <summary> /// 删除员工额外奖惩情况信息 /// </summary> /// <param name="SalaryAppend">要删除的员工额外奖惩情况实体</param> /// <returns></returns> public bool DeleteSalaryAppend(int SalaryAppendID) { User_SalaryAppend SA = DB_SalaryAppend.Select(P => P.SalaryAppend_ID == SalaryAppendID).Single(); return(DB_SalaryAppend.Delete(SA)); }
/// <summary> /// 删除省份信息 /// </summary> /// <param name="Province">要删除的省份实体</param> /// <returns></returns> public bool DeleteProvince(int ProvinceID) { Car_Province Provin = DB_Province.Select(P => P.Province_ID == ProvinceID).Single(); return(DB_Province.Delete(Provin)); }
/// <summary> /// 删除工资领取状况信息 /// </summary> /// <param name="SalaryLog">要删除的工资领取状况实体</param> /// <returns></returns> public bool DeleteSalaryLog(int SalaryLogID) { User_SalaryLog SL = DB_SalaryLog.Select(P => P.SalaryLog_ID == SalaryLogID).Single(); return(DB_SalaryLog.Delete(SL)); }
/// <summary> /// 删除收款单信息 /// </summary> /// <param name="Checkout">要删除的收款单实体</param> /// <returns></returns> public bool DeleteCheckout(int CheckoutID) { Car_Checkout Che = DB_Checkout.Select(P => P.Checkout_ID == CheckoutID).Single(); return(DB_Checkout.Delete(Che)); }
/// <summary> /// 删除资金变动信息 /// </summary> /// <param name="Account">要删除的资金变动实体</param> /// <returns></returns> public bool DeleteAccount(int AccountID) { Car_Account Acc = DB_Account.Select(P => P.Account_ID == AccountID).Single(); return(DB_Account.Delete(Acc)); }
/// <summary> /// 删除车型信息 /// </summary> /// <param name="Type">要删除的车型实体</param> /// <returns></returns> public bool DeleteType(int TypeID) { Car_Type typ = DB_Type.Select(P => P.Type_ID == TypeID).Single(); return(DB_Type.Delete(typ)); }
/// <summary> /// 删除活动信息 /// </summary> /// <param name="Action">要删除的活动实体</param> /// <returns></returns> public bool DeleteAction(int ActionID) { Car_Action Act = DB_Action.Select(P => P.Action_ID == ActionID).Single(); return(DB_Action.Delete(Act)); }
/// <summary> /// 查询用户详细信息 /// </summary> /// <param name="UserID">用户ID</param> /// <returns></returns> public aspnet_UsersEX SelectUserEXInfo(Guid UserID) { return(DB_UserEX.Select(P => P.User_ID == UserID).Single()); }
/// <summary> /// 删除资金变动信息 /// </summary> /// <param name="CarGet">要删除的资金变动实体</param> /// <returns></returns> public bool DeleteCarGet(int CarGetID) { Car_Get CarGet = DB_CarGet.Select(P => P.GetCar_ID == CarGetID).Single(); return(DB_CarGet.Delete(CarGet)); }
/// <summary> /// 删除车名信息 /// </summary> /// <param name="Version">要删除的车名实体</param> /// <returns></returns> public bool DeleteVersion(int VersionID) { Car_Version Ver = DB_Version.Select(P => P.Version_ID == VersionID).Single(); return(DB_Version.Delete(Ver)); }
/// <summary> /// 删除品牌信息 /// </summary> /// <param name="Brand">要删除的品牌实体</param> /// <returns></returns> public bool DeleteBrand(int BrandID) { Car_Brand Bra = DB_Brand.Select(P => P.Brand_ID == BrandID).Single(); return(DB_Brand.Delete(Bra)); }