コード例 #1
0
 public void setParmValue(ParmDefine ParmName, object value)
 {
     db0 = getDB0;
     string str = Enum.GetName(typeof(ParmDefine), ParmName);
     var item = db0.i_Parm.Where(x => x.ParmName == str).FirstOrDefault();
     if (item != null)
     {
         if (item.ParmType == "S")
         {
             item.S = (string)value;
         }
         if (item.ParmType == "I")
         {
             item.I = (int)value;
         }
         if (item.ParmType == "F")
         {
             item.F = (decimal)value;
         }
         if (item.ParmType == "D")
         {
             item.D = (DateTime)value;
         }
         if (item.ParmType == "B")
         {
             item.B = (bool)value;
         }
     }
     db0.SaveChanges();
 }
コード例 #2
0
        public void GetPreOrderLevel(string sales_no)
        {
            using (db0 = getDB0)
            {
                var sales = db0.Sales.Find(sales_no);
                var data = sales.ShareSub
                    .Traverse(x => x.ShareSub).Where(x => x.share_level >= sales.share_level).ToList();

                foreach (var t in sales.ShareSub)
                {
                    t.share_level = sales.share_level + 1;

                    TreeSub(t.sales_no, data);
                }

                db0.SaveChanges();
            }
        }