Beispiel #1
0
 public override string ToString()
 {
     return(string.Concat(new string[] {
         "SupplierID: ", SupplierID.ToString(),
         "ProductID: ", ProductID.ToString(),
         "Date First Supplied: ", DateFirstSupplied.ToString()
     }));
 }
 public override string ToString()
 {
     return(String.Concat(new string[]
     {
         " supplier ID ", SupplierID.ToString(), " Supplier Name ", SupplierName,
         " Addr1 ", SupplierAddressLine1, " addr2 ", Addressline2
     }));
 }
Beispiel #3
0
 public override string ToString()
 {
     return(string.Concat(new string[] {
         "SupplierID: ", SupplierID.ToString(),
         "Supplier Name: ", SupplierName,
         "Address Line 1: ", AddressLine1,
         "Address Line 2: ", AddressLine2
     }));
 }
Beispiel #4
0
        /// <summary>
        /// Override of the ToString method.
        /// </summary>
        /// <returns>Supplier ID, Type and Company Name</returns>
        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();

            sb.Append("Product Name: ");
            sb.Append(ProductName);
            sb.Append("\tCategory ID: ");
            sb.Append(CategoryID.ToString());
            sb.Append("\tSupplier ID ");
            sb.Append(SupplierID.ToString());
            return(sb.ToString());
        }
Beispiel #5
0
 protected override string[] GetContent()
 {
     return(new[]
     {
         ID.ToString(),
         SpotTime.ToShortDateString(),
         Price.ToString(),
         ValueContextID.ToString(),
         ProductID.ToString(),
         SupplierID.ToString(),
         DescriptionID.ToString()
     });
 }
 public MainPage Add(string Product, string Price, string Quantity, string Stock, string Order, string Level)
 {
     AllProducts.Click();
     CreateNew.Click();
     ProductName.SendKeys(Product);
     CategoryID.FindElement(By.XPath("//option[. = 'Seafood']")).Click();
     SupplierID.FindElement(By.XPath("//option[. = 'Leka Trading']")).Click();
     UnitPrice.SendKeys(Price);
     QuantityPerUnit.SendKeys(Quantity);
     UnitsInStock.SendKeys(Stock);
     UnitsOnOrder.SendKeys(Order);
     ReorderLevel.SendKeys(Level);
     Confirm.Click();
     return(new MainPage(driver));
 }
 public MainPage Exist()
 {
     AllProducts.Click();
     TestProduct.Click();
     Assert.AreEqual(ProductName.GetAttribute("value"), "Test Product");
     Assert.AreEqual(CategoryID.FindElement(By.XPath("//option[. = 'Seafood']")).GetAttribute("text"), "Seafood");
     Assert.AreEqual(SupplierID.FindElement(By.XPath("//option[. = 'Leka Trading']")).GetAttribute("text"), "Leka Trading");
     Assert.AreEqual(UnitPrice.GetAttribute("value"), "111,0000");
     Assert.AreEqual(QuantityPerUnit.GetAttribute("value"), "222");
     Assert.AreEqual(UnitsInStock.GetAttribute("value"), "333");
     Assert.AreEqual(UnitsOnOrder.GetAttribute("value"), "444");
     Assert.AreEqual(ReorderLevel.GetAttribute("value"), "555");
     Home.Click();
     logoutField.Click();
     return(new MainPage(driver));
 }
        protected void bindSupplierList()
        {
            DataTableConversion lsttodt    = new DataTableConversion();
            ISupplierRepository repository = new SupplierRepository();
            var       lst = repository.SupplierLists().Select(x => new { x.Name, x.ID }).ToList();
            DataTable dt  = lsttodt.ToDataTable(lst);

            if (dt != null && dt.Rows.Count > 0)
            {
                SupplierID.DataSource     = dt;
                SupplierID.DataTextField  = "Name";
                SupplierID.DataValueField = "ID";
                SupplierID.DataBind();
            }
            else
            {
                SupplierID.DataBind();
            }
        }
Beispiel #9
0
        internal override bool isValid()
        {
            int requiredFilterCount = SupplierID.NullSafeLength() +
                                      LeadTime1.NullSafeLength() +
                                      LeadTime2.NullSafeLength() +
                                      SupplierCompany.NullSafeLength() +
                                      SupplierCurrencyCode.NullSafeLength() +
                                      SupplierCity.NullSafeLength() +
                                      SupplierState.NullSafeLength() +
                                      SupplierCountry.NullSafeLength();


            if (requiredFilterCount != 0)
            {
                return(true);
            }

            throw new NetoRequestException("At least one filter is required in the GetSupplier request");
        }
