private void dgUpdate_CellEditEnded(object sender, DataGridCellEditEndedEventArgs e) { EntityStockInventory entity = (EntityStockInventory)e.Row.DataContext; // 明細計算 switch (e.Column.DisplayIndex) { case 4: entity._diff_number = entity._account_inventory_number - entity._practice_inventory_number; break; } }
public List <EntityStockInventory> GetStockInventoryList(string random, string strWhereSql, string strOrderBySql) { List <EntityStockInventory> entityList = new List <EntityStockInventory>(); #region 認証処理 string companyId = ""; string groupId = ""; string userId = ""; string ipAdress = ""; string sessionString = ""; int idFigureCommodity = 0; int idFigureCustomer = 0; int idFigurePurchase = 0; int idFigureSlipNo = 0; try { companyId = ExCast.zCStr(HttpContext.Current.Session[ExSession.COMPANY_ID]); groupId = ExCast.zCStr(HttpContext.Current.Session[ExSession.GROUP_ID]); userId = ExCast.zCStr(HttpContext.Current.Session[ExSession.USER_ID]); ipAdress = ExCast.zCStr(HttpContext.Current.Session[ExSession.IP_ADRESS]); sessionString = ExCast.zCStr(HttpContext.Current.Session[ExSession.SESSION_RANDOM_STR]); idFigureCommodity = ExCast.zCInt(HttpContext.Current.Session[ExSession.ID_FIGURE_GOODS]); idFigureCustomer = ExCast.zCInt(HttpContext.Current.Session[ExSession.ID_FIGURE_CUSTOMER]); idFigurePurchase = ExCast.zCInt(HttpContext.Current.Session[ExSession.ID_FIGURE_PURCHASE]); idFigureSlipNo = ExCast.zCInt(HttpContext.Current.Session[ExSession.ID_FIGURE_SLIP_NO]); string _message = ExSession.SessionUserUniqueCheck(random, ExCast.zCStr(HttpContext.Current.Session[ExSession.SESSION_RANDOM_STR]), ExCast.zCInt(HttpContext.Current.Session[ExSession.USER_ID])); if (_message != "") { EntityStockInventory entity = new EntityStockInventory(); entity.MESSAGE = _message; entityList.Add(entity); return(entityList); } } catch (Exception ex) { CommonUtl.ExLogger.Error(CLASS_NM + ".GetStockInventoryList(認証処理)", ex); EntityStockInventory entity = new EntityStockInventory(); entity.MESSAGE = "認証処理に失敗しました。" + Environment.NewLine + ex.Message.ToString();; entityList.Add(entity); return(entityList); } #endregion StringBuilder sb; DataTable dt; ExMySQLData db; try { db = ExSession.GetSessionDb(ExCast.zCInt(HttpContext.Current.Session[ExSession.USER_ID]), ExCast.zCStr(HttpContext.Current.Session[ExSession.SESSION_RANDOM_STR])); sb = new StringBuilder(); ExReportManeger rptMgr = new ExReportManeger(); rptMgr.idFigureCommodity = idFigureCommodity; rptMgr.idFigureCustomer = idFigureCustomer; rptMgr.idFigurePurchase = idFigurePurchase; rptMgr.idFigureSlipNo = idFigureSlipNo; sb.Append(rptMgr.GetStockInventoryListReportSQL(companyId, groupId, strWhereSql, strOrderBySql)); dt = db.GetDataTable(sb.ToString()); if (dt.DefaultView.Count > 0) { for (int i = 0; i <= dt.DefaultView.Count - 1; i++) { #region Set Entity EntityStockInventory entity = new EntityStockInventory(); entity.commodity_id = ExCast.zCStr(dt.DefaultView[i]["COMMODITY_ID"]); entity.commodity_name = ExCast.zCStr(dt.DefaultView[i]["COMMODITY_NAME"]); entity.account_inventory_number = ExCast.zCDbl(dt.DefaultView[i]["INVENTORY_NUMBER"]); entity.practice_inventory_number = ExCast.zCDbl(dt.DefaultView[i]["INVENTORY_NUMBER"]); entity.diff_number = 0; entity.exec_flg = false; entity.lock_flg = 0; entityList.Add(entity); #endregion } } } catch (Exception ex) { CommonUtl.ExLogger.Error(CLASS_NM + ".GetStockInventoryList", ex); entityList.Clear(); EntityStockInventory entity = new EntityStockInventory(); entity.MESSAGE = CLASS_NM + ".GetStockInventoryList : 予期せぬエラーが発生しました。" + Environment.NewLine + ex.Message.ToString(); entityList.Add(entity); } finally { db = null; } svcPgEvidence.gAddEvidence(ExCast.zCInt(HttpContext.Current.Session[ExSession.EVIDENCE_SAVE_FLG]), companyId, userId, ipAdress, sessionString, DataPgEvidence.PGName.StockInventory.StockInventoryInp, DataPgEvidence.geOperationType.Select, "Where:" + strWhereSql + ",Orderby:" + strOrderBySql); return(entityList); }