private void IsExistsCode(ISession session, ReqOrder req) { ICriteria criteria = session.CreateCriteria(typeof(ReqOrder)); ICriterion criterion = null; if (req.Id != Guid.Empty) { criterion = Restrictions.Not(Restrictions.IdEq(req.Id)); criteria.Add(criterion); } criterion = Restrictions.Eq("ReqOrderCode", req.ReqOrderCode); criteria.Add(criterion); //统计 criteria.SetProjection( Projections.ProjectionList() .Add(Projections.Count("Id")) ); int count = (int)criteria.UniqueResult(); if (count > 0) { throw new EasyJob.Tools.Exceptions.ReqOrderIsExistsException();//调拨主单号已经存在 } }
public ActionResult Update(ReqOrder reqOrder) { return(Json(reqOrderOper.Update(reqOrder, delegate(object sender, ISession session) { //判断是否存在调拨主单号 IsExistsCode(session, reqOrder); } ))); }
public string GetOrderDescription(ReqOrder req) { return Call<string, ReqOrder>(req, "GetOrderDescription"); }
public decimal GetServerPrice(ReqOrder req) { return Call<decimal, ReqOrder>(req, "GetServerPrice"); }
public List<ProductInfo> GetValidPanels(ReqOrder order) { return Call<List<ProductInfo>, ReqOrder>(order, "GetValidPanels"); }
public string ValidateOrder(ReqOrder order) { return Call<string, ReqOrder>(order, "ValidateOrder"); }
public ActionResult Del(ReqOrder reqOrder) { return(Json(reqOrderOper.Del(reqOrder))); }