Saturday, October 17, 2020

check one checkbox at a time

 <html>

<head>

    <title>how to select only one checkbox at a time in jquery</title>

    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.3/jquery.min.js"></script>

</head>

<body>

    <input value="1" name="product" class="product-list" type="checkbox">Product 1  

    <input value="2" name="product" class="product-list" type="checkbox">Product 2  

    <input value="3" name="product" class="product-list" type="checkbox">Product 3  

    <input value="4" name="product" class="product-list" type="checkbox">Product 4  

    <input value="5" name="product" class="product-list" type="checkbox">Product 5  

    <script type="text/javascript">

    $('.product-list').on('change', function() {

        $('.product-list').not(this).prop('checked', false);  

    });

  </script>

</body>

</html>

Wednesday, October 14, 2020

Distinct list in LINQ

     var search_item = (from n in db.ShobdiboItems select n.ItemName).Distinct().ToList();

    foreach (var ss in search_item)

    {

        listitem.Add(new SelectListItem { Text = ss, Value = ss });

       

    }

Wednesday, October 2, 2019

Pass value in windows.location url by javascript


Solution: <script>
window.location = 'Url?variableName=' + variable;

</script>

//End Solution


Visit our ecommerce site: https://foring-bd.com/

Saturday, September 29, 2018

video player test

...

Wednesday, September 19, 2018

Extreme join and group By

var ssgroupAndjoin    =          (from invoice in _context.Invoices
                          from contact in _context.Contacts
                          where contact.ContactID == id && invoice.ContactID == id
                          join invoiceDetails in _context.InvoiceDetails on invoice.InvoiceID equals invoiceDetails.InvoiceID
                          join product in _context.Products on invoiceDetails.ProductID equals product.productID
                          join supplier in _context.Suppliers on product.SupplierID equals supplier.SuppID                       
                           select new
                          {
                              invoice,
                              invoiceDetails,
                              contact,
                              product,
                              supplier
                          } into invoices
                          group invoices by invoices.invoice.InvoiceID into invoceLists
                          select new
                          {                           
                              invoceLists
                          });



foreach(var result in results)
{
        foreach(var item in result.invoceLists)
       {
             invoiceResults.Add(new
             {
                  invoiceId = item.invoice.InvoiceID

             });
        }

}



#SSTEAM
we are making brotherhood
Sponsored By: Foring


Monday, August 27, 2018

mail send in asp.net mvc

 var body = EmailDataAccessLayer.GetServiceRequestBody(Id);
                MailMessage mailCompany = new MailMessage();
             
                mailCompany.To.Add("mailaddress");
                mailCompany.CC.Add("mail address");
                mailCompany.From = new MailAddress("mailaddress", "royex.net");
                mailCompany.Subject = "Mail Subject";
                mailCompany.Body = string.Format(body);
                mailCompany.IsBodyHtml = true;
                mailCompany.Priority = MailPriority.Normal;
                mailCompany.BodyEncoding = System.Text.Encoding.GetEncoding("utf-8");

                SmtpClient clientComapny = new SmtpClient();
                clientComapny.Host = "hostaddress";
                clientComapny.Credentials = new NetworkCredential("username", "password");
                clientComapny.EnableSsl = true;

             
                    clientComapny.Send(mailCompany);

Wednesday, July 18, 2018

Return RedirectToAction in MVC using async & await

  [HttpPost]
        public async Task<ActionResult> Index(Member model)
        {


            string pass = PasswordHash.Hash(model.Password);
            var search_role = (from n in db.Members where n.UserName == model.UserName && n.Password == pass select n).ToList();
            foreach (var role in search_role)
            {

              //code here
            }



            HttpClient client = new HttpClient();
            var content = new FormUrlEncodedContent(new[]
                {
            new KeyValuePair<string, string>("n", "shimul"),
             new KeyValuePair<string, string>("em", "shimul@royex.net")
        });

            content.Headers.ContentType = new MediaTypeHeaderValue("application/x-www-form-urlencoded");

            await client.PostAsync("http://app.woopsems.com/Email/Customer-Registration.aspx", content);

     



            return RedirectToAction("Index");
        }