private NodeImpactLevel TranslateRepairToNodeImpact(RepairType repairType) { switch (repairType) { case RepairType.SwitchService: case RepairType.SoftReboot: case RepairType.HardReboot: case RepairType.OSUpgrade: case RepairType.ConfigurationProvision: case RepairType.DIPDeploy: case RepairType.ServiceRestart: case RepairType.BIOSUpgrade: // AP considers this non-destructive case RepairType.FirmwareUpgrade: // AP considers this non-destructive case RepairType.SoftRebootRollout: case RepairType.UpstreamRepair: case RepairType.ImpNonDestructive: case RepairType.AppRollout: case RepairType.AzureConfigurationUpdate: case RepairType.AzureApplicationUpdate: case RepairType.NonDestructiveUpdateMachine: return(NodeImpactLevel.Restart); default: return(this.configReader.LimitRepairTaskImpactLevel ? NodeImpactLevel.Restart : NodeImpactLevel.RemoveData); } }
public async Task <IHttpActionResult> PostRepairType(RepairType repairType) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.RepairTypes.Add(repairType); try { await db.SaveChangesAsync(); } catch (DbUpdateException) { if (RepairTypeExists(repairType.RepairTypeId)) { return(Conflict()); } else { throw; } } return(CreatedAtRoute("DefaultApi", new { id = repairType.RepairTypeId }, repairType)); }
public async Task <IHttpActionResult> PutRepairType(Guid id, RepairType repairType) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != repairType.RepairTypeId) { return(BadRequest()); } db.Entry(repairType).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!RepairTypeExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public ActionResult UpdateRepairLineItems(string uniqueId, string serviceOrderNo, string serialNumberList, string serviceOrderRelation, string conditionId, string symptomAreaId, string symptomCodeId, string diagnosisAreaId, string diagnosisCodeId, string resolutionId, string repairStageId, string technicianNo, string description, string serviceComments) { string userName = null; bool isSuccess = false; try { userName = User.Identity.Name.ToString().Split('\\')[1]; RepairType repairType = new RepairType(); isSuccess = repairType.UpdateRepairLineItems(uniqueId, serviceOrderNo, serialNumberList, conditionId, symptomAreaId, symptomCodeId, diagnosisAreaId, diagnosisCodeId, resolutionId, repairStageId, technicianNo, description, serviceComments, userName); if (isSuccess) { TempData["ServiceOrderId"] = serviceOrderNo; Session["SID"] = serviceOrderNo; } ViewData["RepairLinesList"] = GetRepairLinesDetails(TempData["ServiceOrderId"].ToString()); TempData.Keep(); } catch (Exception ex) { TempData.Keep(); if (!isSuccess) { ExceptionLog.LogException(ex, userName); throw ex; } } return(View("RepairLineDetails")); }
private JsonResult _GetDiagnosisCodeval(string DiagonsisAreaId) { string userName = User.Identity.Name.ToString().Split('\\')[1]; RepairType repairTypeObj = new RepairType(); return(Json(new SelectList(repairTypeObj.GetDiagnosisCode(DiagonsisAreaId, userName), "DiagonsisCodeId", "DiagonsisCodeName"), JsonRequestBehavior.AllowGet)); }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; string orderjson = context.Request.Params["orderjson"]; Order order = JsonConvert.DeserializeObject<Order>(orderjson); //前台将姓名传入订单号,此处单独处理姓名,然后自动生成订单号 if (!string.IsNullOrEmpty(order.OrderNo)) { User user = new User(); user.UserID = order.UserID; user = Business.Business.UserBLL.Get(user); user.Name = order.OrderNo; Business.Business.UserBLL.Save(user); } order.OrderNo = "bj" + order.UserID + (new Random()).Next(100, 999); order.OrderTime = System.DateTime.Now; order.Status = 1; //获取价格 RepairType rt = new RepairType(); rt.RepairTypeID = order.RepairTypeID; rt = RepairTypeBLL.Get(rt); order.OrderPrice=rt.Price; //因时间字段不赋值报错,暂时将所有时间字段赋值 order.GetOrderTime = System.DateTime.Now; order.PayTime = System.DateTime.Now; bool b = OrderBLL.Add(order); context.Response.Write(b.ToString().ToLower()); //进入推送消息池 View_OrderList view_orderlist = View_OrderListBLL.GetByOrderNo(order.OrderNo); OrderBLL.PostMessage(view_orderlist); }
/// <summary> /// 结束工作 /// </summary> /// <returns></returns> public ActionResult SubmitState(string orderId, string description, OrderState state) { try { var flag = false; RepairType repairType = RepairType.App; string repairUserId = ""; var userId = CurrentUser.User.UserId; var utype = CurrentUser.User.RoleKey; var userPhone = ""; switch (state) { case OrderState.Worked: flag = os.Worked(orderId, userId, 0, utype, description, ref repairUserId, ref repairType, ref userPhone); //发短信 //SMSManager.Instance.SendNotify(userPhone, orderId); break; case OrderState.Cancel: flag = os.Cancel(orderId, userId, utype, description, ref repairUserId, ref repairType); break; case OrderState.Close: flag = os.Close(orderId, userId, utype, description); break; case OrderState.Unsolved: flag = os.Unsolved(orderId, userId, utype, description); break; case OrderState.Confirm: flag = os.Confirm(orderId, userId, utype, description); break; } if (flag) { //判断报修终端 if (repairType == RepairType.Wx) { //发送公共号消息 new Task(new Action(() => { var resultMsg = os.SendWxTmpMsg(repairUserId, orderId, state); Logger.InfoFormat("微信消息推送{0}===={1}", orderId, resultMsg); })).Start(); } return(ResultSuccess("操作成功.")); } else { return(ResultSuccess("服务器繁忙,请稍后再试试")); } } catch (Exception e) { Logger.Error("操作异常", e); return(ResultSuccess("服务器繁忙,请稍后再试试")); } }
public ActionResult Create([Bind(Include = "Id,Name,Address,RepairTypes")] RepairShop repairShop) { if (ModelState.IsValid) { repairShop.RepairTypes = new List <RepairType>(); string repairTypeId = Request.Form["RepairTypes"].ToString(); RepairTypeBusiness repairTypeBusiness = new RepairTypeBusiness(); RepairType repairType = repairTypeBusiness.Get(int.Parse(repairTypeId)); db.RepairTypes.Find(repairType).RepairShops.Add(repairShop); db.RepairShops.Add(repairShop); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.RepairTypesList = new SelectList( db.RepairTypes .Select(e => new SelectListItem { Value = e.Id.ToString(), Text = e.Name }) .ToList() , "Value", "Text"); return(View(repairShop)); }
public Repair(int id, DateTime startDate, DateTime?endDate, RepairType type, string defect, string solution, List <User> users, int tramId) : base(id, users, startDate, endDate, tramId) { Type = type; Defect = defect; Solution = solution; }
/// <summary> /// Корутина, скрывающая или показывающая элементы в результате проведения работ указанного типа /// </summary> /// <param name="type">Тип ремонтных работ</param> /// <returns></returns> public IEnumerator Repair(RepairType type) { List<Problem> problemsNeedHide = new List<Problem>(); List<Problem> problemsNeedShow = new List<Problem>(); foreach (Problem p in listVisibleSprites) if (p != null) if (p.type == type) problemsNeedHide.Add(p); foreach (Problem p in listUnvisibleSprites) if (p != null) if (p.type == type) problemsNeedShow.Add(p); if (listVisibleSprites.Count != 0 || listVisibleSprites.Count != 0) { float i = 0; while (i < 1.2f) { i += 0.04f; foreach (Problem p in problemsNeedHide) p.alpha -= 0.03f; foreach (Problem p in problemsNeedShow) p.alpha += 0.03f; yield return new WaitForSeconds(0.04f); } } }
public ResModel AddRepairType(RepairTypeDto repairTypeDto, UserDto operationUser) { using (var db = new ModelContext()) { var repairType = new RepairType() { Id = Guid.NewGuid(), Name = repairTypeDto.Name, Description = repairTypeDto.Description }; try { db.RepairType.Add(repairType); db.SaveChanges(); } catch (Exception e) { return(new ResModel() { Msg = "添加维修类型失败", Success = false }); } return(new ResModel() { Msg = "添加维修类型成功", Success = true }); } }
/// <summary> /// получает объект для сохранения с уровня представления и создает по нему объект Apartment и сохраняет его в базу данных. /// </summary> /// <param name="appartmentDto"></param> public void MakeAdvert(ApartmentDTO appartmentDto) { Salesman salesman = Database.Salesmans.Get(appartmentDto.SalesmanId); // валидация if (salesman == null) { throw new ValidationException("Арендодатель не найден", ""); } // смотрим состояние проплаченных сервисов арендодателя bool salesmanPayedState = new SalesmanState(30.0).GetSalesmanPayedState(salesman.PayedDate); // применяем автомаппер для проекции HouseDTO на House Mapper.Initialize(cfg => cfg.CreateMap <HouseDTO, House>()); House house = Mapper.Map <HouseDTO, House>(appartmentDto.House); Mapper.Initialize(cfg => cfg.CreateMap <ToiletTypeDTO, ToiletType>()); ToiletType toiletType = Mapper.Map <ToiletTypeDTO, ToiletType>(appartmentDto.ToiletType); Mapper.Initialize(cfg => cfg.CreateMap <BalconyDTO, Balcony>()); Balcony balcony = Mapper.Map <BalconyDTO, Balcony>(appartmentDto.Balcony); Mapper.Initialize(cfg => cfg.CreateMap <RepairTypeDTO, RepairType>()); RepairType repairType = Mapper.Map <RepairTypeDTO, RepairType>(appartmentDto.RepairType); Mapper.Initialize(cfg => cfg.CreateMap <ElevatorDTO, Elevator>()); Elevator elevator = Mapper.Map <ElevatorDTO, Elevator>(appartmentDto.Elevator); // применяем автомаппер для проекции одной коллекции на другую Mapper.Initialize(cfg => cfg.CreateMap <ApartmentIncludeDTO, ApartmentInclude>()); var includes = Mapper.Map <IEnumerable <ApartmentIncludeDTO>, List <ApartmentInclude> >(appartmentDto.ApartmentIncludes); Mapper.Initialize(cfg => cfg.CreateMap <ImagesIncludeDTO, ImagesInclude>()); var images = Mapper.Map <IEnumerable <ImagesIncludeDTO>, List <ImagesInclude> >(appartmentDto.ImagesIncludes); Apartment apartment = new Apartment { PublishDate = DateTime.Now, Salesman = salesman, SalesmanPayedState = salesmanPayedState, Price = appartmentDto.Price, PriceInfo = appartmentDto.PriceInfo, Floor = appartmentDto.Floor, TotalArea = appartmentDto.TotalArea, LivingArea = appartmentDto.LivingArea, KitchenArea = appartmentDto.KitchenArea, OtherInfo = appartmentDto.OtherInfo, House = house, ToiletType = toiletType, Balcony = balcony, RepairType = repairType, Elevator = elevator, ApartmentIncludes = includes, ImagesIncludes = images }; Database.Apartments.Create(apartment); Database.Save(); }
public async Task <IEnumerable <RepairType> > AddRepairTypeAsync(AddRepairTypeRequest request, CancellationToken cancellationToken) { var validator = new ListStringsValidator(); await validator.ValidateAndThrowAsync(request.RepairTypeNames, null, cancellationToken); foreach (var repairTypeName in request.RepairTypeNames) { if (await _repairTypeRepository.AnyAsync(x => x.Name == repairTypeName, cancellationToken)) { throw new ServiceException(ErrorCodes.RepairTypeAlreadyExists, $"Repair type with given name already exist"); } } var repairTypesToAdd = new List <RepairType>(); foreach (var repairTypeName in request.RepairTypeNames) { var repairType = new RepairType() { Name = repairTypeName }; repairTypesToAdd.Add(repairType); } var result = await _repairTypeRepository.AddRangeAsync(repairTypesToAdd, cancellationToken); return(result); }
public async Task <IActionResult> EditRepairType(RepairType repairType) { repairType.Identity = await _userRepository.GetIdentityUser(User); await _repairRepository.UpdateRepairType(repairType); return(Redirect(Request.Headers["Referer"].ToString())); }
public ActionResult DeleteConfirmed(int id) { RepairType repairType = db.RepairTypes.Find(id); db.RepairTypes.Remove(repairType); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult AddRepairType(FormCollection colection, RepairType RepairType) { String Notes = colection["Notes"]; String TypeName = colection["TypeName"]; Ql.AddRepairType(TypeName, Notes); return(RedirectToAction("RepairType", "RepairType")); }
public void Add(RepairType repairType) { using (repairContext = new RepairContext()) { repairContext.RepairTypes.Add(repairType); repairContext.SaveChanges(); } }
/// <summary> /// Constructors an activity for the provided activity type and name. /// </summary> /// <param name="activityType">The activity type for the activity.</param> /// <param name="name">The name for the activity.</param> public Repair(RepairType repairType, string name = null) { Id = (int)repairType; // If we don't have a name argument, // then use the string representation of the activity type for the name. Name = name ?? repairType.ToString(); }
public void Update(RepairType repairType) { using (repairContext = new RepairContext()) { var item = repairContext.RepairTypes.Find(repairType.Id); repairContext.Entry(item).CurrentValues.SetValues(repairType); repairContext.SaveChanges(); } }
public ActionResult Edit([Bind(Include = "Id,Name")] RepairType repairType) { if (ModelState.IsValid) { db.Entry(repairType).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(repairType)); }
/// <summary> /// 获取列表(根据查询条件获取全部列表) /// </summary> /// <param name="repairType">传入的实体,可以是一个空实体</param> /// <param name="Where">SQL拼接的查询条件字条串,例如: " ID < 100 " </param> /// <returns>返回实体列表</returns> public static List<RepairType> GetList(RepairType repairType, string Where) { List<RepairType> returnList = new List<RepairType>(); List<object> tempList = DBClient.GetList(repairType,new RepairTypeMapping(), Constant.CONNSTRING, Where); foreach (object tempobject in tempList) { returnList.Add((RepairType)tempobject); } return returnList; }
public ActionResult Create([Bind(Include = "Id,Name")] RepairType repairType) { if (ModelState.IsValid) { db.RepairTypes.Add(repairType); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(repairType)); }
public async Task <IHttpActionResult> GetRepairType(Guid id) { RepairType repairType = await db.RepairTypes.FindAsync(id); if (repairType == null) { return(NotFound()); } return(Ok(repairType)); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { RepairType tipos = new RepairType(); tipoDropDownList.DataSource = tipos.ListaTodos(); tipoDropDownList.DataBind(); fillData(); } }
public void Repair(RepairType repairType) { Particles.Play(); switch (repairType) { case RepairType.Hold: case RepairType.Smash: // Same for now. _pieceContainer.Repair(10); OnRepair?.Invoke(); break; } }
// GET: RepairTypes/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } RepairType repairType = db.RepairTypes.Find(id); if (repairType == null) { return(HttpNotFound()); } return(View(repairType)); }
public async Task <IHttpActionResult> DeleteRepairType(Guid id) { RepairType repairType = await db.RepairTypes.FindAsync(id); if (repairType == null) { return(NotFound()); } db.RepairTypes.Remove(repairType); await db.SaveChangesAsync(); return(Ok(repairType)); }
public static void CreateDefaultDb() { var user = new User("vovan", "123", "Volodymyr Yablonskyi"); SaveModel(user); var client = new Client("sashokDu", "123", "Sasha Dushkin"); SaveModel(client); user = new User("shulga", "123", "Shulgan Galyna"); SaveModel(user); client = new Client("dagorat", "123", "Dagor Dagorat"); SaveModel(client); var clients = GetModels <Client>(); var machineType = new MachineType("bread cutter", "Breadis Inc.", "USA"); SaveModel(machineType); machineType = new MachineType("meat cutter", "Meatis Inc.", "USA"); SaveModel(machineType); machineType = new MachineType("Griller 2000", "Grillis Inc.", "China"); SaveModel(machineType); var machineTypes = GetModels <MachineType>(); var repairType = new RepairType("Cleaning", new decimal(20.00), 6); SaveModel(repairType); repairType = new RepairType("Engine fix", new decimal(200.00), 24); SaveModel(repairType); repairType = new RepairType("Cooler fix", new decimal(200.00), 48); SaveModel(repairType); var repairTypes = GetModels <RepairType>(); var machine = new Machine("11200394", 2006, machineTypes[0], clients[0]); SaveModel(machine); machine = new Machine("11200694", 2004, machineTypes[1], clients[0]); SaveModel(machine); machine = new Machine("16700694", 2014, machineTypes[2], clients[1]); SaveModel(machine); var machines = GetModels <Machine>(); var order = new Order(repairTypes[0], machines[0], clients[0]); SaveModel(order); order = new Order(repairTypes[1], machines[1], clients[0]); SaveModel(order); order = new Order(repairTypes[2], machines[2], clients[1]); SaveModel(order); }
/// <summary> /// 开始工作 /// </summary> /// <param name="orderId"></param> /// <param name="userId"></param> /// <returns></returns> public ActionResult Working(string orderId) { try { var userId = ApiUser.Current.UserId; string repairUserId = ""; RepairType repairType = RepairType.App; var flag = os.Working(orderId, userId, ref repairUserId, ref repairType); //更新坐标轨迹 new UserService().PositionAction(orderId, userId, PositionAction.Work); if (flag) { //判断报修终端 if (repairType == RepairType.Wx) { //发送公共号消息 new Task(new Action(() => { var resultMsg = os.SendWxTmpMsg(repairUserId, orderId, OrderState.Working); Logger.InfoFormat("微信消息推送{0}===={1}", orderId, resultMsg); })).Start(); } return(Json(new { success = "工作开始" } , JsonRequestBehavior.AllowGet)); } else { return(Json(new { error = "服务器繁忙,请稍后再试试" } , JsonRequestBehavior.AllowGet)); } } catch (Exception e) { Logger.Error("开始工作异常", e); return(Json(new { error = "服务器繁忙,请稍后再试试" } , JsonRequestBehavior.AllowGet)); } }
public void Add(object sender, EventArgs e) { try { RepairType repair = new RepairType(); if (string.IsNullOrWhiteSpace(textBox1.Text) || string.IsNullOrWhiteSpace(textBox2.Text) || string.IsNullOrWhiteSpace(textBox3.Text)) { MessageBox.Show("Не все поля были заполнены"); return; } repair.Name = textBox1.Text; repair.LeadTime = Convert.ToInt32(textBox2.Text); repair.Price = Convert.ToDecimal(textBox3.Text); using (MyContext context = new MyContext()) { if (context.RepairTypes.Any(rep => rep.Name == repair.Name)) { MessageBox.Show("Уже существует"); } else { context.RepairTypes.Add(repair); context.SaveChanges(); MessageBox.Show("Ремонт добавлен"); } } Update(); } catch { return; } }
// Set the state of the object to broken public void Break() { _broken = true; fixedObject.SetActive(false); brokenObject.SetActive(true); List <RepairType> currentAvailableItems = PickupableFactory.Instance.CurrentAvailableItemRepairTypes(); int index = Random.Range(0, currentAvailableItems.Count); if (currentAvailableItems.Count > 0) { repairType = currentAvailableItems[index]; } else { // Temp handle no items existing repairType = RepairType.Tape; } AudioSource audio = GetComponentInChildren <AudioSource>(); if (audio) { audio.Play(); } }
public ActionResult DeleteRepairLine(string uniqueID) { string userName = null; bool isSuccess = false; try { userName = User.Identity.Name.ToString().Split('\\')[1]; RepairType repairType = new RepairType(); isSuccess = repairType.DeleteRepairLineItems(uniqueID, userName); TempData["ServiceOrderId"] = Session["SID"].ToString(); ViewData["RepairLinesList"] = GetRepairLinesDetails(TempData["ServiceOrderId"].ToString()); TempData.Keep(); } catch (Exception ex) { TempData.Keep(); ExceptionLog.LogException(ex, userName); } return(View(new GridModel <RepairType> { Data = ViewData["RepairLinesList"] as List <RepairType> })); }
/// <summary> /// 开始工作 /// </summary> /// <param name="orderId">订单ID</param> /// <returns></returns> public ActionResult Working(string orderId) { try { var userId = CurrentUser.User.UserId; RepairType repairType = RepairType.App; string repairUserId = ""; var flag = os.Working(orderId, userId, ref repairUserId, ref repairType); if (flag) { //判断报修终端 if (repairType == RepairType.Wx) { //发送公共号消息 new Task(new Action(() => { var resultMsg = os.SendWxTmpMsg(repairUserId, orderId, OrderState.Working); Logger.InfoFormat("微信消息推送{0}===={1}", orderId, resultMsg); })).Start(); } return(ResultSuccess("操作成功.")); } else { return(ResultSuccess("操作失败.")); } } catch (Exception e) { Logger.Error("派单异常", e); return(ResultSuccess("服务器繁忙,请稍后再试试.")); } }
/// <summary> /// Инициализация /// </summary> private void Init() { if (_isInit) return; if (listVisibleSprites == null) listVisibleSprites = new List<Problem>(); if (listUnvisibleSprites == null) listUnvisibleSprites = new List<Problem>(); if (listTypes.Count > 0) currentRepairType = listTypes[0]; _isInit = true; }
public void SetNextType() { int index = listTypes.IndexOf(currentRepairType); if (index == listTypes.Count - 1) _isEnd = true; if (index >= 0 && index < listTypes.Count - 1) { currentRepairType = listTypes[index + 1]; } }
public void Reset() { Init(); _isEnd = false; foreach (Problem problem in listVisibleSprites) if (problem != null) problem.alpha = 1f; foreach (Problem problem in listUnvisibleSprites) if (problem != null) problem.alpha = 0f; if (listTypes != null && listTypes.Count > 0) currentRepairType = listTypes[0]; }
public TownFolkRepair(uint dealerUID) : base(Build(dealerUID)) { this.dealerUID = dealerUID; this.itemUID = 0; this.repairType = RepairType.RepairAll; }
// Methods public TownFolkRepair(byte[] data) : base(data) { this.dealerUID = BitConverter.ToUInt32(data, 1); this.itemUID = BitConverter.ToUInt32(data, 5); this.repairType = (RepairType) BitConverter.ToUInt32(data, 9); }
/// <summary> /// 修改实体 /// </summary> /// <param name="repairType">传入的实体</param> /// <returns>操作数据库时返回的操作行数,如果大于 "0" 则返回 true 否则返回 false</returns> public static bool Save(RepairType repairType) { return RepairTypeDAL.Save(repairType); }
/// <summary> /// 获取列表(无条件分页获取全部列表) /// </summary> /// <param name="repairType">传入的实体,可以是一个空实体</param> /// <param name="PageSize">每页的记录数,例如:每页显示10条,则传入 10 </param> /// <param name="CurrentCount">当前是第几页</param> /// <param name="Where">SQL拼接的查询条件字条串,例如: " ID < 100 " </param> /// <param name="TotalCount">输出参数,返回总记录数</param> /// <returns>返回实体列表</returns> public static List<RepairType> GetList(RepairType repairType, int PageSize, int CurrentCount, string Where, out int TotalCount) { return RepairTypeDAL.GetList(repairType, PageSize, CurrentCount, Where, out TotalCount); }
/// <summary> /// 根据编号获取实体 /// </summary> /// <param name="repairType">传入的实体,必须含有编号,根据编号获取</param> /// <returns>返回得到的实体</returns> public static RepairType Get(RepairType repairType) { return RepairTypeDAL.Get(repairType); }
/// <summary> /// 根据编号获取实体 /// </summary> /// <param name="repairType">传入的实体,必须含有编号,根据编号获取</param> /// <returns>返回得到的实体</returns> public static RepairType Get(RepairType repairType) { return (RepairType)DBClient.Get(repairType, new RepairTypeMapping(), Constant.CONNSTRING); }
/// <summary> /// 获取列表(无条件获取全部列表) /// </summary> /// <param name="repairType">传入的实体,可以是一个空实体</param> /// <returns>返回实体列表</returns> public static List<RepairType> GetList(RepairType repairType) { return RepairTypeDAL.GetList(repairType); }
/// <summary> /// 获取列表(无条件分页获取全部列表) /// </summary> /// <param name="repairType">传入的实体,可以是一个空实体</param> /// <param name="PageSize">每页的记录数,例如:每页显示10条,则传入 10 </param> /// <param name="CurrentCount">当前是第几页</param> /// <param name="TotalCount">输出参数,返回总记录数</param> /// <returns>返回实体列表</returns> public static List<RepairType> GetList(RepairType repairType, int PageSize, int CurrentCount, out int TotalCount) { List<RepairType> returnList = new List<RepairType>(); List<object> tempList = DBClient.GetList(repairType,new RepairTypeMapping(), Constant.CONNSTRING, PageSize, CurrentCount, out TotalCount); foreach (object tempobject in tempList) { returnList.Add((RepairType)tempobject); } return returnList; }
/// <summary> /// 移除实体(根据实体编号移除一条记录) /// </summary> /// <param name="repairType">传入的实体,必须含有编号</param> /// <returns>操作数据库时返回的操作行数,如果大于 "0" 则返回 true 否则返回 false</returns> public static bool Remove(RepairType repairType) { return RepairTypeDAL.Remove(repairType); }
/// <summary> /// 添加实体 /// </summary> /// <param name="repairType">传入的实体</param> /// <returns>操作数据库时返回的操作行数,如果大于 "0" 则返回 true 否则返回 false</returns> public static bool Add(RepairType repairType) { return RepairTypeDAL.Add(repairType); }
/// <summary> /// 添加实体 /// </summary> /// <param name="repairType">传入的实体</param> /// <returns>操作数据库时返回的操作行数,如果大于 "0" 则返回 true 否则返回 false</returns> public static bool Add(RepairType repairType) { return DBClient.Add(repairType, new RepairTypeMapping(), Constant.CONNSTRING); }
/// <summary> /// 获取列表(根据查询条件获取全部列表) /// </summary> /// <param name="repairType">传入的实体,可以是一个空实体</param> /// <param name="Where">SQL拼接的查询条件字条串,例如: " ID < 100 " </param> /// <returns>返回实体列表</returns> public static List<RepairType> GetList(RepairType repairType, string Where) { return RepairTypeDAL.GetList(repairType, Where); }