// データ追加 // in : T_ChumonDetailデータ public string PostT_ChumonDetail(T_ChumonDetail regChumonDetail) { using (var db1 = new SalesManagement_DevContext()) { db1.T_ChumonDetails.Add(regChumonDetail); db1.Entry(regChumonDetail).State = EntityState.Added; db1.SaveChanges(); } return(string.Empty); }
// データ更新 // in : M_Productデータ // out : エラーメッセージ public string PutProduct(M_Product regProduct) { using (var db = new SalesManagement_DevContext()) { M_Product product; try { product = db.M_Products.Single(x => x.PrID == regProduct.PrID); } catch { // throw new Exception(Messages.errorNotFoundItem, ex); // throw new Exception(_cm.GetMessage(110), ex); return(_msc.GetMessage(110)); } product.PrID = regProduct.PrID; product.MaID = regProduct.MaID; product.PrName = regProduct.PrName; product.Price = regProduct.Price; product.PrJCode = regProduct.PrJCode; product.PrSafetyStock = regProduct.PrSafetyStock; product.ScID = regProduct.ScID; product.PrModelNumber = regProduct.PrModelNumber; product.PrColor = regProduct.PrColor; product.PrReleaseDate = regProduct.PrReleaseDate; product.PrFlag = regProduct.PrFlag; product.PrMemo = regProduct.PrMemo; //Timestamp = item.Timestamp, //LogData = item.LogData, db.Entry(product).State = EntityState.Modified; try { db.SaveChanges(); } catch { // throw new Exception(Messages.errorConflict, ex); // throw new Exception(_cm.GetMessage(100), ex); return(_msc.GetMessage(100)); } // ログ出力 var operationLog = new OperationLog() { EventRaisingTime = DateTime.Now, Operator = _logonUser, Table = "Product", Command = "Put", //Data = ProductLogData(regProduct), }; //StaticCommon.PostOperationLog(operationLog); return(string.Empty); } }
// メッセージ追加 public void PostMessage(List <Messages> messagess) { using (var db = new SalesManagement_DevContext()) { foreach (Messages message in messagess) { db.Messagess.Add(message); } db.SaveChanges(); } }
// データ更新 // in : M_Syukkoデータ // out : エラーメッセージ public string PutSyukko(T_Syukko regSyukko) { using (var db = new SalesManagement_DevContext()) { T_Syukko syukko ; try { syukko = db.T_Syukkos.Single(x => x.SyID == regSyukko.SyID); } catch { // throw new Exception(Messages.errorNotFoundItem, ex); // throw new Exception(_cm.GetMessage(110), ex); return(_msc.GetMessage(110)); } syukko.SyID = regSyukko.SyID; syukko.SoID = regSyukko.SoID; syukko.EmID = regSyukko.EmID; syukko.ClID = regSyukko.ClID; syukko.OrID = regSyukko.OrID; syukko.SyDate = regSyukko.SyDate; syukko.SyStateFlag = regSyukko.SyStateFlag; syukko.SyFlag = regSyukko.SyFlag; syukko.SyHidden = regSyukko.SyHidden; //Timestamp = item.Timestamp, //LogData = item.LogData, db.Entry(syukko).State = EntityState.Modified; try { db.SaveChanges(); } catch { // throw new Exception(Messages.errorConflict, ex); // throw new Exception(_cm.GetMessage(100), ex); return(_msc.GetMessage(100)); } // ログ出力 var operationLog = new OperationLog() { EventRaisingTime = DateTime.Now, Operator = _logonUser, Table = "Syukko", Command = "Syu", //Data = ProductLogData(regChumon), }; //StaticCommon.PostOperationLog(operationLog); return(string.Empty); } }
// データ更新 // in : T_Orderデータ // out : エラーメッセージ public string PutOrder(T_Order regOrder) { using (var db = new SalesManagement_DevContext()) { T_Order order; try { order = db.T_Orders.Single(x => x.OrID == regOrder.OrID); } catch { // throw new Exception(Messages.errorNotFoundItem, ex); // throw new Exception(_cm.GetMessage(110), ex); return(_msc.GetMessage(110)); } order.OrID = regOrder.OrID; order.SoID = regOrder.SoID; order.EmID = regOrder.EmID; order.ClID = regOrder.ClID; order.ClCharge = regOrder.ClCharge; order.OrDate = regOrder.OrDate; order.OrStateFlag = regOrder.OrStateFlag; order.OrFlag = regOrder.OrFlag; order.OrHidden = regOrder.OrHidden; //Timestamp = item.Timestamp, //LogData = item.LogData, db.Entry(order).State = EntityState.Modified; try { db.SaveChanges(); } catch { // throw new Exception(Messages.errorConflict, ex); // throw new Exception(_cm.GetMessage(100), ex); return(_msc.GetMessage(100)); } // ログ出力 var operationLog = new OperationLog() { EventRaisingTime = DateTime.Now, Operator = _logonUser, Table = "Order", Command = "Put", //Data = ProductLogData(regProduct), }; //StaticCommon.PostOperationLog(operationLog); return(string.Empty); } }
// データ更新 // in : M_Clientデータ // out : エラーメッセージ public string PutClient(M_Client regClient) { using (var db = new SalesManagement_DevContext()) { M_Client client; try { client = db.M_Clients.Single(x => x.ClID == regClient.ClID); } catch { // throw new Exception(Messages.errorNotFoundItem, ex); // throw new Exception(_cm.GetMessage(110), ex); return(_msc.GetMessage(110)); } client.ClID = regClient.ClID; client.SoID = regClient.SoID; client.ClName = regClient.ClName; client.ClAddress = regClient.ClAddress; client.ClPhone = regClient.ClPhone; client.ClPostal = regClient.ClPostal; client.ClFAX = regClient.ClFAX; client.ClFlag = regClient.ClFlag; client.ClHidden = regClient.ClHidden; db.Entry(client).State = EntityState.Modified; try { db.SaveChanges(); } catch { // throw new Exception(Messages.errorConflict, ex); // throw new Exception(_cm.GetMessage(100), ex); return(_msc.GetMessage(100)); } // ログ出力 var operationLog = new OperationLog() { EventRaisingTime = DateTime.Now, Operator = _logonUser, Table = "Client", Command = "Put", //Data = ProductLogData(regClient), }; //StaticCommon.PostOperationLog(operationLog); return(string.Empty); } }
// データ更新 // in : T_Arrivalデータ // out : エラーメッセージ public string PutArrival(T_Arrival regArrival) { using (var db = new SalesManagement_DevContext()) { T_Arrival arrival; try { arrival = db.T_Arrivals.Single(x => x.ArID == regArrival.ArID); } catch { // throw new Exception(Messages.errorNotFoundItem, ex); // throw new Exception(_cm.GetMessage(110), ex); return(_msc.GetMessage(110)); } arrival.ArID = regArrival.ArID; arrival.SoID = regArrival.SoID; arrival.EmID = regArrival.EmID; arrival.ClID = regArrival.ClID; arrival.OrID = regArrival.OrID; arrival.ArDate = regArrival.ArDate; arrival.Armemo = regArrival.Armemo; arrival.ArHidden = regArrival.ArHidden; db.Entry(arrival).State = EntityState.Modified; try { db.SaveChanges(); } catch { // throw new Exception(Messages.errorConflict, ex); // throw new Exception(_cm.GetMessage(100), ex); return(_msc.GetMessage(100)); } // ログ出力 var operationLog = new OperationLog() { EventRaisingTime = DateTime.Now, Operator = _logonUser, Table = "Arrival", Command = "Put", //Data = ArrivalLogData(regArrival), }; //StaticCommon.PostOperationLog(operationLog); return(string.Empty); } }
// データ更新 // in : T_Saleデータ // out : エラーメッセージ public string PutSale(T_Sale regSale) { using (var db = new SalesManagement_DevContext()) { T_Sale sale; try { sale = db.T_Sales.Single(x => x.SaID == regSale.SaID); } catch { // throw new Exception(Messages.errorNotFoundItem, ex); // throw new Exception(_cm.GetMessage(110), ex); return(_msc.GetMessage(110)); } sale.SaID = regSale.SaID; sale.ClID = regSale.ClID; sale.SoID = regSale.SoID; sale.EmID = regSale.EmID; sale.OrID = regSale.OrID; sale.SaDate = regSale.SaDate; sale.SaFlag = regSale.SaFlag; sale.SaHidden = regSale.SaHidden; db.Entry(sale).State = EntityState.Modified; try { db.SaveChanges(); } catch { // throw new Exception(Messages.errorConflict, ex); // throw new Exception(_cm.GetMessage(100), ex); return(_msc.GetMessage(100)); } // ログ出力 var operationLog = new OperationLog() { EventRaisingTime = DateTime.Now, Operator = _logonUser, Table = "Sale", Command = "Put", //Data = ProductLogData(regClient), }; //StaticCommon.PostOperationLog(operationLog); return(string.Empty); } }
// データ更新 // in : M_Chumonデータ // out : エラーメッセージ public string PutWarehousing(T_Warehousing regWarehousing) { using (var db = new SalesManagement_DevContext()) { T_Warehousing warehousing; try { warehousing = db.T_Warehousings.Single(x => x.WaID == regWarehousing.WaID); } catch { // throw new Exception(Messages.errorNotFoundItem, ex); // throw new Exception(_cm.GetMessage(110), ex); return(_msc.GetMessage(110)); } warehousing.WaID = regWarehousing.WaID; warehousing.HaID = regWarehousing.HaID; warehousing.EmID = regWarehousing.EmID; warehousing.WaDate = regWarehousing.WaDate; warehousing.WaShelfFlag = regWarehousing.WaShelfFlag; warehousing.WaFlag = regWarehousing.WaFlag; warehousing.WaHidden = regWarehousing.WaHidden; //Timestamp = item.Timestamp, //LogData = item.LogData, db.Entry(warehousing).State = EntityState.Modified; try { db.SaveChanges(); } catch { // throw new Exception(Messages.errorConflict, ex); // throw new Exception(_cm.GetMessage(100), ex); return(_msc.GetMessage(100)); } // ログ出力 var operationLog = new OperationLog() { EventRaisingTime = DateTime.Now, Operator = _logonUser, Table = "Warehousing", Command = "War", }; //StaticCommon.PostOperationLog(operationLog); return(string.Empty); } }
// データ更新 // in : M_Employeeデータ // out : エラーメッセージ public string PutEmployee(M_Employee regEmployee) { using (var db = new SalesManagement_DevContext()) { M_Employee employee; try { employee = db.M_Employees.Single(x => x.EmID == regEmployee.EmID); } catch { // throw new Exception(Messages.errorNotFoundItem, ex); // throw new Exception(_cm.GetMessage(110), ex); return(_msc.GetMessage(110)); } employee.EmID = employee.EmID; employee.EmName = employee.EmName; employee.SoID = employee.SoID; employee.PoID = employee.PoID; employee.EmHiredate = employee.EmHiredate; employee.EmPhone = employee.EmPhone; employee.EmHidden = employee.EmHidden; db.Entry(employee).State = EntityState.Modified; try { db.SaveChanges(); } catch { // throw new Exception(Messages.errorConflict, ex); // throw new Exception(_cm.GetMessage(100), ex); return(_msc.GetMessage(100)); } // ログ出力 var operationLog = new OperationLog() { EventRaisingTime = DateTime.Now, Operator = _logonUser, Table = "Employee", Command = "Put", //Data = EmployeeLogData(regEmployee), }; //StaticCommon.PostOperationLog(operationLog); return(string.Empty); } }
// データ更新 // in : M_ShipmentDetailデータ // out : エラーメッセージ public string PutShipmentDetail(T_ShipmentDetail regShipmentDetail) { using (var db = new SalesManagement_DevContext()) { T_ShipmentDetail shipmentDetail; try { shipmentDetail = db.T_ShipmentDetails.Single(x => x.ShDetailID == regShipmentDetail.ShDetailID); } catch { // throw new Exception(Messages.errorNotFoundItem, ex); // throw new Exception(_cm.GetMessage(110), ex); return(_msc.GetMessage(110)); } shipmentDetail.ShDetailID = regShipmentDetail.ShDetailID; shipmentDetail.ShID = regShipmentDetail.ShID; shipmentDetail.PrID = regShipmentDetail.PrID; shipmentDetail.ShDquantity = regShipmentDetail.ShDquantity; //Timestamp = item.Timestamp, //LogData = item.LogData, db.Entry(shipmentDetail).State = EntityState.Modified; try { db.SaveChanges(); } catch { // throw new Exception(Messages.errorConflict, ex); // throw new Exception(_cm.GetMessage(100), ex); return(_msc.GetMessage(100)); } // ログ出力 var operationLog = new OperationLog() { EventRaisingTime = DateTime.Now, Operator = _logonUser, Table = "Shipment", Command = "Shi", //Data = ProductLogData(regShipment), }; //StaticCommon.PostOperationLog(operationLog); return(string.Empty); } }
// データ更新 // in : T_Hattyuデータ // out : エラーメッセージ public string PutHattyu(T_Hattyu regHattyu) { using (var db = new SalesManagement_DevContext()) { T_Hattyu hattyu; try { hattyu = db.T_Hattyus.Single(x => x.HaID == regHattyu.HaID); } catch { // throw new Exception(Messages.errorNotFoundItem, ex); // throw new Exception(_cm.GetMessage(110), ex); return(_msc.GetMessage(110)); } hattyu.HaID = regHattyu.HaID; hattyu.MaID = regHattyu.MaID; hattyu.EmID = regHattyu.EmID; hattyu.HaDate = regHattyu.HaDate; hattyu.Hamemo = regHattyu.Hamemo; hattyu.HaHidden = regHattyu.HaHidden; db.Entry(hattyu).State = EntityState.Modified; try { db.SaveChanges(); } catch { // throw new Exception(Messages.errorConflict, ex); // throw new Exception(_cm.GetMessage(100), ex); return(_msc.GetMessage(100)); } // ログ出力 var operationLog = new OperationLog() { EventRaisingTime = DateTime.Now, Operator = _logonUser, Table = "Hattyu", Command = "Put", //Data = HattyuLogData(regHattyu), }; //StaticCommon.PostOperationLog(operationLog); return(string.Empty); } }
// データ更新(注文) // in : M_Chumonデータ // out : エラーメッセージ public string PutStockCh(T_Stock regStock) { using (var db = new SalesManagement_DevContext()) { T_Stock stock; try { stock = db.T_Stocks.Single(x => x.StID == regStock.StID); } catch { // throw new Exception(Messages.errorNotFoundItem, ex); // throw new Exception(_cm.GetMessage(110), ex); return(_msc.GetMessage(110)); } stock.StID = regStock.StID; stock.PrID = regStock.PrID; stock.StQuantity = regStock.StQuantity; stock.StFlag = regStock.StFlag; //Timestamp = item.Timestamp, //LogData = item.LogData, db.Entry(stock).State = EntityState.Modified; try { db.SaveChanges(); } catch { // throw new Exception(Messages.errorConflict, ex); // throw new Exception(_cm.GetMessage(100), ex); return(_msc.GetMessage(100)); } // ログ出力 var operationLog = new OperationLog() { EventRaisingTime = DateTime.Now, Operator = _logonUser, Table = "Stock", Command = "Sto", //Data = ProductLogData(regStock), }; //StaticCommon.PostOperationLog(operationLog); return(string.Empty); } }
// 詳細データ更新 // in : T_OrderDetailデータ // out : エラーメッセージ public string PutOrderDetail(T_OrderDetail regOrderDetail) { using (var db = new SalesManagement_DevContext()) { T_OrderDetail orderdetail; try { orderdetail = db.T_OrderDetails.Single(x => x.OrDetailID == regOrderDetail.OrDetailID); } catch { return(_msc.GetMessage(110)); } orderdetail.OrDetailID = regOrderDetail.OrDetailID; orderdetail.OrID = regOrderDetail.OrID; orderdetail.PrID = regOrderDetail.PrID; orderdetail.OrQuantity = regOrderDetail.OrQuantity; orderdetail.OrTotalPrice = regOrderDetail.OrTotalPrice; db.Entry(orderdetail).State = EntityState.Modified; try { db.SaveChanges(); } catch { // throw new Exception(Messages.errorConflict, ex); // throw new Exception(_cm.GetMessage(100), ex); return(_msc.GetMessage(100)); } // ログ出力 var operationLog = new OperationLog() { EventRaisingTime = DateTime.Now, Operator = _logonUser, Table = "OrderDetail", Command = "Put", //Data = ProductLogData(regProduct), }; //StaticCommon.PostOperationLog(operationLog); return(string.Empty); } }
// データ削除 // in Arrival : 削除する入荷ID public void DeleteArrival(int T_ArID) { T_Arrival arrival; using (var db = new SalesManagement_DevContext()) { try { arrival = db.T_Arrivals.Single(x => x.ArID == T_ArID); } catch (Exception ex) { throw new Exception(Messages.errorNotFoundArrival, ex); // throw new Exception(_cm.GetMessage(110), ex); } db.T_Arrivals.Remove(arrival); try { db.SaveChanges(); } catch (DbUpdateConcurrencyException ex) { throw new Exception(Messages.errorConflict, ex); // throw new Exception(_cm.GetMessage(100), ex); } // ログ出力 var operationLog = new OperationLog() { EventRaisingTime = DateTime.Now, Operator = _logonUser, Table = "Arrival", Command = "Delete", Data = arrival.ArID.ToString(), }; //StaticCommon.PostOperationLog(operationLog); } }
// データ削除 // in Product : 削除する商品ID public void DeleteProduct(int M_PrID) { M_Product product; using (var db = new SalesManagement_DevContext()) { try { product = db.M_Products.Single(x => x.PrID == M_PrID); } catch (Exception ex) { throw new Exception(Messages.errorNotFoundProduct, ex); // throw new Exception(_cm.GetMessage(110), ex); } db.M_Products.Remove(product); try { db.SaveChanges(); } catch (DbUpdateConcurrencyException ex) { throw new Exception(Messages.errorConflict, ex); // throw new Exception(_cm.GetMessage(100), ex); } // ログ出力 var operationLog = new OperationLog() { EventRaisingTime = DateTime.Now, Operator = _logonUser, Table = "Product", Command = "Delete", Data = product.PrID.ToString(), }; //StaticCommon.PostOperationLog(operationLog); } }
// データ追加 // in : T_ArrivalDetailデータ public string PostT_ArrivalDetail(T_ArrivalDetail regArrivalDetail) { using (var db1 = new SalesManagement_DevContext()) { db1.T_ArrivalDetails.Add(regArrivalDetail); db1.Entry(regArrivalDetail).State = EntityState.Added; db1.SaveChanges(); } //// ログ出力 //var operationLog = new OperationLog() //{ // EventRaisingTime = DateTime.Now, // Operator = _logonUser, // Table = "Product", // Command = "Post", // Data = M_ProductLogData(regProduct), // Comments = string.Empty //}; //StaticCommon.PostOperationLog(operationLog); return(string.Empty); }
//// データ追加 //// in : T_Productデータ //public string PostM_Product(M_Product regM_Product) //{ // using (var db1 = new SalesManagement_DevContext()) // { // db1.M_Products.Add(regM_Product); // db1.Entry(regM_Product).State = EntityState.Added; // try // { // db1.SaveChanges(); // } // catch // { // // throw new Exception(Messages.errorConflict, ex); // // throw new Exception(_cm.GetMessage(100), ex); // // MessageBox.Show(_msc.GetMessage(100)); // return _msc.GetMessage(100); // } // } //} // データ追加 // in : T_Orderデータ public string PostT_Order(T_Order regOrder) { using (var db1 = new SalesManagement_DevContext()) { db1.T_Orders.Add(regOrder); db1.Entry(regOrder).State = EntityState.Added; db1.SaveChanges(); } //// ログ出力 //var operationLog = new OperationLog() //{ // EventRaisingTime = DateTime.Now, // Operator = _logonUser, // Table = "Order", // Command = "Post", // Data = T_OrderLogData(regOrder), // Comments = string.Empty //}; //StaticCommon.PostOperationLog(operationLog); return(string.Empty); }