/// <summary> /// 保存并新增 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void simpleBtnSaveAdd_Click(object sender, EventArgs e) { try { SortedList <List <Alading.Entity.StockInOut>, List <StockDetail> > stockDetail = GetStockInOutDetail(); if (stockDetail != null && stockDetail.Count > 0) { StockInOutService.AddStockInOutDetail(stockDetail.Keys[0], stockDetail.Values[0]); } dTable.Rows.Clear(); ComponentInit(); } catch (Exception ex) { XtraMessageBox.Show(ex.Message, Constants.SYSTEM_PROMPT); } }
/// <summary> /// 保存 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void simpleBtnSave_Click(object sender, EventArgs e) { try { SortedList <List <Alading.Entity.StockInOut>, List <StockDetail> > stockDetail = GetStockInOutDetail(); if (stockDetail != null && stockDetail.Count > 0) { //新增 if (IsAddFlag == true) { ReturnType type = StockInOutService.AddStockInOutDetail(stockDetail.Keys[0], stockDetail.Values[0]); if (type == ReturnType.Success) { XtraMessageBox.Show("保存成功", Constants.SYSTEM_PROMPT); this.Close(); } else if (type == ReturnType.PropertyExisted) { XtraMessageBox.Show("调拨单编号重复,请重输", Constants.SYSTEM_PROMPT); } else { XtraMessageBox.Show("保存失败", Constants.SYSTEM_PROMPT); } } //else //{ // //修改 // XtraMessageBox.Show("还没写好怎么更新", Constants.SYSTEM_PROMPT); //} } } catch (Exception ex) { XtraMessageBox.Show(ex.Message, Constants.SYSTEM_PROMPT); } }