public ActionResult Edit(int id) { GiftCardType giftCardType = giftCardTypeBL.GetGiftCardTypeById(id); GiftCardTypeViewModel giftCardTypeViewModel = AutoMapper.Mapper.Map <GiftCardType, GiftCardTypeViewModel>(giftCardType); return(View(giftCardTypeViewModel)); }
public GiftCard(int id, GiftCardType type, string message, double price) { Id = id; Type = type; Message = message; Price = price; }
//Update Giftcardtypes public void UpdateGiftCardType(GiftCardType giftCardType) { using (OnlineTourismDBContext context = new OnlineTourismDBContext()) { context.Entry(giftCardType).State = System.Data.Entity.EntityState.Modified; context.SaveChanges(); } }
//Add giftcardtyes into database public void AddGiftCardType(GiftCardType giftCardType) { using (OnlineTourismDBContext context = new OnlineTourismDBContext()) { context.GiftCardTypes.Add(giftCardType); context.SaveChanges(); } }
public List <GiftCardInfo> GetGiftCardInfoBySOSysNo(int soSysNo, GiftCardType internalType) { DataCommand dc = DataCommandManager.GetDataCommand("GetGiftCardInfoBySOSysNo"); dc.SetParameterValue("@SOSysNo", soSysNo); dc.SetParameterValue("@InternalType", internalType); return(dc.ExecuteEntityList <GiftCardInfo>()); }
//Delete giftcardtype from database public void DeleteGiftCardType(int giftCardTypeId) { using (OnlineTourismDBContext context = new OnlineTourismDBContext()) { GiftCardType giftCardType = GetGiftCardTypeById(giftCardTypeId); context.GiftCardTypes.Attach(giftCardType); context.GiftCardTypes.Remove(giftCardType); context.SaveChanges(); } }
public GiftCardType Update(int id, GiftCardType updated) { var ot = db.GiftCardTypes.Find(id); if (ot == null) { throw new NullReferenceException(); } ot.Notes = updated.Notes; ot.Type = updated.Type; db.SaveChanges(); return(ot); }
public ActionResult AddGiftCardType(GiftCardTypeViewModel giftCardType) { if (ModelState.IsValid) { string fileName = Path.GetFileNameWithoutExtension(giftCardType.ImageFile.FileName); string extension = Path.GetExtension(giftCardType.ImageFile.FileName); fileName = fileName + DateTime.Now.ToString("yymmssfff") + extension; giftCardType.ImageSource = "~/Images/GiftCardTypeImages/" + fileName; GiftCardType cardType = AutoMapper.Mapper.Map <GiftCardTypeViewModel, GiftCardType>(giftCardType); fileName = Path.Combine(Server.MapPath("~/Images/GiftCardTypeImages/"), fileName); giftCardType.ImageFile.SaveAs(fileName); giftCardTypeBL.AddGiftCardType(cardType); return(RedirectToAction("ViewGiftCardTypes")); } return(View()); }
public ActionResult Update([Bind(Include = "GiftCardTypeId,GiftCardTypeName,ImageSource,ImageFile")] GiftCardTypeViewModel giftCardType) { string fileName = Path.GetFileNameWithoutExtension(giftCardType.ImageFile.FileName); string extension = Path.GetExtension(giftCardType.ImageFile.FileName); fileName = fileName + DateTime.Now.ToString("yymmssfff") + extension; giftCardType.ImageSource = "~/Images/GiftCardTypeImages/" + fileName; GiftCardType cardType = AutoMapper.Mapper.Map <GiftCardTypeViewModel, GiftCardType>(giftCardType); fileName = Path.Combine(Server.MapPath("~/Images/GiftCardTypeImages/"), fileName); giftCardType.ImageFile.SaveAs(fileName); GiftCardType giftCard = giftCardTypeBL.GetGiftCardTypeById(giftCardType.GiftCardTypeId); giftCard.GiftCardTypeName = giftCardType.GiftCardTypeName; giftCard.ImageSource = giftCardType.ImageSource; giftCardTypeBL.UpdateGiftCardType(giftCard); return(RedirectToAction("ViewGiftCardTypes")); }
public int Create(GiftCardType giftCardType) { db.GiftCardTypes.Add(giftCardType); db.SaveChanges(); return(giftCardType.Id); }
/// <summary> /// 创建电子礼品卡,在内部组装sp所需的xml message /// </summary> /// <param name="soSysNo">订单编号</param> /// <param name="customerSysNo">顾客编号</param> /// <param name="quantity">礼品卡数量</param> /// <param name="cashAmt">金额</param> /// <param name="memo">备注</param> /// <returns>操作结果状态码</returns> public static string CreateElectronicGiftCard(int soSysNo, int customerSysNo, int quantity, decimal cashAmt, GiftCardType internalType, string memo, string companyCode) { return(ObjectFactory <IIMBizInteract> .Instance.CreateElectronicGiftCard(soSysNo, customerSysNo, quantity, cashAmt, internalType, "IPP.Invoice", memo, companyCode)); }
/// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { unchecked // Overflow is fine, just wrap { var hashCode = 41; // Suitable nullity checks etc, of course :) if (AddressesAreIdentical != null) { hashCode = hashCode * 59 + AddressesAreIdentical.GetHashCode(); } if (BlackListData != null) { hashCode = hashCode * 59 + BlackListData.GetHashCode(); } if (CardOwnerAddress != null) { hashCode = hashCode * 59 + CardOwnerAddress.GetHashCode(); } if (CustomerIpAddress != null) { hashCode = hashCode * 59 + CustomerIpAddress.GetHashCode(); } if (DefaultFormFill != null) { hashCode = hashCode * 59 + DefaultFormFill.GetHashCode(); } if (DeviceFingerprintActivated != null) { hashCode = hashCode * 59 + DeviceFingerprintActivated.GetHashCode(); } if (DeviceFingerprintTransactionId != null) { hashCode = hashCode * 59 + DeviceFingerprintTransactionId.GetHashCode(); } if (GiftCardType != null) { hashCode = hashCode * 59 + GiftCardType.GetHashCode(); } if (GiftMessage != null) { hashCode = hashCode * 59 + GiftMessage.GetHashCode(); } if (HasForgottenPwd != null) { hashCode = hashCode * 59 + HasForgottenPwd.GetHashCode(); } if (HasPassword != null) { hashCode = hashCode * 59 + HasPassword.GetHashCode(); } if (IsPreviousCustomer != null) { hashCode = hashCode * 59 + IsPreviousCustomer.GetHashCode(); } if (OrderTimezone != null) { hashCode = hashCode * 59 + OrderTimezone.GetHashCode(); } if (ShipComments != null) { hashCode = hashCode * 59 + ShipComments.GetHashCode(); } if (ShipmentTrackingNumber != null) { hashCode = hashCode * 59 + ShipmentTrackingNumber.GetHashCode(); } if (ShippingDetails != null) { hashCode = hashCode * 59 + ShippingDetails.GetHashCode(); } if (UserData != null) { hashCode = hashCode * 59 + UserData.GetHashCode(); } if (Website != null) { hashCode = hashCode * 59 + Website.GetHashCode(); } return(hashCode); } }
public void UpdateGiftCardType(GiftCardType giftCardType) { giftCardTypeDAL.UpdateGiftCardType(giftCardType);//Call UpdateGiftCardType() method to update giftcard types }
/// <summary> /// Returns true if FraudFields instances are equal /// </summary> /// <param name="other">Instance of FraudFields to be compared</param> /// <returns>Boolean</returns> public bool Equals(FraudFields other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( AddressesAreIdentical == other.AddressesAreIdentical || AddressesAreIdentical != null && AddressesAreIdentical.Equals(other.AddressesAreIdentical) ) && ( BlackListData == other.BlackListData || BlackListData != null && BlackListData.Equals(other.BlackListData) ) && ( CardOwnerAddress == other.CardOwnerAddress || CardOwnerAddress != null && CardOwnerAddress.Equals(other.CardOwnerAddress) ) && ( CustomerIpAddress == other.CustomerIpAddress || CustomerIpAddress != null && CustomerIpAddress.Equals(other.CustomerIpAddress) ) && ( DefaultFormFill == other.DefaultFormFill || DefaultFormFill != null && DefaultFormFill.Equals(other.DefaultFormFill) ) && ( DeviceFingerprintActivated == other.DeviceFingerprintActivated || DeviceFingerprintActivated != null && DeviceFingerprintActivated.Equals(other.DeviceFingerprintActivated) ) && ( DeviceFingerprintTransactionId == other.DeviceFingerprintTransactionId || DeviceFingerprintTransactionId != null && DeviceFingerprintTransactionId.Equals(other.DeviceFingerprintTransactionId) ) && ( GiftCardType == other.GiftCardType || GiftCardType != null && GiftCardType.Equals(other.GiftCardType) ) && ( GiftMessage == other.GiftMessage || GiftMessage != null && GiftMessage.Equals(other.GiftMessage) ) && ( HasForgottenPwd == other.HasForgottenPwd || HasForgottenPwd != null && HasForgottenPwd.Equals(other.HasForgottenPwd) ) && ( HasPassword == other.HasPassword || HasPassword != null && HasPassword.Equals(other.HasPassword) ) && ( IsPreviousCustomer == other.IsPreviousCustomer || IsPreviousCustomer != null && IsPreviousCustomer.Equals(other.IsPreviousCustomer) ) && ( OrderTimezone == other.OrderTimezone || OrderTimezone != null && OrderTimezone.Equals(other.OrderTimezone) ) && ( ShipComments == other.ShipComments || ShipComments != null && ShipComments.Equals(other.ShipComments) ) && ( ShipmentTrackingNumber == other.ShipmentTrackingNumber || ShipmentTrackingNumber != null && ShipmentTrackingNumber.Equals(other.ShipmentTrackingNumber) ) && ( ShippingDetails == other.ShippingDetails || ShippingDetails != null && ShippingDetails.Equals(other.ShippingDetails) ) && ( UserData == other.UserData || UserData != null && UserData.SequenceEqual(other.UserData) ) && ( Website == other.Website || Website != null && Website.Equals(other.Website) )); }
public void AddGiftCardType(GiftCardType giftCardType) { giftCardTypeDAL.AddGiftCardType(giftCardType); //Call AddGiftCardType() method to add details }
internal static List <GiftCardInfo> GetGiftCardInfoBySOSysNo(int soSysNo, GiftCardType internalType) { return(ObjectFactory <IIMBizInteract> .Instance.GetGiftCardInfoBySOSysNo(soSysNo, internalType)); }
public string CreateElectronicGiftCard(int soSysNo, int customerSysNo, int quantity, decimal cashAmt, GiftCardType internalType, string source, string memo, string companyCode) { return(ObjectFactory <GiftCardProcessor> .Instance.CreateElectronicGiftCard(soSysNo, customerSysNo, quantity, cashAmt, internalType, source, memo, companyCode)); }
public List <GiftCardInfo> GetGiftCardInfoBySOSysNo(int soSysNo, GiftCardType internalType) { return(ObjectFactory <GiftCardProcessor> .Instance.GetGiftCardInfoBySOSysNo(soSysNo, internalType)); }
public GiftCardInfo GetGiftCardInfoByReferenceSOSysNo(int soSysNo, int customerSysNo, GiftCardType internalType, CardMaterialType type) { return(ObjectFactory <GiftCardProcessor> .Instance.GetGiftCardInfoByReferenceSOSysNo(soSysNo, customerSysNo, internalType, type)); }
public GiftCardInfo GetGiftCardInfoByReferenceSOSysNo(int soSysNo, int customerSysNo, GiftCardType internalType, CardMaterialType type) { DataCommand dc = DataCommandManager.GetDataCommand("GetGiftCardInfoByReferenceSOSysNo"); dc.SetParameterValue("@ReferenceSOSysNo", soSysNo); dc.SetParameterValue("@CustomerSysNo", customerSysNo); dc.SetParameterValue("@InternalType", internalType); dc.SetParameterValue("@Type", type); GiftCardInfo result = dc.ExecuteEntity <GiftCardInfo>(); return(result); }
internal static GiftCardInfo GetGiftCardInfoByReferenceSOSysNo(int soSysNo, int customerSysNo, GiftCardType internalType, CardMaterialType type) { return(ObjectFactory <IIMBizInteract> .Instance.GetGiftCardInfoByReferenceSOSysNo(soSysNo, customerSysNo, internalType, type)); }