/// <summary> /// 查找报单明细 /// </summary> /// <returns></returns> public static List <MemberDetailsModel> GetDetails(string orderId) { List <MemberDetailsModel> list = new List <MemberDetailsModel>(); MemberDetailsModel memberDetailsModel = null; string SQL = "select * from MemberDetails where orderId=@orderId"; SqlParameter[] para = { new SqlParameter("@orderId", orderId), }; SqlDataReader reader = DBHelper.ExecuteReader(SQL, para, CommandType.Text); while (reader.Read()) { memberDetailsModel = new MemberDetailsModel(); memberDetailsModel.StoreId = reader["StoreId"].ToString(); memberDetailsModel.Quantity = Convert.ToInt32(reader["Quantity"]); memberDetailsModel.ProductId = Convert.ToInt32(reader["ProductId"]); memberDetailsModel.NotEnoughProduct = Convert.ToInt32(reader["NotEnoughProduct"]); //memberDetailsModel.IsInGroupItemCount = Convert.ToInt32(reader["IsInGroupItemCount"]); //memberDetailsModel.IsGroupItem = reader["IsGroupItem"].ToString(); //memberDetailsModel.HasGroupItem = reader["IsGroupItem"].ToString(); memberDetailsModel.Price = Convert.ToDecimal(reader["Price"]); memberDetailsModel.Pv = Convert.ToDecimal(reader["pv"]); list.Add(memberDetailsModel); } reader.Close(); reader.Dispose(); return(list); }
public void SetMemberDetails(IMember member, MemberDetailsModel model) { member.Name = model.Name; member.Email = model.Email; member.Username = model.Email; member.SetValue(MemberProperty.Gender, (int)model.Gender); member.SetValue(MemberProperty.DateOfBirth, model.DateOfBirth); member.SetValue(MemberProperty.Address1, model.Address1); member.SetValue(MemberProperty.City, model.City); member.SetValue(MemberProperty.Postcode, model.Postcode); member.SetValue(MemberProperty.Phone, model.PhoneNumber); member.SetValue(MemberProperty.BTFNumber, model.BTFNumber); member.SetValue(MemberProperty.medicalConditions, model.MedicalConditions); member.SetValue(MemberProperty.emergencyContactName, model.EmergencyContactName); member.SetValue(MemberProperty.emergencyContactNumber, model.EmergencyContactPhone); member.SetValue(MemberProperty.ShowService, model.ShowService); member.SetValue(MemberProperty.ServiceLinkAddress, model.ServiceWebsite); member.SetValue(MemberProperty.ServiceLinkText, model.ServiceName); member.SetValue(MemberProperty.ServiceDescription, model.ServiceDescription); if (model.ServiceImageFile != null) { var imageUdi = SaveImage(model.ServiceImageFile, _serviceImageFolderId); member.SetValue(MemberProperty.ServiceImage, imageUdi); } Services.MemberService.Save(member); }
public int updateStore11(string storeId, MemberDetailsModel opt, SqlTransaction tran) { string SQL = string.Format(@"UPDATE Stock SET TotalOut = TotalOut +{0}, ActualStorage = ActualStorage -{1}-{4} WHERE ProductID = '{2}' And StoreID = '{3}'", opt.Quantity, opt.Quantity, opt.ProductId, storeId, opt.IsInGroupItemCount); return(DBHelper.ExecuteNonQuery(tran, SQL, null, CommandType.Text)); }
private void GetList(HttpContext context) { MemberQuery query = this.getQuery(context); MemberDetailsModel <Dictionary <string, object> > dataList = this.GetDataList(query); string s = base.SerializeObjectToJson(dataList); context.Response.Write(s); context.Response.End(); }
/// <summary> /// 拆分产品信息--报单信息 /// 注:把组合产品拆分成单品 /// </summary> /// <param name="ods">原产品信息</param> /// <returns>拆分后产品信息</returns> public static IList <MemberDetailsModel> GetNewOrderDetail(IList <MemberDetailsModel> ods) { IList <MemberDetailsModel> orderdetails = new List <MemberDetailsModel>(); foreach (MemberDetailsModel od in ods) { if (ProductDAL.GetIsCombine(od.ProductId)) { IList <ProductCombineDetailModel> comDetails = ProductCombineDetailDAL.GetCombineDetil(od.ProductId); foreach (ProductCombineDetailModel comDetail in comDetails) { int count = 0; foreach (MemberDetailsModel detail in orderdetails) { if (detail.ProductId == comDetail.SubProductID) { detail.Quantity = (comDetail.Quantity * od.Quantity) + detail.Quantity; //detail.NotEnoughProduct = (comDetail.Quantity * od.NotEnoughProduct) + detail.NotEnoughProduct; count++; } } if (count == 0) { MemberDetailsModel orderdetail = new MemberDetailsModel(); orderdetail.Quantity = comDetail.Quantity * od.Quantity; orderdetail.ProductId = comDetail.SubProductID; //orderdetail.NotEnoughProduct = comDetail.Quantity * od.NotEnoughProduct; orderdetails.Add(orderdetail); } } } else { int count = 0; foreach (MemberDetailsModel detail in orderdetails) { if (detail.ProductId == od.ProductId) { detail.Quantity = od.Quantity + detail.Quantity; //detail.NotEnoughProduct = od.NotEnoughProduct + detail.NotEnoughProduct; count++; } } if (count == 0) { MemberDetailsModel orderdetail = new MemberDetailsModel(); orderdetail.Quantity = od.Quantity; //orderdetail.NotEnoughProduct = od.NotEnoughProduct; orderdetail.ProductId = od.ProductId; orderdetails.Add(orderdetail); } } } return(orderdetails); }
private string GetEmailChangeContent(MemberDetailsModel memberDetails, string oldEmail) { var stringBuilder = new StringBuilder(); stringBuilder.AppendFormat("<p>A member has updated their email address</p><p>Member details:</p>"); stringBuilder.AppendFormat("{0}: <strong>{1}</strong><br/>", "Name", memberDetails.Name); stringBuilder.AppendFormat("{0}: <strong>{1}</strong><br/>", "Old Email", oldEmail); stringBuilder.AppendFormat("{0}: <strong>{1}</strong><br/>", "New Email", memberDetails.Email); return(stringBuilder.ToString()); }
private MemberDetailsModel <Dictionary <string, object> > GetDataList(StoresQuery query) { MemberDetailsModel <Dictionary <string, object> > memberDetailsModel = new MemberDetailsModel <Dictionary <string, object> >(); if (query != null) { DbQueryResult storeExpand = StoresHelper.GetStoreExpand(query); memberDetailsModel.rows = DataHelper.DataTableToDictionary(storeExpand.Data); memberDetailsModel.total = storeExpand.TotalRecords; } return(memberDetailsModel); }
public IList <MemberDetailsModel> AddMemberDetails(DataTable dt5) { double totalMoney = 0.00; double totalPv = 0.00; //获取用户选择商品id集合 List <MemberDetailsModel> details = new List <MemberDetailsModel>(); //用户选择商品到总商品集合里去匹配 for (int i = 0; i < dt5.Rows.Count; i++) { int productid = Convert.ToInt32(dt5.Rows[i]["proid"]); ProductModel productuse = ProductDAL.GetProductById(productid); //获取对象 string productName = productuse.ProductName.ToString(); //读取用户输入的数量 double pdtNum = Convert.ToDouble(dt5.Rows[i]["proNum"]); // 读取用户输入的订货信息 if (pdtNum > 0) { //保存订单信息和汇总信息 double price = Convert.ToDouble(productuse.PreferentialPrice); double pv = Convert.ToDouble(productuse.PreferentialPV); totalMoney += price * pdtNum; totalPv += pv * pdtNum; MemberDetailsModel md = new MemberDetailsModel(); md.Price = (decimal)price; md.Pv = (decimal)pv; md.Quantity = (int)pdtNum; md.NotEnoughProduct = (int)pdtNum; md.ProductId = (int)productuse.ProductID; md.ProductName = productName; details.Add(md); } } return(details); }
public async void UpdateMember() { using (var dbFactory = new DbContextFactory()) { var entity = new Member() { FirstName = "Jovana", LastName = "Bajsanski", Gender = Gender.Female, DateOfBirth = new DateTime(2010, 11, 25), Contact = Contact.From("Preradoviceva 36, Petrovaradin"), }; using (var ctx = dbFactory.GetContext()) { ctx.Members.Add(entity); ctx.SaveChanges(); } using (var context = dbFactory.GetContext()) { var member = new MemberDetailsModel { Id = entity.Id, FirstName = "Jovana", LastName = "Bajsanski", Gender = 1, DateOfBirth = new DateTime(2010, 11, 25), ContactAddress = "Preradoviceva 36, Petrovaradin", FatherFirstName = "Zeljko", MotherFirstName = "Ivana", MotherContactPhone = "063 518885" }; // Act var actual = await new SaveMemberCommand.Handler(context, _mockImageService).Handle(new SaveMemberCommand.Request(member), CancellationToken.None); // Assert Assert.Equal("Zeljko", actual.FatherFirstName); Assert.Equal("Ivana", actual.MotherFirstName); Assert.Equal("063 518885", actual.MotherContactPhone); } } }
private MemberDetailsModel <Dictionary <string, object> > GetDataList(MemberQuery query) { MemberDetailsModel <Dictionary <string, object> > memberDetailsModel = new MemberDetailsModel <Dictionary <string, object> >(); if (query != null) { DbQueryResult membersClerkExpand = MemberHelper.GetMembersClerkExpand(query); memberDetailsModel.rows = DataHelper.DataTableToDictionary(membersClerkExpand.Data); memberDetailsModel.total = membersClerkExpand.TotalRecords; foreach (Dictionary <string, object> row in memberDetailsModel.rows) { DateTime dateTime = default(DateTime); DateTime.TryParse((row["CreateDate"] == null) ? "" : row["CreateDate"].ToString(), out dateTime); row["CreateDate"] = dateTime.ToString("yyyy-MM-dd HH:mm:ss"); } } return(memberDetailsModel); }
private MemberDetailsModel <Dictionary <string, object> > GetDataList(ManagerQuery query) { MemberDetailsModel <Dictionary <string, object> > memberDetailsModel = new MemberDetailsModel <Dictionary <string, object> >(); if (query != null) { DbQueryResult managersExpand = ManagerHelper.GetManagersExpand(query); memberDetailsModel.rows = new List <Dictionary <string, object> >(); memberDetailsModel.rows = DataHelper.DataTableToDictionary(managersExpand.Data); memberDetailsModel.total = managersExpand.TotalRecords; if (memberDetailsModel.rows.Count > 0) { memberDetailsModel.rows = (from a in memberDetailsModel.rows orderby Math.Abs(a["RoleId"].ToInt(0) + 1) select a).ToList(); } } return(memberDetailsModel); }
/// <summary> /// 得到店铺的报单明细 /// </summary> /// <param name="orderId">报单号</param> /// <returns></returns> public List <MemberDetailsModel> GetDetails2(string orderId) { List <MemberDetailsModel> MemberDetailsList = new List <MemberDetailsModel>(); string SQL = "Select ProductID,Quantity,Price,Pv FROM MemberDetails WHERE OrderID=@OrderID"; SqlParameter[] para = { new SqlParameter("@OrderID", orderId) }; SqlDataReader reader = DBHelper.ExecuteReader(SQL, para, CommandType.Text); while (reader.Read()) { MemberDetailsModel memberDetailsModel = new MemberDetailsModel(); memberDetailsModel.ProductId = Convert.ToInt32(reader["ProductId"]); memberDetailsModel.Quantity = Convert.ToInt32(reader["Quantity"]); MemberDetailsList.Add(memberDetailsModel); } reader.Close(); reader.Dispose(); return(MemberDetailsList); }
public async void SaveNewMember() { using (var dbFactory = new DbContextFactory()) { using (var context = dbFactory.GetContext()) { var member = new MemberDetailsModel { FirstName = "Jovana", LastName = "Bajsanski", Gender = 1, DateOfBirth = new DateTime(2010, 11, 25), ContactAddress = "Preradoviceva 36, Petrovaradin", FatherFirstName = "Zeljko", MotherFirstName = "Ivana", MotherContactPhone = "063 518885" }; var actual = await new SaveMemberCommand.Handler(context, _mockImageService).Handle(new SaveMemberCommand.Request(member), CancellationToken.None); Assert.NotEqual(0, actual.Id); } } }
/*详细页面*/ public ActionResult Detail(long id) { MemberDetail member = ServiceHelper.Create <IMemberDetailService>().GetHimall_MemberDetail(id); MemberDetailsModel memberModel = new MemberDetailsModel() { Id = member.Id, MemberId = member.MemberId, UserName = member.MemberName, CompanyName = member.CompanyName, CompanyAddress = member.CompanyAddress, CompanySign = member.CompanySign, CompanyProveFile = member.CompanyProveFile, CompanyIntroduction = member.CompanyIntroduction, LastLoginDate = member.StrLastLoginDate, Email = member.Email, CreateDate = member.CreateDate, ZipCode = member.ZipCode, Stage = "启用", }; MemberDetailsModel memberModel1 = memberModel; return(View(memberModel1)); }
public static MemberDetailsModel GenerateMemberDetails(MemberModel member, IHertzTier tier = null) { MemberDetailsModel details = StrongRandom.GenerateRandom <MemberDetailsModel>(); details.A_FIRSTNAME = member.FIRSTNAME; details.A_LASTNAME = member.LASTNAME; details.A_NAMEPREFIX = member.NAMEPREFIX; details.A_NAMESUFFIX = member.NAMESUFFIX; details.A_PRIMARYPHONENUMBER = member.PRIMARYPHONENUMBER; details.A_ZIPORPOSTALCODE = member.PRIMARYPOSTALCODE; details.A_LANGUAGEPREFERENCE = member.PREFERREDLANGUAGE; details.A_TIERCODE = tier.Code; details.A_EARNINGPREFERENCE = tier.ParentProgram.EarningPreference; details.A_HBRACCOUNT = 0; details.A_MEMBERSTATUSCODE = 1; if (String.IsNullOrEmpty(tier.Code)) { details.A_TIERENDDATE = null; } return(details); }
public ActionResult UpdateMemberDetails(MemberDetailsModel model) { var member = _memberProvider.GetLoggedInMember(); if (!ModelState.IsValid || member == null) { return(CurrentUmbracoPage()); } if (!string.Equals(member.Email.Trim(), model.Email.Trim(), StringComparison.OrdinalIgnoreCase)) { FormsAuthentication.SignOut(); FormsAuthentication.SetAuthCookie(model.Email, true); string emailContent = GetEmailChangeContent(model, member.Email); _emailProvider.SendEmail(EmailProvider.MembersEmail, EmailProvider.SupportEmail, "MSTC member email updated", emailContent); } SetMemberDetails(member, model); return(RedirectToCurrentUmbracoUrl()); }
public async Task<ActionResult<MemberDetailsModel>> SaveMember([FromBody] MemberDetailsModel member) { var result = await Mediator.Send(new SaveMemberCommand.Request(member)); return Ok(result); }
/// <summary> /// 取得用户所选的商品集合 /// </summary> /// <returns></returns> public IList <MemberDetailsModel> AddMemberDetails() { /*************************************************************************************/ //for (int i = 0; i < productModelList.Count; i++) //{ #region //object pNumber = Request["N" + productModelList[i].ProductID]; //int ptNum = 0; //if (pNumber != null) //{ // try // { // ptNum = Convert.ToInt32(pNumber); // } // catch // { // // return null; // } // if (ptNum > 0) // { // if (productModelList[i].IsCombineProduct == 1) { hasGroupItem = "true"; } else { } // arrayList.Add(new RegistermemberBLL().GetUserChooseProduct(ptNum, productModelList[i])); // } //} //else //{ // ptNum = 0; //} #endregion //} double totalMoney = 0.00; double totalPv = 0.00; ViewState["StateCount"] = false;//声明一个状态,判断选择的产品数量是否超出库存 //获取用户选择商品id集合 List <MemberDetailsModel> details = new List <MemberDetailsModel>(); //获取商品集合 List <ProductModel> productModelList = new RegistermemberBLL().GetProductModelList(); //用户选择商品到总商品集合里去匹配 for (int i = 0; i < productModelList.Count; i++) { string productid = productModelList[i].ProductID.ToString(); string productName = productModelList[i].ProductName.ToString(); string numStr = Request["N" + productid]; if (numStr == null) { numStr = "0"; } //读取用户输入的数量 double pdtNum; if (numStr != "") { try { pdtNum = Convert.ToInt32(numStr); } catch { return(null); } } else { pdtNum = 0; } // 读取用户输入的订货信息 if (pdtNum > 0) { //保存订单信息和汇总信息 double price = Convert.ToDouble(productModelList[i].PreferentialPrice); double pv = Convert.ToDouble(productModelList[i].PreferentialPV); totalMoney += price * pdtNum; totalPv += pv * pdtNum; MemberDetailsModel md = new MemberDetailsModel(); md.Price = (decimal)price; md.Pv = (decimal)pv; md.Quantity = (int)pdtNum; md.ProductId = (int)productModelList[i].ProductID; md.ProductName = productName; details.Add(md); //判断不可销售的产品是否超出库存 if (MemberOrderAgainBLL.GetIsSellByProId(Convert.ToInt32(productModelList[i].ProductID)) == "1") { int shuliang = md.Quantity; if (IsEdit()) { DataTable dtdetail = MemberOrderAgainBLL.GetMemberDetailsByOrderID(GetOrderId()); for (int j = 0; j < dtdetail.Rows.Count; j++) { if (dtdetail.Rows[j]["productid"].ToString() == productModelList[i].ProductID.ToString()) { shuliang = shuliang - Convert.ToInt32(dtdetail.Rows[j]["Quantity"]); } } } if (MemberOrderAgainBLL.GetCountByProIdAndStoreId(Convert.ToInt32(productModelList[i].ProductID), GetStoreId()) + shuliang < 0) { ViewState["StateCount"] = true; } } } } ViewState["TotalMoney"] = totalMoney; ViewState["TotalPv"] = totalPv; return(details); }
public int updateStore2(MemberDetailsModel model, SqlTransaction tran) { return(addOrderDataDAL.updateStore2(model, tran)); }
/// <summary> /// 取得用户所选的商品集合 /// </summary> /// <returns></returns> public IList <MemberDetailsModel> AddMemberDetails() { double totalMoney = 0.00; double totalPv = 0.00; ViewState["StateCount"] = false;//声明一个状态,判断选择的产品数量是否超出库存 //获取用户选择商品id集合 List <MemberDetailsModel> details = new List <MemberDetailsModel>(); //获取用户提交的选中商品id串 string pids = hidpids.Value; string[] orpids = pids.Split(','); if (orpids.Length > 1) { //用户选择商品到总商品集合里去匹配 for (int i = 1; i < orpids.Length; i++) { int productid = Convert.ToInt32(orpids[i].Substring(1)); ProductModel productuse = ProductDAL.GetProductById(productid); //获取对象 string productName = productuse.ProductName.ToString(); string numStr = Request[orpids[i]]; if (numStr == null) { numStr = "0"; } //读取用户输入的数量 double pdtNum; if (numStr != "") { try { pdtNum = Convert.ToInt32(numStr); } catch { return(null); } } else { pdtNum = 0; } // 读取用户输入的订货信息 if (pdtNum > 0) { //保存订单信息和汇总信息 double price = Convert.ToDouble(productuse.PreferentialPrice); double pv = Convert.ToDouble(productuse.PreferentialPV); totalMoney += price * pdtNum; totalPv += pv * pdtNum; MemberDetailsModel md = new MemberDetailsModel(); md.Price = (decimal)price; md.Pv = (decimal)pv; md.Quantity = (int)pdtNum; md.ProductId = (int)productuse.ProductID; md.ProductName = productName; details.Add(md); //判断不可销售的产品是否超出库存 if (MemberOrderAgainBLL.GetIsSellByProId(Convert.ToInt32(productuse.ProductID)) == "1") { int shuliang = md.Quantity; if (IsEdit()) { DataTable dtdetail = MemberOrderAgainBLL.GetMemberDetailsByOrderID(GetOrderId()); for (int j = 0; j < dtdetail.Rows.Count; j++) { if (dtdetail.Rows[j]["productid"].ToString() == productuse.ProductID.ToString()) { shuliang = shuliang - Convert.ToInt32(dtdetail.Rows[j]["Quantity"]); } } } if (MemberOrderAgainBLL.GetCountByProIdAndStoreId(Convert.ToInt32(productuse.ProductID), GetStoreId()) + shuliang < 0) { ViewState["StateCount"] = true; } } } } } ViewState["TotalMoney"] = totalMoney; ViewState["TotalPv"] = totalPv; return(details); }