protected void btnSubmit_Click(object sender, EventArgs e) { //if(txtpw.Text.Trim() == txtretypepw.Text.Trim()) //{ BKCustomerController bcon = new BKCustomerController(); BKCustomerInfo binfo = new BKCustomerInfo(); int i = bcon.selectBKCustomerInfoByMobile(txtMobileNo.Text.Trim()); if (i == 0) { binfo.Name = txtName.Text.Trim(); binfo.Contact = txtMobileNo.Text.Trim(); binfo.address = txtAddress.Text.Trim(); binfo.CustomerPassword = "******"; binfo.InsertDate = DateTime.UtcNow.AddMinutes(390); binfo.UpdateDate = DateTime.UtcNow.AddMinutes(390); string statusMsg = bcon.InsertCustomer(binfo); if (!string.IsNullOrEmpty(statusMsg)) { string msg = "if (Notification.permission === 'granted') { var notify = new Notification('New Customer' , { body: '" + statusMsg + "',icon: '',} )}" + "else {" + "Notification.requestPermission().then(function (p) {" + " if (p === 'granted') {" + " var notify = new Notification('New Customer'+ Msg, {" + " body: '" + statusMsg + "'," + " icon: ''," + " });" + " } else {" + " console.log('User blocked notifications.');" + " }" + " }).catch(function (err) {" + " console.error(err);" + " });" + "};"; ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Alert Message", msg, true); initializeControls(); } else { } } else { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Alert Message", @"alert('Mobile No is already used!\n Try another Mobile No')", true); txtMobileNo.Style.Add("border-color", "Orange"); } }
protected void BtnSignIn_Click(object sender, EventArgs e) { BKCustomerController bcon = new BKCustomerController(); BKCustomerInfo bin = new BKCustomerInfo(); bin.Contact = txtmobile.Text.Trim(); bin.CustomerPassword = txtPassword.Text.Trim(); int ret = bcon.LoginStatus(bin); if (ret > 0) { if (customCheck.Checked) { } Response.Redirect("tstProduct.aspx"); } else { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Alert Message", @"alert('Mobile No (or) Password is incorrect!')", true); } }