protected void chkactive_CheckedChanged(object sender, EventArgs e)
        {
            try
            {
                GridViewRow row       = (sender as CheckBox).Parent.Parent as GridViewRow;
                CheckBox    chkactive = (CheckBox)row.FindControl("chkactive");

                InventoryServiceClient lclsService = new InventoryServiceClient();

                if (chkactive.Checked == true)
                {
                    lclsService.DeleteVendor(Convert.ToInt64(row.Cells[2].Text), true, defaultPage.UserId);
                }
                else
                {
                    lclsService.DeleteVendor(Convert.ToInt64(row.Cells[2].Text), false, defaultPage.UserId);
                    EventLogger log = new EventLogger(config);
                    log.LogInformation(msgdelte.Replace("<<Vendor>>", row.Cells[4].Text.ToString()));
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.VendorDeleteMessage.Replace("<<Vendor>>", row.Cells[4].Text.ToString()), true);
                }
                BindvendorGrid();
            }
            catch (Exception ex)
            {
                EventLogger log = new EventLogger(config);
                log.LogException(ex);
                ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.VendorErrorMessage.Replace("<<Vendor>>", ex.Message), true);
            }
        }
示例#2
0
        private bool ValidateLoookups(InventoryServiceClient service)
        {
            bool   result     = true;
            string errmessage = "";
            //Item Category Lookup
            List <GetItemCategory_Result> lstCat = service.GetItemCategory().Where(a => a.IsActive == true && a.CategoryID == Convert.ToInt64(drdItemCategory.SelectedValue)).ToList();

            if (lstCat.Count == 0)
            {
                errmessage += "ItemCategory (" + drdItemCategory.SelectedItem.Text + ") , ";
                result      = false;
            }

            //UOM Lookup
            List <GetUom_Result> lstUOM = service.GetUom().Where(a => a.IsActivestr == "1" && a.UomID == Convert.ToInt64(ddlUOM.SelectedValue)).ToList();

            if (lstUOM.Count == 0)
            {
                errmessage += "UOM (" + ddlUOM.SelectedItem.Text + ") , ";
                result      = false;
            }

            if (!result)
            {
                LoadLookups("Add");
                EventLogger log = new EventLogger(config);
                string      msg = Constant.WarningLookupMessage.Replace("ShowwarningLookupPopup('", "").Replace("<<values>>", errmessage).Replace("');", "");
                log.LogWarning(msg);
                ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.WarningLookupMessage.Replace("<<values>>", errmessage), true);
            }

            return(result);
        }
示例#3
0
 public void BindItem(string mode)
 {
     try
     {
         InventoryServiceClient       service  = new InventoryServiceClient();
         List <GetDrpItemsByCategory> listItem = null;
         if (mode == "Add")
         {
             listItem = service.GetDrpItemsByCategory(Convert.ToInt64(drdItemCategory.SelectedValue)).Where(a => a.IsActive == true).ToList();
         }
         else
         {
             listItem = service.GetDrpItemsByCategory(Convert.ToInt64(drdItemCategory.SelectedValue)).ToList();
         }
         drdItemID.DataSource     = listItem;
         drdItemID.DataTextField  = "ItemShortName";
         drdItemID.DataValueField = "ItemID";
         drdItemID.DataBind();
         ListItem lst = new ListItem();
         lst.Value = "0";
         lst.Text  = "Select";
         drdItemID.Items.Insert(0, lst);
     }
     catch (Exception ex)
     {
         EventLogger log = new EventLogger(config);
         log.LogException(ex);
         ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.VendorItemMapErrorMessage.Replace("<<VendorItemMap>>", ex.Message), true);
     }
 }
示例#4
0
        public void BindCategory(string mode)
        {
            try
            {
                InventoryServiceClient lclsservice = new InventoryServiceClient();
                foreach (ListItem lst in drpfacilitysearch.Items)
                {
                    if (lst.Selected && drpfacilitysearch.SelectedValue != "All")
                    {
                        SB.Append(lst.Value + ',');
                    }
                }
                if (SB.Length > 0)
                {
                    FinalString = SB.ToString().Substring(0, (SB.Length - 1));
                }
                drpcategorysearch.DataSource     = lclsservice.GetCategoryByListFacilityID(FinalString).ToList();;
                drpcategorysearch.DataValueField = "CategoryID";
                drpcategorysearch.DataTextField  = "CategoryName";
                drpcategorysearch.DataBind();

                foreach (ListItem lst in drpcategorysearch.Items)
                {
                    lst.Attributes.Add("class", "selected");
                    lst.Selected = true;
                }
            }
            catch (Exception ex)
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.EndingInventoryErrorMessage.Replace("<<EndingInventory>>", ex.Message), true);
            }
        }
