Beispiel #1
0
        public bool InsertBK_Product(BK_ProductInfo pinfo)
        {
            try
            {
                using (RMSDataContext db = new RMSDataContext())
                {
                    BK_Product tbl = new BK_Product();
                    Guid       pid = Guid.NewGuid();
                    tbl.BK_ProductID   = pid.ToString();
                    tbl.BK_ProductName = pinfo.BK_ProductName;

                    tbl.CategoryID = pinfo.CategoryID;

                    tbl.UMID     = "48ec165d-d28e-4354-94d7-40636daa7d4f";
                    tbl.BK_Price = 100.00m;

                    tbl.InsertedDate = DateTime.UtcNow.AddMinutes(390).Date;
                    tbl.UpdatedDate  = DateTime.UtcNow.AddMinutes(390).Date;
                    db.BK_Products.InsertOnSubmit(tbl);
                    db.SubmitChanges();

                    return(true);
                }
            }
            catch (Exception ex)
            {
                return(false);
            }
        }
Beispiel #2
0
        public List <BK_ProductInfo> SelectallBKProductinfo()
        {
            try
            {
                List <BK_ProductInfo> lstpinfo = new List <BK_ProductInfo>();
                using (RMSDataContext db = new RMSDataContext())
                {
                    BK_ProductInfo pinfo;
                    var            b = (from c in db.BK_Products select c).ToList();
                    foreach (var obj in b)
                    {
                        pinfo = new BK_ProductInfo();

                        pinfo.BK_ProductID   = obj.BK_ProductID;
                        pinfo.BK_ProductName = obj.BK_ProductName;
                        pinfo.BK_Price       = obj.BK_Price;
                        pinfo.CategoryID     = obj.CategoryID;

                        pinfo.UMID = obj.UMID;

                        //pinfo.InsertedDate = obj.InsertedDate;
                        //pinfo.UpdatedDate = obj.UpdatedDate;

                        lstpinfo.Add(pinfo);
                    }
                    return(lstpinfo);
                }
            }
            catch (Exception ex)
            {
                return(new List <BK_ProductInfo>());
            }
        }
        public void productInsertbyList()
        {
            BK_ProductController  bcon  = new BK_ProductController();
            List <BK_ProductInfo> blist = new List <BK_ProductInfo>();
            BK_ProductInfo        bin;

            List <string> slist = new List <string>();

            for (int i = 0; i < TextBoxCountSec; i++)
            {
                //HtmlGenericControl g = new HtmlGenericControl();
                var g = (HtmlInputText)appendtextbox1.FindControl("txtDynamicSec" + i.ToString());
                if (!string.IsNullOrEmpty(g.Value))
                {
                    bin = new BK_ProductInfo();
                    bin.BK_ProductName = g.Value;
                    bin.CategoryID     = lblCategory.Text;
                    blist.Add(bin);
                }
            }
            if (blist.Count > 0)
            {
                bcon.InsertBK_ProductByList(blist);
                string msg = "if (Notification.permission === 'granted') { var notify = new Notification('New Category Items' , { body: '" + blist.Count + "',icon: '',} )}" +
                             "else {" +

                             "Notification.requestPermission().then(function (p) {" +
                             "        if (p === 'granted') {" +

                             "            var notify = new Notification('New Category Items'+ Msg, {" +
                             "                body: '" + blist.Count + " Category Items Added !'," +
                             "                icon: ''," +
                             "            });" +
                             "        } else {" +
                             "            console.log('User blocked notifications.');" +
                             "        }" +
                             "    }).catch(function (err) {" +
                             "        console.error(err);" +
                             "    });" +
                             "};";


                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Alert Message", msg, true);
                removecontrol1();
                //rptMainList.DataSource = con.SelectAllCategoryInfo();
                //rptMainList.DataBind();
            }
            removecontrol1();
        }
Beispiel #4
0
 public bool InsertBK_Product(BK_ProductInfo pinfo)
 {
     dao = new BK_ProductDAO();
     return(dao.InsertBK_Product(pinfo));
 }