public void DeleteStockByGid(uint goodid) { List <Stock> stocks = StockList.FindAll(c => c.goods_id == goodid); if (stocks == null || stocks.Count == 0) { return; } foreach (Stock s in stocks) { StockList.Remove(s); PubMaster.Mod.GoodSql.DeleteStock(s); StockSumChange(s, 0); } }
public bool DeleteStock(uint stockid, out string rs) { Stock stock = StockList.Find(c => c.id == stockid); if (stock == null) { rs = "找不到库存记录"; return(false); } StockList.Remove(stock); PubMaster.Mod.GoodSql.DeleteStock(stock); StockSumChange(stock, 0); if (stock.PosType == StockPosE.顶部) { CheckStockTop(stock.track_id); } rs = ""; return(true); }
private void AddStockToSaleMethod() { try { if (SelectedStock != null) { SelectedStock.SaleValue = StockItemSaleValue; TransactionDetails.Amount += SelectedStock.SaleValue; StockSaleList.Add(_SelectedStock); StockList.Remove(StockList.FirstOrDefault(x => x.Stockid == SelectedStock.Stockid)); SelectedStock = new skStock(); StockItemSaleValue = 0; } } catch (Exception E) { ExepionLogger.Logger.LogException(E); ExepionLogger.Logger.Show(E); } }
private void RemoveFromTransaction() { try { if (TransactionObject.TransactionType == TransactionType.Purchase) { SelectedStock.RemoveFromPurchase(CurrentSession.CurrentUserObject.UserID); StockList.Remove(SelectedStock); PurchaseOBJ.UpdateCurrentObject(); } else { SelectedStock.RemoveFromSale(CurrentSession.CurrentUserObject.UserID); StockList.Remove(SelectedStock); SaleOBJ.UpdateCurrentObject(); } } catch (Exception e) { ExepionLogger.Logger.LogException(e); ExepionLogger.Logger.Show(e); } }
/// <summary> /// 삭제 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnDel_Click(object sender, MouseButtonEventArgs e) { EmsStock target = gridMain.SelectedItem as EmsStock; if (null == target) { return; } if ("CMPT" == target.INSP_STAT_CD) { // 미확정 항목만 삭제 됩니다. this.BaseClass.MsgError("EMS_NOF_DEL"); return; } var strConDate = target.STOCK_INSP_DT.ToString("yyyy-MM-dd"); var strConString = this.BaseClass.GetResourceValue("EMS_REFHIS_DEL"); // 재고 조사 이력을 삭제합니다. this.BaseClass.MsgQuestion($"{strConDate} : {strConString}", BaseEnumClass.CodeMessage.MESSAGE); if (this.BaseClass.BUTTON_CONFIRM_YN != true) { return; } using (BaseDataAccess da = new BaseDataAccess()) { string _SUCCESS_CODE = "100"; try { da.BeginTransaction(); var _USER_ID = this.BaseClass.UserID; var strStockInspDate = target.STOCK_INSP_DT.ToString("yyyyMMdd"); var param = new Dictionary <string, object> { { "P_CENTER_CD", this.BaseClass.CenterCD }, //{ "P_STOCK_INSP_DT", new DateTime(target.STOCK_INSP_DT.Year, target.STOCK_INSP_DT.Month, target.STOCK_INSP_DT.Day) }, { "P_STOCK_INSP_DT", strStockInspDate }, { "P_USER_ID", _USER_ID } }; var strOutParam = new[] { "P_RESULT" }; string callProc = "PK_EMS_ESPA002.SP_EMS_STOCK_DELETE"; var outData = da.GetSpDataSet( callProc // 호출 프로시저 , param // Input 파라메터 , strOutParam // Output 파라메터 ); if (outData.Tables[0].Rows.Count > 0) { if (outData.Tables[0].Rows[0]["CODE"].ToString() != _SUCCESS_CODE) { _SUCCESS_CODE = "0"; da.RollbackTransaction(); BaseClass.MsgInfo(outData.Tables[0].Rows[0]["MSG"].ToString(), BaseEnumClass.CodeMessage.MESSAGE); } } else { _SUCCESS_CODE = "0"; da.RollbackTransaction(); this.BaseClass.MsgError("ERR_INPUT_TYPE"); } if (_SUCCESS_CODE == "100") { da.CommitTransaction(); StockList.Remove(target); gridMain.RefreshData(); //this.ChangeStatusLabelEvent(HelperClass.GetMessageByCountryCode("CMPT_DELETE")); } } catch (Exception ex) { da.RollbackTransaction(); this.BaseClass.MsgError(ex.Message, BaseEnumClass.CodeMessage.MESSAGE); } } }