示例#5
0
        public void BindCategoryadd(string mode)
        {
            try
            {
                InventoryServiceClient lclsservice = new InventoryServiceClient();
                List <GetItemCategory> lstcategory = null;
                if (mode == "Add")
                {
                    lstcategory = lclsservice.GetItemCategory().Where(a => a.IsActive == true).ToList();
                }
                else
                {
                    lstcategory = lclsservice.GetItemCategory().ToList();
                }
                drdItemCategory.DataSource     = lstcategory;
                drdItemCategory.DataValueField = "CategoryID";
                drdItemCategory.DataTextField  = "CategoryName";
                drdItemCategory.DataBind();
                ListItem lst = new ListItem();
                lst.Value = "0";
                lst.Text  = "Select";
                drdItemCategory.Items.Insert(0, lst);


                // Search Item Category Dropdown
            }
            catch (Exception ex)
            {
                EventLogger log = new EventLogger(config);
                log.LogException(ex);
                ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.VendorItemMapErrorMessage.Replace("<<VendorItemMap>>", ex.Message), true);
            }
        }
示例#6
0
        public void BindCategory()
        {
            try
            {
                InventoryServiceClient lclsservice = new InventoryServiceClient();
                List <GetItemCategory> lstcategory = null;
                lstcategory = lclsservice.GetItemCategory().ToList();
                drpItemCategorySearch.DataSource     = lstcategory;
                drpItemCategorySearch.DataValueField = "CategoryID";
                drpItemCategorySearch.DataTextField  = "CategoryName";
                drpItemCategorySearch.DataBind();


                foreach (ListItem lst1 in drpItemCategorySearch.Items)
                {
                    lst1.Attributes.Add("class", "selected");
                    lst1.Selected = true;
                }
            }
            catch (Exception ex)
            {
                EventLogger log = new EventLogger(config);
                log.LogException(ex);
                ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.VendorItemMapErrorMessage.Replace("<<VendorItemMap>>", ex.Message), true);
            }
        }
示例#7
0
        public void BindVendor()
        {
            try
            {
                string SearchItem = string.Empty;
                InventoryServiceClient service    = new InventoryServiceClient();
                List <GetVendor>       listVendor = new List <GetVendor>();
                listVendor = service.GetVendor().ToList();
                drpVendorSearch.DataSource     = listVendor;
                drpVendorSearch.DataTextField  = "VendorDescription";
                drpVendorSearch.DataValueField = "VendorID";
                drpVendorSearch.DataBind();
                //drpVendorSearch.Items.Insert(0, lst);

                foreach (ListItem lst1 in drpVendorSearch.Items)
                {
                    lst1.Attributes.Add("class", "selected");
                    lst1.Selected = true;
                }
            }
            catch (Exception ex)
            {
                EventLogger log = new EventLogger(config);
                log.LogException(ex);
                ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.FacilityVendorAccountErrorMessage.Replace("<<FacilityDescription>>", ex.Message), true);
            }
        }
示例#8
0
 public void BindVendorAdd(string mode)
 {
     try
     {
         string SearchItem = string.Empty;
         InventoryServiceClient service    = new InventoryServiceClient();
         List <GetVendor>       listVendor = new List <GetVendor>();
         if (mode == "Add")
         {
             listVendor = service.GetVendor().Where(a => a.IsActive == true).ToList();
         }
         else
         {
             listVendor = service.GetVendor().ToList();
         }
         drdVendorName.DataSource     = listVendor;
         drdVendorName.DataTextField  = "VendorDescription";
         drdVendorName.DataValueField = "VendorID";
         drdVendorName.DataBind();
         ListItem lst = new ListItem();
         lst.Value = "0";
         lst.Text  = "Select";
         drdVendorName.Items.Insert(0, lst);
     }
     catch (Exception ex)
     {
         EventLogger log = new EventLogger(config);
         log.LogException(ex);
         ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.FacilityVendorAccountErrorMessage.Replace("<<FacilityDescription>>", ex.Message), true);
     }
 }