Beispiel #10
0
        /// <summary>
        /// Returns values in the collections.
        /// </summary>
        /// <returns>IEnumerator object</returns>
        public IEnumerator PropertyAndValuesCollection()
        {
            yield return("Product ID: " + ID.ToString());

            yield return("Product Name: " + ProductName);

            yield return("Supplier ID: " + SupplierID.ToString());

            yield return("Category ID: " + CategoryID.ToString());

            yield return("Quantity Per Unit: " + QuantityPerUnit);

            yield return("Unit Price: " + UnitPrice.ToString("c"));

            yield return("Units in Stock: " + UnitsInStock.ToString());

            yield return("Units On Order: " + UnitsOnOrder.ToString());

            yield return("ReOrder Level: " + ReOrderLevel.ToString());
        }
Beispiel #11
0
 public void Dispose()
 {
     _AllList.Remove(this);
     _AllByPrimaryKey.Remove(SupplierID.ToString());
 }
Beispiel #12
0
 public override string ToString()
 {
     return(string.Concat(ProductId.ToString(), " ", Description, " ", Quantity.ToString(), SupplierID.ToString()));
 }
Beispiel #13
0
        protected void lvPRMSupplier_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 SupplierID;

            Int64.TryParse(e.CommandArgument.ToString(), out SupplierID);

            if (SupplierID > 0)
            {
                if (string.Equals(e.CommandName, "EditItem"))
                {
                    _SupplierID = SupplierID;

                    PrepareEditView();

                    cpeEditor.Collapsed   = false;
                    cpeEditor.ClientState = "false";
                }
                else if (string.Equals(e.CommandName, "DeleteItem"))
                {
                    try
                    {
                        Int64 result = -1;

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(PRMSupplierEntity.FLD_NAME_SupplierID, SupplierID.ToString(), SQLMatchType.Equal);

                        PRMSupplierEntity pRMSupplierEntity = new PRMSupplierEntity();


                        result = FCCPRMSupplier.GetFacadeCreate().Delete(pRMSupplierEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _SupplierID        = 0;
                            _PRMSupplierEntity = new PRMSupplierEntity();
                            PrepareInitialView();
                            BindPRMSupplierList();

                            MiscUtil.ShowMessage(lblMessage, "Vendor has been successfully deleted.", true);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to delete Vendor.", true);
                        }
                    }
                    catch (Exception ex)
                    {
                        MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                    }
                }
            }
        }
        private Boolean ValidateInput()
        {
            Boolean validationResult = true;

            String fe  = String.Empty;
            String fe1 = SqlExpressionBuilder.PrepareFilterExpression(PRMSupplierItemMapEntity.FLD_NAME_ItemID, treeBrandItemMap.SelectedValue.ToString(), SQLMatchType.Equal);
            String fe2 = SqlExpressionBuilder.PrepareFilterExpression(PRMSupplierItemMapEntity.FLD_NAME_BrandID, treeBrandItemMap.SelectedNode.Parent.Value.ToString(), SQLMatchType.Equal);

            fe = SqlExpressionBuilder.PrepareFilterExpression(fe1, SQLJoinType.AND, fe2);

            String feSupplier = SqlExpressionBuilder.PrepareFilterExpression(PRMSupplierItemMapEntity.FLD_NAME_SupplierID, SupplierID.ToString(), SQLMatchType.Equal);

            fe = SqlExpressionBuilder.PrepareFilterExpression(fe, SQLJoinType.AND, feSupplier);
            if (ddlOriginRegionID.SelectedValue != "0")
            {
                String fe3 = SqlExpressionBuilder.PrepareFilterExpression(PRMSupplierItemMapEntity.FLD_NAME_OriginRegionID, ddlOriginRegionID.SelectedValue.ToString(), SQLMatchType.Equal);
                fe = SqlExpressionBuilder.PrepareFilterExpression(fe, SQLJoinType.AND, fe3);
            }

            if (ddlOriginCountryID.SelectedValue != "0")
            {
                String fe4 = SqlExpressionBuilder.PrepareFilterExpression(PRMSupplierItemMapEntity.FLD_NAME_OriginCountryID, ddlOriginCountryID.SelectedValue.ToString(), SQLMatchType.Equal);
                fe = SqlExpressionBuilder.PrepareFilterExpression(fe, SQLJoinType.AND, fe4);
            }

            IList <PRMSupplierItemMapEntity> supplierItemMapList = FCCPRMSupplierItemMap.GetFacadeCreate().GetIL(null, null, String.Empty, fe, DatabaseOperationType.LoadWithFilterExpression);

            if (supplierItemMapList != null && supplierItemMapList.Count > 0)
            {
                MiscUtil.ShowMessage(lblMessage, "Already entered the Item Price.", true);
                validationResult = false;
            }

            return(validationResult);
        }
        protected void odsPRMSupplierItemMap_Selecting(object sender, ObjectDataSourceSelectingEventArgs e)
        {
            String fe = String.Empty;

            if (ddlSupplierID.SelectedValue != "0")
            {
                fe = SqlExpressionBuilder.PrepareFilterExpression("PRMSupplierItemMap." + PRMSupplierItemMapEntity.FLD_NAME_SupplierID, SupplierID.ToString(), SQLMatchType.Equal);
            }

            e.InputParameters["filterExpression"] = fe;
        }
