public ActionResult Details(int id) { //ReturnMasterModel model = _context.ReturnMasterModel.Find(id); var model = (from p in _context.OrderReturnModel join pp in _context.OrderMasterModel on p.OrderId equals pp.OrderId join sm in _context.StoreModel on p.StoreId equals sm.StoreId join wm in _context.WarehouseModel on p.WarehouseId equals wm.WarehouseId join cusle in _context.CustomerLevelModel on pp.CustomerLevelId equals cusle.CustomerLevelId join prov in _context.ProvinceModel on pp.ProvinceId equals prov.ProvinceId into provTemp from ptempt in provTemp.DefaultIfEmpty() join distr in _context.DistrictModel on pp.DistrictId equals distr.DistrictId into DistrictId from ptempt2 in DistrictId.DefaultIfEmpty() where (p.OrderReturnMasterId == id && p.Actived == true) select new OrderReturnMasterViewModel() { OrderReturnMasterId = p.OrderReturnMasterId, OrderReturnMasterCode = p.OrderReturnMasterCode, StoreName = sm.StoreName, WarehouseName = wm.WarehouseName, OrderCode = pp.OrderCode, CustomerName = pp.FullName, CustomerLevelName = cusle.CustomerLevelName, IdentityCard = pp.IdentityCard, Phone = pp.Phone, Gender2 = pp.Gender == true ? "Nam" : "Nữ", Email = pp.Email, ProvinceName = string.IsNullOrEmpty(ptempt.ProvinceName) ? "" : ptempt.ProvinceName, DistrictName = string.IsNullOrEmpty(ptempt2.DistrictName) ? "" : ptempt2.DistrictName, Address = pp.Address, SaleName = pp.SaleName, CompanyName = pp.CompanyName, TaxBillCode = pp.TaxBillCode, ContractNumber = pp.ContractNumber, TaxBillDate = pp.TaxBillDate, // Note = p.Note, DebtDueDate = pp.DebtDueDate, Note = p.Note, SumPrice = p.OrderReturnDetailModel.Sum(s => s.UnitPrice), BillDiscount = p.BillDiscount, BillDiscountTypeId = p.BillDiscountTypeId, BillVAT = p.BillVAT, TotalPrice = p.TotalPrice, PaymentMethodId = p.PaymentMethodId, Paid = p.Paid.HasValue ? p.Paid.Value : 0, MoneyTransfer = p.MoneyTransfer.HasValue? p.MoneyTransfer.Value : 0, RemainingAmount = p.RemainingAmount }).FirstOrDefault(); if (model == null) { return(HttpNotFound()); } return(View(model)); }
public override int GetHashCode() { var hashCode = 944434587; hashCode = hashCode * -1521134295 + CommunityId.GetHashCode(); hashCode = hashCode * -1521134295 + DistrictId.GetHashCode(); hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Name); return(hashCode); }
public override int GetHashCode() { var hashCode = 1213410472; hashCode = hashCode * -1521134295 + DistrictId.GetHashCode(); hashCode = hashCode * -1521134295 + ProvinceId.GetHashCode(); hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Name); return(hashCode); }
public override int GetHashCode() { unchecked { int result = DistrictId.GetHashCode(); result = (result * 397) ^ AgeId.GetHashCode(); result = (result * 397) ^ SexId.GetHashCode(); result = (result * 397) ^ JobId.GetHashCode(); return(result); } }
/// <summary> /// Returns true if OwnerVerificationPdfViewModel instances are equal /// </summary> /// <param name="other">Instance of OwnerVerificationPdfViewModel to be compared</param> /// <returns>Boolean</returns> public bool Equals(OwnerVerificationPdfViewModel other) { if (other is null) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( ReportDate == other.ReportDate || ReportDate.Equals(other.ReportDate) ) && ( Title == other.Title || Title.Equals(other.Title) ) && ( DistrictId == other.DistrictId || DistrictId.Equals(other.DistrictId) ) && ( MinistryDistrictId == other.MinistryDistrictId || MinistryDistrictId.Equals(other.MinistryDistrictId) ) && ( DistrictName == other.DistrictName || DistrictName.Equals(other.DistrictName) ) && ( DistrictAddress == other.DistrictAddress || DistrictAddress.Equals(other.DistrictAddress) ) && ( DistrictContact == other.DistrictContact || DistrictContact.Equals(other.DistrictContact) ) && ( Owners == other.Owners || Owners.Equals(other.Owners) )); }
/// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { // credit: http://stackoverflow.com/a/263416/677735 unchecked // Overflow is fine, just wrap { int hash = 41; // Suitable nullity checks hash = hash * 59 + ReportDate.GetHashCode(); hash = hash * 59 + Title.GetHashCode(); hash = hash * 59 + DistrictId.GetHashCode(); hash = hash * 59 + MinistryDistrictId.GetHashCode(); hash = hash * 59 + DistrictName.GetHashCode(); hash = hash * 59 + DistrictAddress.GetHashCode(); hash = hash * 59 + DistrictContact.GetHashCode(); hash = hash * 59 + Owners.GetHashCode(); return(hash); } }
public ActionResult Get3FieldByOrderID(int?OrderID) { var data = (from p in _context.OrderMasterModel join cusle in _context.CustomerLevelModel on p.CustomerLevelId equals cusle.CustomerLevelId join prov in _context.ProvinceModel on p.ProvinceId equals prov.ProvinceId into provTemp from ptempt in provTemp.DefaultIfEmpty() join distr in _context.DistrictModel on p.DistrictId equals distr.DistrictId into DistrictId from ptempt2 in DistrictId.DefaultIfEmpty() where (p.OrderId == OrderID) select new { StoreId = p.StoreId, WarehouseId = p.WarehouseId, CustomerId = p.FullName, CustomerLevelId = cusle.CustomerLevelName, IdentityCard = p.IdentityCard, Phone = p.Phone, Gender = p.Gender == true?"Nam": "Nữ", Email = p.Email, ProvinceId = string.IsNullOrEmpty(ptempt.ProvinceName) ? "" : ptempt.ProvinceName, DistrictId = string.IsNullOrEmpty(ptempt2.DistrictName) ? "" : ptempt2.DistrictName, Address = p.Address, SaleId = p.SaleName, CompanyName = p.CompanyName, TaxBillCode = p.TaxBillCode, ContractNumber = p.ContractNumber, TaxBillDate = p.TaxBillDate, // Note = p.Note, DebtDueDate = p.DebtDueDate, BillDiscount = p.BillDiscount, BillDiscountTypeId = p.BillDiscountTypeId, BillVAT = p.BillVAT }).FirstOrDefault(); return(Json(data, JsonRequestBehavior.AllowGet)); }
public override bool Equals(Object obj) { if (obj is Problem ob) { return(Id.Equals(ob.Id) && CategoryId.Equals(ob.CategoryId) && ThemeId.Equals(ob.ThemeId) && Adress.Equals(ob.Adress) && SourceId.Equals(ob.SourceId) && CreateDate.Equals(ob.CreateDate) && AnswerDate.Equals(ob.AnswerDate) && ProblemText.Equals(ob.ProblemText) && ProblemPhotos.Equals(ob.ProblemPhotos) && AnswerText.Equals(ob.AnswerText) && AnswerPhotos.Equals(ob.AnswerPhotos) && StatusId.Equals(ob.StatusId) && DistrictId.Equals(ob.DistrictId) && ChildID.Equals(ob.ChildID) && ParentID.Equals(ob.ParentID) && IspolnitelName.Equals(ob.IspolnitelName) && IspolnitelId.Equals(ob.IspolnitelId)); } return(false); }
public override string ToString() { return(DistrictId.ToString() + "," + PersonIds.JoinString(",")); }