public void SetNumPro(int index, int num) { currentpro = (ProInCart)ListPro[index]; if (num <= 0) { num = 1; } currentpro.number = num; currentpro.setTotal(); ListPro[index] = currentpro; }
public void AddNewPro(ProInCart pro) { int numPro = ListPro.Count; for (int i = 0; i < numPro; i++) { currentpro = (ProInCart)ListPro[i]; if ((currentpro.type==pro.type)&&(currentpro.id == pro.id)) { currentpro.number = currentpro.number + 1; currentpro.rate = pro.rate; currentpro.setTotal(); ListPro[i] = currentpro; return; } } this.ListPro.Add(pro); }
public void AddNewPro(ProInCart pro) { int numPro = ListPro.Count; for (int i = 0; i < numPro; i++) { currentpro = (ProInCart)ListPro[i]; if ((currentpro.type == pro.type) && (currentpro.id == pro.id)) { currentpro.number = currentpro.number + 1; currentpro.rate = pro.rate; currentpro.setTotal(); ListPro[i] = currentpro; return; } } this.ListPro.Add(pro); }