Esempio n. 1
0
        public Response SaveDisctributorDetails(DistributorUnitDetails obj)
        {
            distributorunit itemObj = new distributorunit();

            itemObj.id            = obj.id;
            itemObj.name          = obj.name;
            itemObj.distributorId = obj.distributorId;
            itemObj.productid     = obj.productid;
            itemObj.productname   = obj.productname;
            itemObj.quantity      = obj.quantity;
            itemObj.createdOn     = DateTime.Now;
            entities.distributorunits.Add(itemObj);
            entities.SaveChanges();
            return(new Response {
                IsSuccess = true, Message = "Order forwarded to distribution unit: " + obj.name
            });
        }
Esempio n. 2
0
        public ActionResult OrderManufacturers(string id, string name, string productname, string productid, string quantity, string actualQuantity, string distributorName, string distributorId)
        {
            if (id == "" || id == null)
            {
                id = "0";
            }
            if (productid == "" || productid == null)
            {
                productid = "0";
            }
            if (quantity == "" || quantity == null)
            {
                quantity = "0";
            }
            if (distributorId == "" || distributorId == null)
            {
                distributorId = "0";
            }
            Response                res        = new Response();
            List <object>           resultList = new List <object>();
            var                     idFlag     = Int32.Parse(id);
            ManufacturerUnitDetails item       = new ManufacturerUnitDetails();

            item.name        = name;
            item.productid   = Int32.Parse(productid);
            item.productname = productname;
            item.quantity    = Int32.Parse(actualQuantity);
            item.id          = idFlag;
            DistributorUnitDetails distItem = new DistributorUnitDetails();

            distItem.id            = Int32.Parse(distributorId);
            distItem.name          = distributorName;
            distItem.productid     = Int32.Parse(productid);
            distItem.productname   = productname;
            distItem.distributorId = Int32.Parse(distributorId);
            distItem.quantity      = Int32.Parse(quantity);
            masterDal.UpdateManufacturerDetails(item);
            res = masterDal.SaveDisctributorDetails(distItem);
            resultList.Add(res);
            resultList.Add(GetAllManufacturerDetails());
            return(Json(resultList, JsonRequestBehavior.AllowGet));
        }