示例#9
0
        public static List <GetList> BindSubReport(string drpreporttext)
        {
            try
            {
                InventoryServiceClient lclsservice = new InventoryServiceClient();
                List <GetList>         lstLookUp   = new List <GetList>();

                if (drpreporttext != "0")
                {
                    if (drpreporttext == "Usage")
                    {
                        lstLookUp = lclsservice.GetList("Usage", "SubType", "Add").ToList();
                    }
                    else if (drpreporttext == "Cumulative Usage")
                    {
                        lstLookUp = lclsservice.GetList("Cumulative", "SubType", "Add").ToList();
                    }
                }
                return(lstLookUp);
            }
            catch (Exception ex)
            {
                return(null);
            }
        }
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddStandardTemplate((svc, resolver) =>
            {
                var config = resolver.GetService <IConfiguration>();

                var cartChannel = new Channel(config["RpcClients:CartService"], ChannelCredentials.Insecure);
                var cartClient  = new CartServiceClient(cartChannel);

                var inventoryChannel = new Channel(config["RpcClients:InventoryService"], ChannelCredentials.Insecure);
                var inventoryClient  = new InventoryServiceClient(inventoryChannel);

                var reviewChannel = new Channel(config["RpcClients:ReviewService"], ChannelCredentials.Insecure);
                var reviewClient  = new ReviewServiceClient(reviewChannel);
                var pingClient    = new PingServiceClient(reviewChannel);

                var catalogChannel = new Channel(config["RpcClients:CatalogService"], ChannelCredentials.Insecure);
                var catalogClient  = new CatalogServiceClient(catalogChannel);

                var ratingChannel = new Channel(config["RpcClients:RatingService"], ChannelCredentials.Insecure);
                var ratingClient  = new RatingServiceClient(ratingChannel);

                services.AddSingleton(typeof(CartServiceClient), cartClient);
                services.AddSingleton(typeof(InventoryServiceClient), inventoryClient);
                services.AddSingleton(typeof(ReviewServiceClient), reviewClient);
                services.AddSingleton(typeof(PingServiceClient), pingClient);
                services.AddSingleton(typeof(CatalogServiceClient), catalogClient);
                services.AddSingleton(typeof(RatingServiceClient), ratingClient);
            });
        }
示例#11
0
        private void RegisterGrpcServices(IServiceCollection services)
        {
            var cartChannel = new Channel(Configuration["RpcClients:CartService"], ChannelCredentials.Insecure);
            var cartClient  = new CartServiceClient(cartChannel);

            var inventoryChannel = new Channel(Configuration["RpcClients:InventoryService"],
                                               ChannelCredentials.Insecure);
            var inventoryClient = new InventoryServiceClient(inventoryChannel);

            var reviewChannel = new Channel(Configuration["RpcClients:ReviewService"], ChannelCredentials.Insecure);
            var reviewClient  = new ReviewServiceClient(reviewChannel);
            var pingClient    = new PingServiceClient(reviewChannel);

            var catalogChannel =
                new Channel(Configuration["RpcClients:CatalogService"], ChannelCredentials.Insecure);
            var catalogClient = new CatalogServiceClient(catalogChannel);

            var ratingChannel = new Channel(Configuration["RpcClients:RatingService"], ChannelCredentials.Insecure);
            var ratingClient  = new RatingServiceClient(ratingChannel);

            services.AddSingleton(typeof(CartServiceClient), cartClient);
            services.AddSingleton(typeof(InventoryServiceClient), inventoryClient);
            services.AddSingleton(typeof(ReviewServiceClient), reviewClient);
            services.AddSingleton(typeof(PingServiceClient), pingClient);
            services.AddSingleton(typeof(CatalogServiceClient), catalogClient);
            services.AddSingleton(typeof(RatingServiceClient), ratingClient);
        }
示例#12
0
        //private void LoadLookups(string mode)
        //{
        //    BindVendor(mode);
        //    BindFacility(mode);
        //}
        private bool ValidateLoookups(InventoryServiceClient service)
        {
            bool   result     = true;
            string errmessage = "";
            //Facility Lookup
            List <GetFacility> lstfac = service.GetFacility().Where(a => a.IsActive == true && a.FacilityID == Convert.ToInt64(drdFacilityName.SelectedValue)).ToList();

            if (lstfac.Count == 0)
            {
                errmessage += "Facility (" + drdFacilityName.SelectedItem.Text + ") , ";
                result      = false;
            }

            //Vendor Lookup
            List <GetvendorDetails> lstvendor = service.GetvendorDetails("").Where(a => a.IsActive == true && a.VendorID == Convert.ToInt64(drdVendorName.SelectedValue)).ToList();

            if (lstvendor.Count == 0)
            {
                errmessage += "Vendor (" + drdVendorName.SelectedItem.Text + ") ";
                result      = false;
            }


            if (!result)
            {
                EventLogger log = new EventLogger(config);
                string      msg = Constant.WarningLookupMessage.Replace("ShowwarningLookupPopup('", "").Replace("<<values>>", errmessage).Replace("');", "");
                log.LogWarning(msg);
                ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.WarningLookupMessage.Replace("<<values>>", errmessage), true);
            }

            return(result);
        }
