Exemplo n.º 1
0
        public int UpdateCreatorInfo(Model.New.Creator ObjCreator)
        {
            using (IDbConnection conn = new OleDbConnection(projectDB))
            {
                string processQuery = @"Update Creator set  
                                                CompanyName=@CompanyName,
                                                ContactName=@ContactName,
                                                StreetAddress=@StreetAddress,
                                                Suburb=@Suburb,
                                                Town=@Town,
                                                Country=@Country,
                                                GPSPosition=@GPSPosition,
                                                Phone=@Phone,
                                                ContactEmail=@ContactEmail,
                                                IdNumber=@IdNumber
                                                Where ID=@ID ";

                int isRowUpdated = conn.Execute(processQuery, new
                {
                    CompanyName   = ObjCreator.CompanyName,
                    ContactName   = ObjCreator.ContactName,
                    StreetAddress = ObjCreator.StreetAddress,
                    Suburb        = ObjCreator.Suburb,
                    Town          = ObjCreator.TownCity,
                    Country       = ObjCreator.Country,
                    GPSPosition   = ObjCreator.GpsPosition,
                    Phone         = ObjCreator.Phone,
                    ContactEmail  = ObjCreator.ContactEmail,
                    IdNumber      = ObjCreator.IdNumber,
                    Id            = ObjCreator.Id
                });
                return(isRowUpdated);
            }
        }
Exemplo n.º 2
0
 public int InsertCreatorInfo(Model.New.Creator ObjCreator)
 {
     using (IDbConnection conn = new OleDbConnection(projectDB))
     {
         string processQuery = @"INSERT INTO Creator
                                   (CompanyName,ContactName,StreetAddress,Suburb,Town,Country,GPSPosition,Phone,ContactEmail,IdNumber) 
                                   VALUES 
                                   (@CompanyName,@ContactName,@StreetAddress,@Suburb,@Town,@Country,@GPSPosition,@Phone,@ContactEmail,@IdNumber)";
         int    isInserted   = conn.Execute(processQuery, new
         {
             CompanyName   = ObjCreator.CompanyName,
             ContactName   = ObjCreator.ContactName,
             StreetAddress = ObjCreator.StreetAddress,
             Suburb        = ObjCreator.Suburb,
             Town          = ObjCreator.TownCity,
             Country       = ObjCreator.Country,
             GPSPosition   = ObjCreator.GpsPosition,
             Phone         = ObjCreator.Phone,
             ContactEmail  = ObjCreator.ContactEmail,
             IdNumber      = ObjCreator.IdNumber
         });
         return(isInserted);
     }
 }