Пример #1
0
        public ActionResult Save(StoreSupplier s)
        {
            bool   success = false;
            string message = "";

            if (s.Supplier_Id == 0)
            {
                if (s.AddSupplier())
                {
                    success = true;
                    message = "Supplier Added Successfully";
                }
                else
                {
                    success = false;
                    message = "Supplier Adding Failed Details Might be duplicated";
                }
            }
            else
            {
                if (s.UpdateSupplier())
                {
                    success = true;
                    message = "Supplier Updated Successfully";
                }
                else
                {
                    success = false;
                    message = "Supplier Updation Failed Details Might be duplicated";
                }
            }

            return(Json(new { success = success, message = message }, JsonRequestBehavior.AllowGet));
        }
Пример #2
0
        public ActionResult Edit(decimal id)
        {
            StoreSupplier s = new StoreSupplier();

            s = s.GetSuppliers()
                .Where(x => x.Supplier_Id == id).ToList()[0];
            return(View("New", s));
        }
Пример #3
0
        public ActionResult SupplierSearch(string query)
        {
            StoreSupplier        menu = new StoreSupplier();
            List <StoreSupplier> StoreSupplierList = menu.GetSuppliers();

            if (!String.IsNullOrWhiteSpace(query))
            {
                StoreSupplierList = StoreSupplierList.Where(m => m.Name.ToLower().Contains(query)).ToList();
            }

            return(Json(StoreSupplierList, JsonRequestBehavior.AllowGet));
        }
Пример #4
0
        public ActionResult Delete(int id)
        {
            bool          success = false;
            string        message = "";
            StoreSupplier s       = new StoreSupplier();

            if (s.DeleteSupplier(id))
            {
                success = true;
                message = "Supplier Delete Successfully";
            }
            else
            {
                success = false;
                message = "Supplier Deletion Failed";
            }
            return(Json(new { success = success, message = message }, JsonRequestBehavior.AllowGet));
        }
Пример #5
0
 /// <summary>
 /// Protected constructor with store supplier
 /// </summary>
 /// <param name="storeSupplier">Supplier use to build the state store</param>
 protected Materialized(StoreSupplier <S> storeSupplier)
     : this(null, storeSupplier)
 {
 }
Пример #6
0
 /// <summary>
 /// Protected constructor with state store name and supplier
 /// </summary>
 /// <param name="name">State store name for query it</param>
 /// <param name="supplier">Supplier use to build the state store</param>
 protected InMemoryWindows(string name, StoreSupplier <WindowStore <Bytes, byte[]> > supplier)
     : base(name, supplier)
 {
 }
Пример #7
0
 /// <summary>
 /// Protected constructor with state store name and supplier
 /// </summary>
 /// <param name="name">State store name for query it</param>
 /// <param name="supplier">Supplier use to build the state store</param>
 protected InMemory(string name, StoreSupplier <IKeyValueStore <Bytes, byte[]> > supplier)
     : base(name, supplier)
 {
 }
Пример #8
0
 /// <summary>
 /// Protected constructor with state store name and supplier
 /// </summary>
 /// <param name="storeName">State store name for query it</param>
 /// <param name="storeSupplier">Supplier use to build the state store</param>
 protected Materialized(string storeName, StoreSupplier <S> storeSupplier)
 {
     this.storeName = storeName;
     StoreSupplier  = storeSupplier;
     retention      = TimeSpan.FromDays(1);
 }
Пример #9
0
        // GET: StoreSupplier
        public ActionResult Index()
        {
            StoreSupplier s = new StoreSupplier();

            return(View(s.GetSuppliers()));
        }
Пример #10
0
 /// <summary>
 /// Protected constructor with store supplier
 /// </summary>
 /// <param name="storeSupplier">Supplier use to build the state store</param>
 protected Materialized(StoreSupplier <S> storeSupplier)
 {
     this.StoreSupplier = storeSupplier;
 }
Пример #11
0
 /// <summary>
 /// Protected constructor with state store name and supplier
 /// </summary>
 /// <param name="storeName">State store name for query it</param>
 /// <param name="storeSupplier">Supplier use to build the state store</param>
 protected Materialized(string storeName, StoreSupplier <S> storeSupplier)
 {
     this.storeName     = storeName;
     this.StoreSupplier = storeSupplier;
 }