示例#13
0
 public void BindCategory(string mode)
 {
     try
     {
         InventoryServiceClient         lclsservice = new InventoryServiceClient();
         List <GetCatagoryByFacilityID> lstcategory = new List <GetCatagoryByFacilityID>();
         BALEndingInventory             lstEndInv   = new BALEndingInventory();
         if (mode == "Add")
         {
             lstEndInv.FacilityID = Convert.ToInt64(drpTransFrom.SelectedValue);
             lstcategory          = lclsservice.GetCatagoryByFacilityID(lstEndInv).ToList();
         }
         else
         {
             lstcategory = lclsservice.GetCatagoryByFacilityID(lstEndInv).ToList();
         }
         drpItemCategory.DataSource     = lstcategory;
         drpItemCategory.DataValueField = "CategoryID";
         drpItemCategory.DataTextField  = "CategoryName";
         drpItemCategory.DataBind();
         ListItem lst = new ListItem();
         lst.Value = "0";
         lst.Text  = "Select";
         drpItemCategory.Items.Insert(0, lst);
         drpItemCategory.SelectedIndex = 0;
     }
     catch (Exception ex)
     {
         ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.ServiceRequestPOErrorMessage.Replace("<<ServiceRequestPO>>", ex.Message.ToString()), true);
     }
 }
 /// <summary>
 /// Retrieves the modifier groups associated with the specified item
 /// </summary>
 /// <param name="context">The store id, station id, and cashier id the information should be restricted to.</param>
 /// <param name="itemNumber">The item number to retrieve info for</param>
 /// <returns>A list of ModifierGroups for the item number</returns>
 public List<ModifierGroup> GetModiferGroupsForItem(Context context, string itemNumber)
 {
     using (var client = new InventoryServiceClient())
     {
         client.Open();
         return new List<ModifierGroup>(client.GetModifierGroupsForItem(context, itemNumber));
     }
 }
 /// <summary>
 /// Retrieves more properties of an item than GetItemList()
 /// </summary>
 /// <returns>A list of inventory items</returns>
 public List<InventoryItem> GetItemListExtended(Context context)
 {
     using (var client = new InventoryServiceClient())
     {
         client.Open();
         return new List<InventoryItem>(client.GetItemListExtended(context));
     }
 }
 /// <summary>
 /// Retrieves a list of all inventory items
 /// </summary>
 /// <returns>A list of inventory items</returns>
 public List<InventoryItem> GetItemList()
 {
     using (var client = new InventoryServiceClient())
     {
         client.Open();
         return new List<InventoryItem>(client.GetItemList());
     }
 }
 /// <summary>
 /// Retrieves the individual modifiers associated with the specified item (modifiers that are not in groups)
 /// </summary>
 /// <param name="context">The store id, station id, and cashier id the information should be restricted to.</param>
 /// <param name="itemNumber">The item number to retrieve info for</param>
 /// <returns>A list of ModifierItems for the item number</returns>
 public List<ModifierItem> GetIndividualModifiers(Context context, string itemNumber)
 {
     using (var client = new InventoryServiceClient())
     {
         client.Open();
         return new List<ModifierItem>(client.GetIndividualModifiers(context, itemNumber));
     }
 }
示例#18
0
 /// <summary>
 /// Retrieves the individual modifiers associated with the specified Modifier Group
 /// </summary>
 /// <param name="context">The store id, station id, and cashier id the information should be restricted to.</param>
 /// <param name="itemNumber">The item number to retrieve info for</param>
 /// <returns>A list of ModifierItems for the item number</returns>
 public List <ModifierItem> GetModifierItemsForModifierGroup(Context context, string itemNumber)
 {
     using (var client = new InventoryServiceClient())
     {
         client.Open();
         return(new List <ModifierItem>(client.GetModifierItemsForModifierGroup(context, itemNumber)));
     }
 }
