Exemplo n.º 1
0
        public void UpdateCustomerByCustomerID(BKCustomerInfo custinfo)
        {
            try
            {
                using (RMSDataContext db = new RMSDataContext())
                {
                    var obj = (from customer in db.BKCustomers
                               where customer.Customercode == custinfo.CustomerCode
                               select customer).First();


                    obj.Contact    = custinfo.Contact;
                    obj.Address    = custinfo.address;
                    obj.Name       = custinfo.Name;
                    obj.TownshipID = custinfo.TownshipID;
                    obj.UpdateDate = DateTime.Now;

                    db.SubmitChanges();
                }
            }
            catch (Exception ex)
            {
                Customer cust = new Customer();
            }
        }
Exemplo n.º 2
0
        public string insert_customer(BKCustomerInfo custinfo)
        {
            try
            {
                using (RMSDataContext db = new RMSDataContext())
                {
                    BKCustomer custbl = new BKCustomer();
                    //custbl.CustomerID = custinfo.CustomerID;
                    custbl.Name             = custinfo.Name;
                    custbl.Address          = custinfo.address;
                    custbl.Contact          = custinfo.Contact;
                    custbl.CustomerPassword = custinfo.CustomerPassword;


                    //custbl.TownshipID = custinfo.TownshipID;
                    custbl.InsertDate = custinfo.InsertDate;
                    custbl.UpdateDate = custinfo.UpdateDate;
                    db.BKCustomers.InsertOnSubmit(custbl);
                    db.SubmitChanges();

                    return(custinfo.Name);
                }
            }
            catch (Exception ex)
            {
                return(string.Empty);
            }
        }
Exemplo n.º 3
0
 public List <BKCustomerInfo> selectallBKCustomerInfo()
 {
     try
     {
         List <BKCustomerInfo> listBKCustomerInfo = new List <BKCustomerInfo>();
         {
             using (RMSDataContext db = new RMSDataContext())
             {
                 BKCustomerInfo BKCustomerInfo;
                 var            a = (from o in db.BKCustomers select o).ToList();
                 foreach (var obj in a)
                 {
                     BKCustomerInfo              = new BKCustomerInfo();
                     BKCustomerInfo.CustomerID   = obj.CustomerID;
                     BKCustomerInfo.CustomerCode = obj.Customercode;
                     BKCustomerInfo.Name         = obj.Name;
                     BKCustomerInfo.TownshipID   = obj.TownshipID;
                     BKCustomerInfo.Contact      = obj.Contact;
                     BKCustomerInfo.address      = obj.Address;
                     BKCustomerInfo.InsertDate   = obj.InsertDate;
                     BKCustomerInfo.UpdateDate   = obj.UpdateDate;
                     listBKCustomerInfo.Add(BKCustomerInfo);
                 }
                 return(listBKCustomerInfo);
             }
         }
     }
     catch (Exception ex)
     {
         return(new List <BKCustomerInfo>());
     }
 }
        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");
            }
        }
Exemplo n.º 5
0
        public void DeleteCustomerByCustomerID(BKCustomerInfo custinfo)
        {
            try
            {
                using (RMSDataContext db = new RMSDataContext())
                {
                    var obj = (from cust in db.BKCustomers
                               where cust.Customercode == custinfo.CustomerCode
                               select cust).First();

                    db.BKCustomers.DeleteOnSubmit(obj);
                    db.SubmitChanges();
                }
            }
            catch (Exception ex)
            {
                Customer c = new Customer();
            }
        }
Exemplo n.º 6
0
        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);
            }
        }
Exemplo n.º 7
0
 public int LoginStatus(BKCustomerInfo custInfo)
 {
     return(cusdao.Login(custInfo.Contact, custInfo.CustomerPassword));
 }
Exemplo n.º 8
0
 public void DeleteCustomer(BKCustomerInfo custInfo)
 {
     cusdao.DeleteCustomerByCustomerID(custInfo);
 }
Exemplo n.º 9
0
 public void UpdateCustomer(BKCustomerInfo custInfo)
 {
     cusdao.UpdateCustomerByCustomerID(custInfo);
 }
Exemplo n.º 10
0
 public string InsertCustomer(BKCustomerInfo custInfo)
 {
     return(cusdao.insert_customer(custInfo));
 }