Exemplo n.º 1
0
        public void ResizeProductLabel()
        {
            var   Length       = ProductUnitPrice.ToString().Length;
            Size  cardSize     = card_PriceBG.Size;
            Point cardLocation = card_PriceBG.Location;

            if (Length >= 3)
            {
                //LongLabel
                cardSize     = new Size(77, 29);
                cardLocation = new Point(99, 10);
            }
            else if (Length == 2)
            {
                //ShortLabel
                cardSize     = new Size(60, 29);
                cardLocation = new Point(116, 10);
            }
            else if (Length < 2)
            {
                //NormalLabel
                cardSize     = new Size(37, 29);
                cardLocation = new Point(139, 10);
            }

            card_PriceBG.Size     = cardSize;
            card_PriceBG.Location = cardLocation;
        }
        public static bool Update(ProductUnitPrice objProductUnitPrice)
        {
            ISalesPOSDBManager dbManager = new SalesPOSDBManager();
            Boolean            chk       = false;

            try
            {
                dbManager.Open();
                IDbDataParameter[] param = SalesPOSDBManagerFactory.GetParameters(dbManager.ProviderType, 9);
                param[0] = dbManager.getparam("@PSPID", objProductUnitPrice.PSPID);
                param[1] = dbManager.getparam("@ProductID", objProductUnitPrice.ProductID);
                param[2] = dbManager.getparam("@UnitID", objProductUnitPrice.UnitID);
                param[3] = dbManager.getparam("@UnitQty", objProductUnitPrice.UnitQty);
                param[4] = dbManager.getparam("@Price", objProductUnitPrice.Price);
                param[5] = dbManager.getparam("@ActivityID", objProductUnitPrice.ActivityID);
                param[6] = dbManager.getparam("@IsMinimumUnit", objProductUnitPrice.IsMinimumUnit);
                param[7] = dbManager.getparam("@UpdatedBy", objProductUnitPrice.UpdatedBy);
                param[8] = dbManager.getparam("@WholeSalePrice", objProductUnitPrice.WholeSalePrice);

                IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "dbo.USP_ProductSalesPrice_Update", param);
                chk = dbManager.ExecuteQuery(cmd);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
                return(false);
            }
            finally
            {
                dbManager.Dispose();
            }
            return(chk);
        }
Exemplo n.º 3
0
        public static bool UpdateIsMinimumUnitFalse(ProductUnitPrice objProductUnitPrice)
        {
            ISalesPOSDBManager dbManager = new SalesPOSDBManager();
            Boolean            chk       = false;

            try
            {
                dbManager.Open();
                IDbDataParameter[] param = SalesPOSDBManagerFactory.GetParameters(dbManager.ProviderType, 2);
                param[0] = dbManager.getparam("@ProductID", objProductUnitPrice.ProductID);
                param[1] = dbManager.getparam("@UpdatedBy", objProductUnitPrice.UpdatedBy);

                IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "dbo.USP_updateIsMinimumUnitFalse", param);
                chk = dbManager.ExecuteQuery(cmd);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
                return(false);
            }
            finally
            {
                dbManager.Dispose();
            }
            return(chk);
        }
        public static DataTable Insert(ProductUnitPrice objProductUnitPrice)
        {
            ISalesPOSDBManager dbManager = new SalesPOSDBManager();
            DataTable          dt        = new DataTable();

            try
            {
                dbManager.Open();
                IDbDataParameter[] param = SalesPOSDBManagerFactory.GetParameters(dbManager.ProviderType, 9);

                param[0] = dbManager.getparam("@ProductID", objProductUnitPrice.ProductID);
                param[1] = dbManager.getparam("@UnitID", objProductUnitPrice.UnitID);
                param[2] = dbManager.getparam("@UnitQty", objProductUnitPrice.UnitQty);
                param[3] = dbManager.getparam("@Price", objProductUnitPrice.Price);
                param[4] = dbManager.getparam("@ActivityID", objProductUnitPrice.ActivityID);
                param[5] = dbManager.getparam("@IsMinimumUnit", objProductUnitPrice.IsMinimumUnit);
                param[6] = dbManager.getparam("@CreatedBy", objProductUnitPrice.CreatedBy);
                param[7] = dbManager.getparam("@pk_code", "");
                param[8] = dbManager.getparam("@WholeSalePrice", objProductUnitPrice.WholeSalePrice);

                IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "dbo.USP_ProductSalesPrice_Add", param);
                dt = dbManager.GetDataTable(cmd);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
                //return false;
            }
            finally
            {
                dbManager.Dispose();
            }
            return(dt);
        }