protected void saveButton_Click(object sender, EventArgs e) { string modelName = inputModelName.Value; string imei = inputImei.Value; int price = Convert.ToInt32(inputPrice.Value); Mobile mobile = new Mobile(modelName, imei, price); mobile.ModelName = modelName; mobile.IMEI = imei; mobile.Price = price; MobileManager mobileManager = new MobileManager(); bool dec = mobileManager.SaveMobile(mobile); if (dec) { saveLabel.Text = string.Empty; saveLabel.Text = "Save"; } else { saveLabel.Text = string.Empty; saveLabel.Text = "Not Saved"; } }
protected void saveButton_Click(object sender, EventArgs e) { string modelName = inputModelName.Value; string imei = inputIMEI.Value; int price = Convert.ToInt32(inputPrice.Value); Mobile mobile = new Mobile(modelName, imei, price); string msg = mobileManager.SaveMobile(mobile); messageLabel.Text = msg; if (msg == "Mobile info Saved Successfully") { messageLabel.ForeColor = Color.Green; } else { messageLabel.ForeColor = Color.Red; } ClearField(); }