private void deletebutton_Click(object sender, EventArgs e) { using (var db = new Model1()) { var idstring = productIDbox.Text; if (string.IsNullOrWhiteSpace(idstring)) { MessageBox.Show("No Values has been selected for deleting"); return; } var id = int.Parse(idstring); var category = db.Products.FirstOrDefault(x => x.id == id); db.Products.Remove(category); var sol = db.SaveChanges() > 0; if (sol) { MessageBox.Show("Deleted successfully"); RateBox.Clear(); descriptionbox.Clear(); productIDbox.Clear(); quantitybox.Clear(); Namebox.Clear(); //code to refresh the data table var found = db.Products.ToList(); productdataGridView.DataSource = found.ToDataTable(); } } }
// Use this for initialization void Start() { string rateUrl = RateBox.GetStoreUrl(appStoreAppId, playMarketAppBundleId); //Debug settings are only allowed inside development environment #if (UNITY_EDITOR) if (clearOnStart) { RateBox.Instance.ClearStatistics(); } RateBox.Instance.DebugMode = logDebugMessages; #else RateBox.Instance.DebugMode = false; #endif var rejectButtonTrimmed = rejectButton.Trim(); RateBox.Instance.Init( rateUrl, new RateBoxConditions() { MinSessionCount = minSessionCount, MinCustomEventsCount = minCustomEventsCount, DelayAfterInstallInSeconds = Mathf.CeilToInt(delayAfterInstallInHours * 3600), DelayAfterLaunchInSeconds = Mathf.CeilToInt(delayAfterLaunchInHours * 3600), PostponeCooldownInSeconds = Mathf.CeilToInt(postponeCooldownInHours * 3600), RequireInternetConnection = requireInternetConnection }, new RateBoxTextSettings() { Title = title.Trim(), Message = message.Trim(), RateButtonTitle = rateButton.Trim(), PostponeButtonTitle = postponeButton.Trim(), RejectButtonTitle = rejectButtonTrimmed.Length > 0 ? rejectButtonTrimmed.Trim() : null } ); IAlertPlatformAdapter alertAdapter = null; if (customUIWindow != null) { customUIWindow.SetActive(false); alertAdapter = customUIWindow.GetComponent <IAlertPlatformAdapter>(); } RateBox.Instance.AlertAdapter = alertAdapter; }
public void Ready(Messenger msg) { RateBox.Instance.Init( RateBox.GetStoreUrl("1151798674", Application.identifier), new RateBoxConditions { MinSessionCount = 0, MinCustomEventsCount = 5, DelayAfterInstallInSeconds = 0, DelayAfterLaunchInSeconds = 0, PostponeCooldownInSeconds = 24 * 3600, RequireInternetConnection = true, }, null, new RateBoxSettings() { UseIOSReview = true } ); OnApplicationPause(false); }
private void ProductFormcs_Load(object sender, EventArgs e) { using (var db = new Model1()) { var category = db.Categories.ToList(); CategorycomboBox.DataSource = category.ToDataTable(); CategorycomboBox.DisplayMember = "Title"; CategorycomboBox.ValueMember = "Title"; var product = db.Products.ToList(); productdataGridView.DataSource = product.ToDataTable(); searchbox.Clear(); productIDbox.Clear(); Namebox.Clear(); descriptionbox.Clear(); quantitybox.Clear(); RateBox.Clear(); } }
private void Awake() { manage = this; }
/// <summary> /// Call <see cref="PaperPlaneTools.RateBox.Init"/> function /// </summary> void Start() { GameManager.SafeAddListener <AppRateMessage>(AppRateHandler); string[] texts = new string[] { LocaliseText.Get("Ratebox.FirstText"), //LocaliseText.Get ("Ratebox.SecondText"), //LocaliseText.Get ("Ratebox.ThirdText"), }; //#if UNITY_ANDROID //if ( Utils.AndroidSDKVersion () < 23 ) { // texts = new string[] { // LocaliseText.Get ("Ratebox.FirstTextNoEmoji"), // LocaliseText.Get ("Ratebox.SecondTextNoEmoji"), // LocaliseText.Get ("Ratebox.ThirdTextNoEmoji"), // }; //} //#endif int index = UnityEngine.Random.Range(0, texts.Length); string msg = texts [index]; title = LocaliseText.Get("GameFeedback.RateTitle"); string rateUrl = RateBox.GetStoreUrl(appStoreAppId, playMarketAppBundleId); //Debug settings are only allowed inside development environment #if (UNITY_EDITOR) if (clearOnStart) { RateBox.Instance.ClearStatistics(); } RateBox.Instance.DebugMode = logDebugMessages; #else RateBox.Instance.DebugMode = false; #endif var rejectButtonTrimmed = rejectButton.Trim(); RateBox.Instance.Init( rateUrl, new RateBoxConditions() { MinSessionCount = minSessionCount, MinCustomEventsCount = minCustomEventsCount, DelayAfterInstallInSeconds = Mathf.CeilToInt(delayAfterInstallInHours * 3600), DelayAfterLaunchInSeconds = Mathf.CeilToInt(delayAfterLaunchInHours * 3600), PostponeCooldownInSeconds = Mathf.CeilToInt(postponeCooldownInHours * 3600), RequireInternetConnection = requireInternetConnection }, new RateBoxTextSettings() { Title = title.Trim(), Message = msg.Trim(), RateButtonTitle = rateButton.Trim(), PostponeButtonTitle = postponeButton.Trim(), RejectButtonTitle = rejectButtonTrimmed.Length > 0 ? rejectButtonTrimmed.Trim() : null }, new RateBoxSettings() { UseIOSReview = useIOSReview } ); // Custom alertAdapter allows to display custom UI windows instead of native alerts IAlertPlatformAdapter alertAdapter = null; if (customUIWindow != null) { customUIWindow.SetActive(false); alertAdapter = customUIWindow.GetComponent <IAlertPlatformAdapter>(); } RateBox.Instance.AlertAdapter = alertAdapter; }
private void Addbutton_Click(object sender, EventArgs e) { Mapper.CreateMap <ProductDTO, Product>(); ProductDTO createProductDto = new ProductDTO(); try { decimal value = 0.0M; var rest = decimal.TryParse(quantitybox.Text, out value); if (!rest) { MessageBox.Show("Quantity value is incorrect"); return; } int result = 0; var sol = int.TryParse(RateBox.Text, out result); if (!sol) { MessageBox.Show("Rate value is incorrect"); return; } createProductDto.Description = descriptionbox.Text; createProductDto.Name = Namebox.Text; createProductDto.Quantity = value; createProductDto.Addedby = userID; createProductDto.AddedDate = DateTime.Now; createProductDto.Rate = result; createProductDto.Category = CategorycomboBox.Text; if ( string.IsNullOrWhiteSpace(createProductDto.Description) || string.IsNullOrWhiteSpace(createProductDto.Name) || string.IsNullOrWhiteSpace(createProductDto.Category) ) { MessageBox.Show("Input value cannot be empty or whitespaces"); return; } } catch (Exception exception) { MessageBox.Show("An error occured please try again"); } var product = Mapper.Map <ProductDTO, Product>(createProductDto); using (var db = new Model1()) { var val = db.Products.FirstOrDefault(c => c.Name.ToLower() == product.Name.ToLower()); if (val != null) { MessageBox.Show("Product already exist"); return; } db.Products.Add(product); var added = db.SaveChanges() > 0; if (added) { MessageBox.Show("Product added successfully"); descriptionbox.Clear(); RateBox.Clear(); quantitybox.Clear(); Namebox.Clear(); var prod = db.Products.ToList(); productdataGridView.DataSource = prod.ToDataTable(); } } }