Пример #1
0
        //
        // CREATE
        //
        public bool createTypePaiement(TypesPaiementEntity type)
        {
            using (var context = new MADERA_V1Entities())
            {
                MDR_Types_Paiement addType = new MDR_Types_Paiement();

                addType.TPai_Actif = 1;
                addType.TPai_Nom   = type.TPai_Nom;

                try
                {
                    context.MDR_Types_Paiement.Add(addType);
                    context.SaveChanges();
                    return(true);
                }
                catch (Exception e)
                {
                    return(false);
                }
            }
        }
Пример #2
0
        //
        // DELETE
        //
        public bool disabledTypePaiement(int IdType)
        {
            using (var context = new MADERA_V1Entities())
            {
                MDR_Types_Paiement addType = (from t in context.MDR_Types_Paiement
                                              where t.TPai_Index == IdType
                                              select t).SingleOrDefault();

                addType.TPai_Actif = 0;

                try
                {
                    context.SaveChanges();
                    return(true);
                }
                catch (Exception e)
                {
                    return(false);
                }
            }
        }
Пример #3
0
        //
        // UPDATE
        //
        public bool updateTypePaiement(TypesPaiementEntity type)
        {
            using (var context = new MADERA_V1Entities())
            {
                MDR_Types_Paiement addType = (from t in context.MDR_Types_Paiement
                                              where t.TPai_Index == type.TPai_Index
                                              select t).SingleOrDefault();

                addType.TPai_Actif = type.TPai_Actif;
                addType.TPai_Nom   = type.TPai_Nom;
                addType.TPai_Index = type.TPai_Index;

                try
                {
                    context.SaveChanges();
                    return(true);
                }
                catch (Exception e)
                {
                    return(false);
                }
            }
        }