Exemplo n.º 1
0
        private void SaveSize()
        {
            var size = new ProductSizesModel {
                ProductSizeName = mEtCategory.Text.Trim(),
                SizeRank        = mSizesDataAccess.GetMaxSizeRank() + 1
            };

            mSizesDataAccess.InsertIntoTable(size);
        }
Exemplo n.º 2
0
        private void UpdateSize()
        {
            var size = new ProductSizesModel
            {
                ProductSizeName = mEtCategory.Text.Trim(),
                Id = selectedSize.Id
            };

            mSizesDataAccess.UpdateTable(size);
        }
Exemplo n.º 3
0
 public bool InsertIntoTable(ProductSizesModel row)
 {
     try
     {
         using (var connection = new SQLiteConnection(connectionString))
         {
             connection.Insert(row);
             return(true);
         }
     }
     catch (SQLiteException ex)
     {
         Log.Info("SQLiteEx", ex.Message);
         return(false);
     }
 }
Exemplo n.º 4
0
 public bool UpdateTable(ProductSizesModel ProductSizesModel)
 {
     try
     {
         using (var connection = new SQLiteConnection(connectionString))
         {
             connection.Query <ProductSizesModel>("UPDATE ProductSizesModel set ProductSizeName=? Where Id=?",
                                                  ProductSizesModel.ProductSizeName, ProductSizesModel.Id);
             return(true);
         }
     }
     catch (SQLiteException ex)
     {
         Log.Info("SQLiteEx", ex.Message);
         return(false);
     }
 }
Exemplo n.º 5
0
 private void FnGetData()
 {
     isSize                = Intent.GetBooleanExtra("isSize", false);
     isEdit                = Intent.GetBooleanExtra("isEdit", false);
     selectedRecordId      = Intent.GetIntExtra("selectedRecordId", 0);
     mSizesDataAccess      = new SizesDataAccess();
     mCategoriesDataAccess = new CategoriesDataAccess();
     if (isEdit)
     {
         if (isSize)
         {
             selectedSize = mSizesDataAccess.SelectRecord(selectedRecordId)[0];
         }
         else
         {
             selectedCategory = mCategoriesDataAccess.SelectRecord(selectedRecordId)[0];
         }
     }
 }