Пример #1
0
        // データ更新
        // 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);
            }
        }
Пример #2
0
        //// データ追加
        //// 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_Arrivalデータ
        public string PostT_Arrival(T_Arrival regArrival)
        {
            using (var db1 = new SalesManagement_DevContext())
            {
                db1.T_Arrivals.Add(regArrival);
                db1.Entry(regArrival).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);
        }