示例#19
0
 /// <summary>
 /// Retrieves the individual modifiers associated with the specified item (modifiers that are not in groups)
 /// </summary>
 /// <param name="context">The store id, station id, and cashier id the information should be restricted to.</param>
 /// <param name="itemNumber">The item number to retrieve info for</param>
 /// <returns>A list of ModifierItems for the item number</returns>
 public List <ModifierItem> GetIndividualModifiers(Context context, string itemNumber)
 {
     using (var client = new InventoryServiceClient())
     {
         client.Open();
         return(new List <ModifierItem>(client.GetIndividualModifiers(context, itemNumber)));
     }
 }
示例#20
0
 /// <summary>
 /// Retrieves more properties of an item than GetItemList()
 /// </summary>
 /// <returns>A list of inventory items</returns>
 public List <InventoryItem> GetItemListExtended(Context context)
 {
     using (var client = new InventoryServiceClient())
     {
         client.Open();
         return(new List <InventoryItem>(client.GetItemListExtended(context)));
     }
 }
示例#21
0
 /// <summary>
 /// Retrieves information about a specific item, including nested modifier groups and modifiers
 /// </summary>
 /// <param name="context">The store id, station id, and cashier id the information should be restricted to.</param>
 /// <param name="itemNumber">The item number to retrieve info for</param>
 /// <returns>An inventory item</returns>
 public InventoryItem GetItem(Context context, string itemNumber)
 {
     using (var client = new InventoryServiceClient())
     {
         client.Open();
         return(client.GetItem(context, itemNumber));
     }
 }
示例#22
0
 /// <summary>
 /// Retrieves a list of all inventory items
 /// </summary>
 /// <returns>A list of inventory items</returns>
 public List <InventoryItem> GetItemList()
 {
     using (var client = new InventoryServiceClient())
     {
         client.Open();
         return(new List <InventoryItem>(client.GetItemList()));
     }
 }
 /// <summary>
 /// Retrieves information about a specific item, including nested modifier groups and modifiers
 /// </summary>
 /// <param name="context">The store id, station id, and cashier id the information should be restricted to.</param>
 /// <param name="itemNumber">The item number to retrieve info for</param>
 /// <returns>An inventory item</returns>
 public InventoryItem GetItem(Context context, string itemNumber)
 {
     using (var client = new InventoryServiceClient())
     {
         client.Open();
         return client.GetItem(context, itemNumber);
     }
 }
示例#24
0
        public static Dictionary <string, object> BindCumulativebyItemCategory(string CorpID, string FacilityID, string VendorID, string CategoryID, Nullable <DateTime> Month, Nullable <DateTime> DateFrom, Nullable <DateTime> DateTo, string ItemID, string ortype)
        {
            try
            {
                InventoryServiceClient lclsservice = new InventoryServiceClient();
                Page_Controls          defaultPage = new Page_Controls();
                BALReport llstReport = new BALReport();
                string    Status     = string.Empty;
                llstReport.CorporateID    = CorpID;
                llstReport.FacilityID     = FacilityID;
                llstReport.VendorID       = VendorID;
                llstReport.ItemCategoryID = CategoryID;
                if (Convert.ToString(Month) != "")
                {
                    llstReport.DateFrom = Month;
                }
                else
                {
                    llstReport.DateFrom = DateFrom;
                }

                llstReport.DateTo = DateTo;
                if (ItemID != "")
                {
                    llstReport.ItemID = ItemID;
                }
                if (ortype != "0")
                {
                    llstReport.OrderType = ortype;
                }
                llstReport.LoggedInBy = Roleid;
                llstReport.Filter     = "";

                DataSet ds = new DataSet();
                ds = lclsservice.GetCumUsageReport(llstReport);

                DataTable dtColumns = new DataTable();
                dtColumns.Columns.Add("title");
                dtColumns.Columns.Add("data");
                DataRow drr = null;


                foreach (DataColumn dr in ds.Tables[0].Columns)
                {
                    dtColumns.NewRow();
                    dtColumns.Rows.Add(dr.ToString(), dr.ToString());
                }
                Dictionary <string, object> list = new Dictionary <string, object>();
                list["List01"] = GetDataTableDictionaryList(ds.Tables[0]);
                list["List02"] = GetDataTableDictionaryList(dtColumns);
                return(list);
            }
            catch (Exception ex)
            {
                throw;
            }
        }
        public void BindGrid()
        {
            InventoryServiceClient    service = new InventoryServiceClient();
            List <GetFacilityItemMap> list    = new List <GetFacilityItemMap>();

            list = service.GetFacilityItemMap().ToList();
            gridItems.DataSource = list;
            gridItems.DataBind();
        }
 public CoolStoreResolverService(
     CatalogServiceClient catalogServiceClient,
     CartServiceClient cartServiceClient,
     InventoryServiceClient inventoryServiceClient,
     RatingServiceClient ratingServiceClient,
     ReviewServiceClient reviewServiceClient)
 {
     _catalogServiceClient   = catalogServiceClient;
     _cartServiceClient      = cartServiceClient;
     _inventoryServiceClient = inventoryServiceClient;
     _ratingServiceClient    = ratingServiceClient;
     _reviewServiceClient    = reviewServiceClient;
 }
 public CoolStoreResolverService(
     IHttpContextAccessor httpContext,
     CatalogServiceClient catalogServiceClient,
     CartServiceClient cartServiceClient,
     InventoryServiceClient inventoryServiceClient,
     RatingServiceClient ratingServiceClient)
 {
     _httpContext            = httpContext;
     _catalogServiceClient   = catalogServiceClient;
     _cartServiceClient      = cartServiceClient;
     _inventoryServiceClient = inventoryServiceClient;
     _ratingServiceClient    = ratingServiceClient;
 }
