示例#1
0
        private void btn_delete_master_company_Click(object sender, EventArgs e)
        {
            string dpPath = Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal), "allcars.sqlite");
            var    db     = new SQLiteConnection(dpPath);


            var subitem = new Tbl_Models();

            subitem.Cid = Convert.ToInt32(txtviewid.Text);

            var data_s = db.Query <Tbl_Models>("select *  from Tbl_Models where Cid=" + Convert.ToInt32(txtviewid.Text));

            if (data_s.Count > 0)
            {
                Toast.MakeText(this, "Record Will not deleted as Company Exists...,", ToastLength.Short).Show();
            }
            else
            {
                var item = new Tbl_Models();
                item.Id = Convert.ToInt32(txtviewid.Text);
                var data = db.Delete(item);
                Toast.MakeText(this, "Record Deleted Successfully...,", ToastLength.Short).Show();
                txt_master_company.Text = "";
                load_spiner_master_company();
            }
        }
示例#2
0
        private void Btndeletemodel_Click(object sender, EventArgs e)
        {
            var item = new Tbl_Models();

            item.Id = Convert.ToInt32(txtmodelid.Text);

            string dpPath = Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal), "allcars.sqlite");
            var    db     = new SQLiteConnection(dpPath);
            var    data   = db.Delete(item);

            Toast.MakeText(this, "Record Deleted Successfully...,", ToastLength.Short).Show();
            txtmodelname.Text = "";
            load_spiner_Master_Company();
            load_spiner_Models();
        }
示例#3
0
        private void Btnsavemodel_Click(object sender, EventArgs e)
        {
            string dpPath = Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal), "allcars.sqlite");
            var    db     = new SQLiteConnection(dpPath);

            db.CreateTable <Tbl_Models>();
            Tbl_Models tbl = new Tbl_Models();

            tbl.Model_Name = Convert.ToString(txtmodelname.Text);
            tbl.Cid        = Convert.ToInt32(txtmastercompanyid.Text);
            tbl.Model_Rate = Convert.ToInt32(txt_rate.Text);
            db.Insert(tbl);
            Toast.MakeText(this, "Record Added Successfully...,", ToastLength.Short).Show();
            txtmodelname.Text = "";
            load_spiner_Master_Company();
            load_spiner_Models();
        }