// データ更新 // 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 regM_Division : ログ対象データ // out string : ログ文字列 private string T_SyukkoLogData(T_Syukko regT_Syukko) { return(regT_Syukko.SyID.ToString() + ", " + regT_Syukko.SoID.ToString() + ", " + regT_Syukko.EmID.ToString() + ", " + regT_Syukko.ClID.ToString() + ", " + regT_Syukko.OrID.ToString() + ", " + regT_Syukko.SyDate.ToString() + ", " + regT_Syukko.SyStateFlag.ToString() + ", " + regT_Syukko.SyFlag.ToString() + ", " + regT_Syukko.SyHidden); }
//// データ追加 //// in : M_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_Syukkoデータ public string PostT_Syukko(T_Syukko regSyukko) { using (var db1 = new SalesManagement_DevContext()) { db1.T_Syukkos.Add(regSyukko); db1.Entry(regSyukko).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); }