示例#28
0
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddStandardTemplate((svc, resolver) =>
            {
                var cartChannel = new Channel(Configuration["RpcClients:CartService"], ChannelCredentials.Insecure);
                var cartClient  = new CartServiceClient(cartChannel);

                var inventoryChannel = new Channel(Configuration["RpcClients:InventoryService"],
                                                   ChannelCredentials.Insecure);
                var inventoryClient = new InventoryServiceClient(inventoryChannel);

                var reviewChannel = new Channel(Configuration["RpcClients:ReviewService"], ChannelCredentials.Insecure);
                var reviewClient  = new ReviewServiceClient(reviewChannel);
                var pingClient    = new PingServiceClient(reviewChannel);

                var catalogChannel =
                    new Channel(Configuration["RpcClients:CatalogService"], ChannelCredentials.Insecure);
                var catalogClient = new CatalogServiceClient(catalogChannel);

                var ratingChannel = new Channel(Configuration["RpcClients:RatingService"], ChannelCredentials.Insecure);
                var ratingClient  = new RatingServiceClient(ratingChannel);

                services.AddSingleton(typeof(CartServiceClient), cartClient);
                services.AddSingleton(typeof(InventoryServiceClient), inventoryClient);
                services.AddSingleton(typeof(ReviewServiceClient), reviewClient);
                services.AddSingleton(typeof(PingServiceClient), pingClient);
                services.AddSingleton(typeof(CatalogServiceClient), catalogClient);
                services.AddSingleton(typeof(RatingServiceClient), ratingClient);

                services.AddSingleton <ICoolStoreResolverService, CoolStoreResolverService>();
                services.AddSingleton <CoolStoreSchema>();
                services.AddSingleton(provider => provider.GetRequiredService <CoolStoreSchema>().CoolStore);

                services.AddSignalR(options => options.EnableDetailedErrors = true)
                .AddQueryStreamHubWithTracing();

                services.AddCors(options =>
                {
                    options.AddDefaultPolicy(policy =>
                    {
                        policy.WithOrigins("*");
                        policy.AllowAnyHeader();
                        policy.AllowAnyMethod();
                        policy.AllowCredentials();
                        policy.WithHeaders("X-Requested-With", "authorization");
                    });
                });

                services.AddSingleton <IHttpContextAccessor, HttpContextAccessor>();
            });
        }
