//修改编号 public int UdpateBianHao(string id, string bianhao) { customerAddressInfo su = ck.customerAddressInfo.Find(id); su.customerNum = bianhao; return(ck.SaveChanges()); }
//删除 public int deletecustomerAddressInfo(string id) { customerAddressInfo su = ck.customerAddressInfo.Find(id); su.isDel = 0; return(ck.SaveChanges()); }
//修改 public int UdpatecustomerAddressInfo(customerAddressInfo id) { customerAddressInfo su = ck.customerAddressInfo.Find(id.AddressNum); su.AddressXinxi = su.AddressXinxi; su.phone = id.phone; su.contacts = id.contacts; return(ck.SaveChanges()); }
//修改地址 public ActionResult UdpateDiZhi(string AddressNum, string AddressXinxi, string contacts, string phone) { KeHuBLL bll = new KeHuBLL(); customerAddressInfo info = new customerAddressInfo(); info.AddressNum = AddressNum; info.AddressXinxi = AddressXinxi; info.contacts = contacts; info.phone = phone; bll.UdpatecustomerAddressInfo(info); return(Json("修改地址成功!", JsonRequestBehavior.AllowGet)); }
//新增客户地址 public ActionResult InsertDiZhi(string AddressXinxi, string phone, string contacts, string bianhao) { KeHuBLL bll = new KeHuBLL(); int shu = bll.CustomerAddressInfo().Count(); string zhang = shu.ToString(); string AddressNum = null; if (zhang.Length == 1) { AddressNum = "XBLY00" + (shu + 1); } else if (zhang.Length == 2) { AddressNum = "XBLY0" + (shu + 1); } else if (zhang.Length == 3) { AddressNum = "XBLY" + (shu + 1); } if (bianhao == "") { customerAddressInfo info = new customerAddressInfo(); info.AddressNum = AddressNum; info.AddressXinxi = AddressXinxi; info.contacts = contacts; info.phone = phone; info.isDel = 1; bll.AddcustomerAddressInfo(info); } else { customerAddressInfo info = new customerAddressInfo(); info.AddressNum = AddressNum; info.AddressXinxi = AddressXinxi; info.customerNum = bianhao; info.contacts = contacts; info.phone = phone; info.isDel = 1; bll.AddcustomerAddressInfo(info); } return(Json("新增地址成功!", JsonRequestBehavior.AllowGet)); }
//新增 public int AddcustomerAddressInfo(customerAddressInfo war) { ck.customerAddressInfo.Add(war); return(ck.SaveChanges()); }
//修改 public int UdpatecustomerAddressInfo(customerAddressInfo id) { return(bll.UdpatecustomerAddressInfo(id)); }
//新增 public int AddcustomerAddressInfo(customerAddressInfo war) { return(bll.AddcustomerAddressInfo(war)); }