public static bool AddLogisticsInfo(LogisticsInfo lg) { try { lg.serialNumber = IDGenerate.generateSerialNumber(); lg.totalPrice = (int.Parse(lg.number) * int.Parse(lg.price)).ToString(); FileTools.insertOneLineData(Global.logisticsInfoPath, lg.ToString()); List <Goods> allGoods = GetAllGoods(); foreach (Goods goods in allGoods) { if (goods.ID.Equals(lg.ID)) { goods.nums += int.Parse(lg.number); modifyGoods(goods); break; } } return(true); } catch (Exception) { return(false); } }
public static bool AddGoods(Goods goods) { try { goods.ID = IDGenerate.generateGoodsID(); FileTools.insertOneLineData(Global.goodsInfoPath, goods.ToString()); return(true); } catch (Exception) { return(false); } }
public static bool AddApplyInfo(ApplyInfo apply) { try { apply.serialNumber = IDGenerate.generateSerialNumber(); apply.status = 0; FileTools.insertOneLineData(Global.applyInfoPath, apply.ToString()); return(true); } catch (Exception) { return(false); } }