Beispiel #16
0
        public bool Save(int userID, int employeeID, int bussinessID, IEnumerable <int> tags = null, IEnumerable <ProductQuantity> quantities = null)
        {
            QueryOutput queryResult;
            var         query = "";

            Result = false;
            var id = ID.ToString();

            if (ID > 0)
            {
                query += String.Format(@"update Product 
                                            set Code = N'{0}', Name = N'{1}', Price = {2}, Image = N'{3}',
                                            MadeIn = N'{4}', Description = N'{5}', OriginalWarranty = N'{6}',
                                            BussinessWarranty = N'{7}', SupplierID = {8}, Unit = N'{9}', Point = {10}, Specs = N'{11}',
                                            Type = N'{13}', Engine = N'{14}', Gender = N'{15}', MirrorType = N'{16}', TrapMaterial = N'{17}', CaseMaterial = N'{18}', CaseType = N'{19}',
                                            FrontColor = N'{20}', CaseWidth = N'{21}', TrapSize = N'{22}', Diameter = N'{23}', WaterResistance = N'{24}', Functions = N'{25}', Style = N'{26}'
                                            where ID = {12}",
                                       new object[] {
                    Code, Name.Replace("'", ""), Price, Image, MadeIn, Description, OriginalWarranty, BussinessWarranty, SupplierID.DbValue(), Unit, Point, Specs, ID,
                    Type, Engine, Gender, MirrorType, TrapMaterial, CaseMaterial, CaseType, FrontColor, CaseWidth, TrapSize, Diameter, WaterResistance, Functions, Style
                });
                Result = Execute(new DbQuery(userID, employeeID, DbAction.Product.Modify, query, true, id, "Name"), out queryResult);
            }
            else
            {
                query += String.Format(@"declare @ID table (ID int) declare @productID int
                                            insert Product(Code, Name, Price, Image, MadeIn, Description, OriginalWarranty, BussinessWarranty, SupplierID, Unit, Point, BussinessID, Specs, Status,
                                                Type, Engine, Gender, MirrorType, TrapMaterial, CaseMaterial, CaseType, FrontColor, CaseWidth, TrapSize, Diameter, WaterResistance, Functions, Style) 
                                            output inserted.ID into @ID
                                            values (N'{0}', N'{1}', {2}, N'{3}', N'{4}', N'{5}', N'{6}', N'{7}', {8}, N'{9}', {10}, {11}, N'{12}', 'active',
                                                N'{13}', N'{14}', N'{15}', N'{16}', N'{17}', N'{18}', N'{19}', N'{20}', N'{21}', N'{22}', N'{23}', N'{24}', N'{25}', N'{26}')
                                            set @productID = (select top 1 ID from @ID)",
                                       new object[] {
                    Code, Name.Replace("'", ""), Price, Image, MadeIn, Description, OriginalWarranty, BussinessWarranty, SupplierID.DbValue(), Unit, Point, bussinessID, Specs,
                    Type, Engine, Gender, MirrorType, TrapMaterial, CaseMaterial, CaseType, FrontColor, CaseWidth, TrapSize, Diameter, WaterResistance, Functions, Style
                });
                if (tags != null)
                {
                    query += String.Format(" insert into ProductTag(ProductID, TagID) values {0}", String.Join(",", tags.Select(i => String.Format("(@productID, {0})", i))));
                }
                if (quantities != null)
                {
                    query += " " + String.Join(" ", quantities.Select(q => String.Format(
                                                                          @"if ((select top 1 ID from ProductQuantity where ProductID = @productID and WarehouseID = {0}) is null)
                                begin
                                insert into ProductQuantity(ProductID, WarehouseID, Quantity) values(@productID, {0}, {1})
                                end
                                else
                                begin
                                update ProductQuantity set Quantity = {1} where ProductID = @productID and WarehouseID = {0}
                                end", q.WarehouseID, q.Quantity)));
                }
                query += " select @productID";
                id     = "@productID";
                ID     = Query <int>(new DbQuery(userID, employeeID, DbAction.Product.Create, query, true, id, "Name"), out queryResult).FirstOrDefault();
                Result = true;
            }
            return(Result);
        }
Beispiel #17
0
        protected void lvPRMSupplier_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 SupplierID;

            Int64.TryParse(e.CommandArgument.ToString(), out SupplierID);

            if (SupplierID > 0)
            {
                if (string.Equals(e.CommandName, "EditItem"))
                {
                }
                else if (string.Equals(e.CommandName, "DeleteItem"))
                {
                    try
                    {
                        Int64 result = -1;

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(PRMSupplierEntity.FLD_NAME_SupplierID, SupplierID.ToString(), SQLMatchType.Equal);

                        PRMSupplierEntity pRMSupplierEntity = new PRMSupplierEntity();


                        result = FCCPRMSupplier.GetFacadeCreate().Delete(pRMSupplierEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                        }
                        else
                        {
                        }
                    }
                    catch (Exception ex)
                    {
                    }
                }
            }
        }