示例#29
0
        //private void LoadLookups(string mode)
        //{
        //    try
        //    {
        //        BindCategory(mode);
        //        BindItem(mode);
        //        BindVendor(mode);
        //    }
        //    catch (Exception ex)
        //    {
        //        ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.VendorItemMapErrorMessage.Replace("<<VendorItemMap>>", ex.Message), true);
        //    }
        //}

        private bool ValidateLoookups(InventoryServiceClient service)
        {
            try
            {
                bool   result     = true;
                string errmessage = "";
                //Item Category Lookup
                List <GetItemCategory> lstCat = service.GetItemCategory().Where(a => a.IsActive == true && a.CategoryID == Convert.ToInt64(drdItemCategory.SelectedValue)).ToList();
                if (lstCat.Count == 0)
                {
                    errmessage += "ItemCategory (" + drdItemCategory.SelectedItem.Text + ") , ";
                    result      = false;
                }

                //Item based on Category Lookup
                List <GetDrpItemsByCategory> lstitemCat = service.GetDrpItemsByCategory(Convert.ToInt64(drdItemCategory.SelectedValue)).Where(a => a.IsActive == true && a.ItemID == Convert.ToInt64(drdItemID.SelectedValue)).ToList();
                if (lstitemCat.Count == 0)
                {
                    errmessage += "Item (" + drdItemID.SelectedItem.Text + ") , ";
                    result      = false;
                }

                //Vendor Lookup
                List <GetvendorDetails> lstvendor = service.GetvendorDetails("").Where(a => a.IsActive == true && a.VendorID == Convert.ToInt64(drdVendorID.SelectedValue)).ToList();
                if (lstvendor.Count == 0)
                {
                    errmessage += "Vendor (" + drdVendorID.SelectedItem.Text + ") ";
                    result      = false;
                }



                if (!result)
                {
                    EventLogger log = new EventLogger(config);
                    string      msg = Constant.WarningLookupMessage.Replace("ShowwarningLookupPopup('", "").Replace("<<values>>", errmessage).Replace("');", "");
                    log.LogWarning(msg);
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.WarningLookupMessage.Replace("<<values>>", errmessage), true);
                }

                return(result);
            }
            catch (Exception ex)
            {
                EventLogger log = new EventLogger(config);
                log.LogException(ex);
                ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.VendorItemMapErrorMessage.Replace("<<VendorItemMap>>", ex.Message), true);
                return(false);
            }
        }
示例#30
0
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddStandardTemplate((svc, resolver) =>
            {
                var cartChannel = new Channel(Configuration["RpcClients:CartService"], ChannelCredentials.Insecure);
                var cartClient  = new CartServiceClient(cartChannel);

                var inventoryChannel = new Channel(Configuration["RpcClients:InventoryService"],
                                                   ChannelCredentials.Insecure);
                var inventoryClient = new InventoryServiceClient(inventoryChannel);

                var reviewChannel = new Channel(Configuration["RpcClients:ReviewService"], ChannelCredentials.Insecure);
                var reviewClient  = new ReviewServiceClient(reviewChannel);
                var pingClient    = new PingServiceClient(reviewChannel);

                var catalogChannel =
                    new Channel(Configuration["RpcClients:CatalogService"], ChannelCredentials.Insecure);
                var catalogClient = new CatalogServiceClient(catalogChannel);

                var ratingChannel = new Channel(Configuration["RpcClients:RatingService"], ChannelCredentials.Insecure);
                var ratingClient  = new RatingServiceClient(ratingChannel);

                services.AddSingleton(typeof(CartServiceClient), cartClient);
                services.AddSingleton(typeof(InventoryServiceClient), inventoryClient);
                services.AddSingleton(typeof(ReviewServiceClient), reviewClient);
                services.AddSingleton(typeof(PingServiceClient), pingClient);
                services.AddSingleton(typeof(CatalogServiceClient), catalogClient);
                services.AddSingleton(typeof(RatingServiceClient), ratingClient);

                services.AddSingleton <ICoolStoreResolverService, CoolStoreResolverService>();
                services.AddSingleton <CoolStoreSchema>();
                services.AddSingleton(provider => provider.GetRequiredService <CoolStoreSchema>().CoolStore);

                services.AddCors(options =>
                {
                    options.AddPolicy("CorsPolicy",
                                      policy => policy
                                      .AllowAnyMethod()
                                      .AllowAnyHeader()
                                      /* https://github.com/aspnet/AspNetCore/issues/4457 */
                                      .SetIsOriginAllowed(host => true)
                                      .AllowCredentials());
                });

                services.AddSignalR(options => options.EnableDetailedErrors = true)
                .AddQueryStreamHubWithTracing();

                services.AddSingleton <IHttpContextAccessor, HttpContextAccessor>();
            });
        }
        protected void btnprintdt_Click(object sender, EventArgs e)
        {
            try
            {
                lcls.VendorID   = Convert.ToInt64(hiddenVendorID.Value);
                lcls.LoggedinBy = defaultPage.UserId;
                lcls.Filter     = "";
                InventoryServiceClient        lclsservice      = new InventoryServiceClient();
                List <GetVendorDetailsReport> llstdetailreview = lclsservice.GetVendorDetailsReport(lcls).ToList();
                rvvendorreport.ProcessingMode         = ProcessingMode.Local;
                rvvendorreport.LocalReport.ReportPath = Server.MapPath("~/Reports/VendorDetailsReport.rdlc");
                ReportDataSource datasource = new ReportDataSource("VendorDetailsReportDS", llstdetailreview);
                rvvendorreport.LocalReport.DataSources.Clear();
                rvvendorreport.LocalReport.DataSources.Add(datasource);
                rvvendorreport.LocalReport.Refresh();
                Warning[] warnings;
                string[]  streamids;
                string    mimeType;
                string    encoding;
                string    extension;
                byte[]    bytes = rvvendorreport.LocalReport.Render("PDF", "", out mimeType, out encoding, out extension, out streamids, out warnings);
                Guid      guid  = Guid.NewGuid();
                string    path  = ConfigurationManager.AppSettings["TempFileLocation"].ToString();
                _sessionPDFFileName = "VendorDetails" + guid + ".pdf";
                if (!Directory.Exists(path))
                {
                    Directory.CreateDirectory(path);
                }
                path = Path.Combine(path, _sessionPDFFileName);
                using (StreamWriter sw = new StreamWriter(File.Create(path)))
                {
                    sw.Write("");
                }

                FileStream fs = new FileStream(path, FileMode.Open);
                // byte[] data = new byte[fs.Length];
                fs.Write(bytes, 0, bytes.Length);
                fs.Close();
                ShowPDFFile(path);
                Page.ClientScript.RegisterStartupScript(this.GetType(), "CallMyFunction", "ShowContent();", true);
            }
            catch (Exception ex)
            {
                EventLogger log = new EventLogger(config);
                log.LogException(ex);
                ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.VendorErrorMessage.Replace("<<Vendor>>", ex.Message), true);
            }
        }
 public void BindItem()
 {
     try
     {
         InventoryServiceClient service  = new InventoryServiceClient();
         List <GetItemDRD>      listItem = new List <GetItemDRD>();
         listItem                 = service.GetItemDRD().ToList();
         drdItemID.DataSource     = listItem;
         drdItemID.DataTextField  = "ItemShortName";
         drdItemID.DataValueField = "ItemID";
         drdItemID.DataBind();
     }
     catch (Exception ex)
     {
     }
 }
 protected void btnSearchVendor_Click(object sender, EventArgs e)
 {
     try
     {
         InventoryServiceClient  lclsvenservice   = new InventoryServiceClient();
         List <GetvendorDetails> lstvendordetails = new List <GetvendorDetails>();
         lstvendordetails    = lclsvenservice.GetvendorDetails(txtSearchVendor.Text).ToList();
         gvvendor.DataSource = lstvendordetails;
         gvvendor.DataBind();
     }
     catch (Exception ex)
     {
         EventLogger log = new EventLogger(config);
         log.LogException(ex);
         ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.VendorErrorMessage.Replace("<<Vendor>>", ex.Message), true);
     }
 }
