コード例 #1
0
        public string Add(Mobiledata obj)
        {
            var query = "insert into BancoTeste (MobileName, MobileIMEno, MobileManufactured, Mobileprice)"
                        + "values(@MobileName, @MobileIMEno, @MobileManufactured, @Mobileprice)";

            con.Execute(query, new { obj.MobileIMEno, obj.MobileManufactured, obj.MobileName, obj.Mobileprice });

            string result = "Enviado com sucesso!";

            return(result);
        }
コード例 #2
0
        public string Updatemobile(Mobiledata objMD)
        {
            string query = "update BancoTeste SET MobileName=@MobileName,MobileIMEno=@MobileIMEno,"
                           + "MobileManufactured=@MobileManufactured,Mobileprice =@Mobileprice "
                           + "where MobileID =@MobileID";

            con.Execute(query, new
            {
                objMD.MobileIMEno,
                objMD.MobileManufactured,
                objMD.MobileName,
                objMD.Mobileprice,
                objMD.MobileID
            });
            string result = "updated";

            return(result);
        }