Beispiel #1
0
        public static bool add_Cases(DataTable new_Case)
        {
            bool added = false;

            using (ERCEntities entity = new ERCEntities())
            {
                try
                {
                    foreach (DataRow row in new_Case.Rows)
                    {
                        حالات_المهمات newCase = new حالات_المهمات()
                        {
                            رمز_الحالة   = int.Parse(row["رمز_الحالة"].ToString()),
                            الرمز_الشهري = int.Parse(row["الرمز_الشهري"].ToString()),
                            رمز_السنوي   = int.Parse(row["رمز_السنوي"].ToString()),
                            السنة        = int.Parse(row["السنة"].ToString())
                        };
                        entity.حالات_المهمات.Add(newCase);
                        entity.SaveChanges();
                    }

                    added = true;
                    return(added);
                }
                catch
                {
                    added = false;
                    return(added);
                }
            };
        }
Beispiel #2
0
        public static bool add_Mission(المهمات_الملغاة new_Mission)
        {
            bool added = false;

            using (ERCEntities entity = new ERCEntities())
            {
                try
                {
                    entity.المهمات_الملغاة.Add(new_Mission);
                    added = entity.SaveChanges() > 0 ? true : false;;
                    return(added);
                }
                catch
                {
                    added = false;
                    return(added);
                }
            };
        }