示例#34
0
        protected void Page_Load(object sender, EventArgs e)
        {
            InventoryServiceClient isc = new InventoryServiceClient();

            if (!IsPostBack)
            {
                if (isc.GetDepartmentNames() != null)
                {
                    departments.DataSource = isc.GetDepartmentNames();

                    foreach (string d in isc.GetDepartmentNames())
                    {
                        departments.Items.Add(d);

                    }
                }
            }
        }
        protected void chkactive_CheckedChanged(object sender, EventArgs e)
        {
            GridViewRow row       = (sender as CheckBox).Parent.Parent as GridViewRow;
            CheckBox    chkactive = (CheckBox)row.FindControl("chkactive");

            InventoryServiceClient lclsService = new InventoryServiceClient();

            if (chkactive.Checked == true)
            {
                lclsService.DeleteFacilityItemMap(Convert.ToInt64(row.Cells[1].Text), Convert.ToInt64(Session["User"]), true);
            }
            else
            {
                lclsService.DeleteFacilityItemMap(Convert.ToInt64(row.Cells[1].Text), Convert.ToInt64(Session["User"]), false);
            }

            BindGrid();
        }
 public void BindFacility()
 {
     try
     {
         InventoryServiceClient      lclsservice = new InventoryServiceClient();
         List <GetFacilityShortName> lstcategory = lclsservice.GetFacilityShortName().ToList();
         ddlFacilityID.DataSource     = lstcategory;
         ddlFacilityID.DataValueField = "FacilityID";
         ddlFacilityID.DataTextField  = "FacilityShortName";
         ddlFacilityID.DataBind();
         ListItem lst = new ListItem();
         lst.Value = "0";
         lst.Text  = "Select";
         ddlFacilityID.Items.Insert(0, lst);
     }
     catch (Exception ex)
     {
     }
 }