예제 #1
0
        public int DelStockPart(string[] PartNums)
        {
            int result = 0;

            try
            {
                var lists = ConstDB.StockPart.Where(o => PartNums.Contains(o.PartNum)).ToList();
                if (lists.Count > 0)
                {
                    foreach (var obj in lists)
                    {
                        ConstDB.Entry(obj).State = EntityState.Deleted;
                        result += ConstDB.SaveChanges();
                    }
                }
            }
            catch { }
            return(result);
        }
예제 #2
0
        public int UpdateLastGetPLMTime(DateTime LastGetTime)
        {
            int result = 0;

            try
            {
                using (ERP.ERPDbContext ERPDB = new ERP.ERPDbContext(Connection))
                {
                    var CompanyUD = ERPDB.Company_UD.FirstOrDefault();
                    CompanyUD.LastGetPLMTime_c   = LastGetTime;
                    ERPDB.Entry(CompanyUD).State = EntityState.Modified;
                    result = ERPDB.SaveChanges();
                }
            }
            catch { }
            return(result);
        }
예제 #3
0
        public bool DelRev(string PartNum, string UserID, int RevNum)
        {
            bool result = false;

            try
            {
                using (ERP.ERPDbContext ERPDB = new ERP.ERPDbContext(Connection))
                {
                    var model = ERPDB.SyncHistory.Where(o => o.PartNum == PartNum && o.UserID == UserID && o.RevNum == RevNum).FirstOrDefault();
                    if (model != null)
                    {
                        ERPDB.Entry(model).State = EntityState.Deleted;
                        ERPDB.SaveChanges();
                        result = true;
                    }
                }
            }
            catch
            {
                result = false;
            }
            return(result);
        }