Exemplo n.º 1
0
 public List <object> SelectAll(object[] obj)
 {
     using (EFContext Context = new EFContext())
     {
         string str       = obj[0].ToString();
         int    PageIndex = IsNumber.IsNum(obj[1].ToString()) ? int.Parse(obj[1].ToString()) : 1;
         int    PageSize  = IsNumber.IsNum(obj[2].ToString()) ? int.Parse(obj[3].ToString()) : 10;
         var    list      = (from a in Context.Courier
                             join b in Context.OrderInfo
                             on a.OID equals b.OrderId
                             orderby a.CourierId descending
                             select new
         {
             CourierId = a.CourierId,
             CourierNum = a.CourierNum,
             OrderId = b.OrderId,
             OTGName = b.OTGName,
             OTGPhone = b.OTGPhone,
             OTGAddress = b.OTGAddress,
             OrderNum = b.OrderNum,
             BuyGoodsAndSum = b.BuyGoodsAndSum
         }).Where(m => str == "" ? true : m.CourierNum == str || m.OTGName == str || m.OTGPhone == str || m.OTGAddress.Contains(str) || m.OrderNum == str || m.BuyGoodsAndSum.Contains(str)).Skip((PageIndex - 1) * PageSize).Take(PageSize).ToList();
         List <object> olist = new List <object>();
         foreach (var item in list)
         {
             olist.Add(item);
         }
         return(olist);
     }
 }
Exemplo n.º 2
0
        private void Button_build(object sender, RoutedEventArgs e)
        {
            IsNumber Isnumber = new IsNumber();

            if (name.Text.Length != 0 && buildCost.Text.Length != 0 && recoveryN.Text.Length != 0 && operatingCost.Text.Length != 0 && oilCost.Text.Length != 0 && electricityCost.Text.Length != 0)
            {
                if (Isnumber.isNumber(buildCost.Text.Trim()) == false || Isnumber.isNumber(recoveryN.Text.Trim()) == false || Isnumber.isNumber(operatingCost.Text.Trim()) == false || Isnumber.isNumber(oilCost.Text.Trim()) == false || Isnumber.isNumber(electricityCost.Text.Trim()) == false)
                {
                    MessageBox.Show("输入格式有误");
                }
                else
                {
                    OtherDAL dal = new OtherDAL();
                    dal.delOtherData(id);
                    Other other = new Other(id, name.Text, buildCost.Text, recoveryN.Text, operatingCost.Text, oilCost.Text, electricityCost.Text);
                    dal.addOtherData(other);
                    MessageBox.Show("修改成功");
                    Close();
                    return;
                }
            }
            else
            {
                MessageBox.Show("请确保没有空白项");
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// 查询所有商品
        /// </summary>
        /// <returns></returns>
        public List <object> SelectAll(object[] obj)
        {
            string str       = obj[0].ToString();
            int    IndexPage = IsNumber.IsNum(obj[1].ToString()) ? int.Parse(obj[1].ToString()) : 1;
            int    IndexSize = IsNumber.IsNum(obj[2].ToString()) ? int.Parse(obj[2].ToString()) : 10;
            int    state     = IsNumber.IsNum(obj[3].ToString()) ? int.Parse(obj[3].ToString()) : 1;

            using (EFContext Context = new EFContext())
            {
                var goods = (from s in Context.GoodsInfo
                             join b in Context.GoodType
                             on s.GTID equals b.GoodTypeId
                             orderby s.GoodId descending
                             where s.GoodState.Equals(state)
                             select new
                {
                    s.GoodId,
                    s.GoodPhotoPath,
                    s.GoodName,
                    s.GoodInfo,
                    s.GoodSellSum,
                    s.GoodSum,
                    s.GoodPrice,
                    b.GoodTypeName,
                    s.GoodState,
                    href = "/detail/" + s.GoodId
                }).Where(m => str == "" ? true : m.GoodName.Contains(str) || m.GoodInfo.Contains(str) || m.GoodTypeName == str).Skip((IndexPage - 1) * IndexSize).Take(IndexSize).ToList();
                List <object> data = new List <object>();
                foreach (var item in goods)
                {
                    data.Add(item);
                }
                return(data);
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// 返回所有用户信息
        /// </summary>
        /// <param name="obj">参数数组(string 查询关键字,int 页码,int 记录数 )</param>
        /// <returns></returns>
        public List <object> SelectAll(object[] obj)
        {
            string str       = obj[0].ToString();
            int    PageIndex = IsNumber.IsNum(obj[1].ToString()) ? int.Parse(obj[1].ToString()) : 1;
            int    PageSize  = IsNumber.IsNum(obj[2].ToString()) ? int.Parse(obj[2].ToString()) : 10;

            using (EFContext Context = new EFContext())
            {
                var users = (from s in Context.UserInfo
                             join b in Context.TakeGoodsInfo
                             on s.UserId equals b.UID into joinleft
                             from b in joinleft.DefaultIfEmpty()
                             orderby s.UserId descending
                             select new
                {
                    UserAccount = s.UserAccount,
                    PhotoPath = s.PhotoPath,
                    UserName = s.UserName,
                    PhoneNumber = s.PhoneNumber,
                    Email = s.Email,
                    TGName = b.TGName,
                    TGAddress = b.TGAddress,
                    TGPhone = b.TGPhone
                }).Where(m => str == "" ? true : m.UserAccount == str || m.UserName == str || m.PhoneNumber == str || m.Email == str || m.TGName == str || m.TGPhone == str || m.TGAddress.Contains(str)).Skip((PageIndex - 1) * PageSize).Take(PageSize).ToList();
                List <object> data = new List <object>();
                foreach (var item in users)
                {
                    data.Add(item);
                }
                return(data);
            }
        }
Exemplo n.º 5
0
        public void FirstTry_Space_And_Decimal_Point()
        {
            string myString = " .";

            bool result = new IsNumber().FirstTry(myString);

            Assert.False(result);
        }
Exemplo n.º 6
0
        public void FirstTry_A_Negative_Number_With_Exponent_And_Spaces()
        {
            string myString = " -90e3   ";

            bool result = new IsNumber().FirstTry(myString);

            Assert.True(result);
        }
Exemplo n.º 7
0
        public void FirstTry_Only_Letters()
        {
            string myString = "abc";

            bool result = new IsNumber().FirstTry(myString);

            Assert.False(result);
        }
Exemplo n.º 8
0
        public void FirstTry_A_Correct_Exponent()
        {
            string myString = "2e0";

            bool result = new IsNumber().FirstTry(myString);

            Assert.True(result);
        }
Exemplo n.º 9
0
        public void FirstTry_Space_And_Decimal_Inside()
        {
            string myString = " 0.1 ";

            bool result = new IsNumber().FirstTry(myString);

            Assert.True(result);
        }
Exemplo n.º 10
0
        public void FirstTry_Two_Negative_Signs()
        {
            string myString = "-+3";

            bool result = new IsNumber().FirstTry(myString);

            Assert.False(result);
        }
Exemplo n.º 11
0
        public void FirstTry_Incorrect_Number()
        {
            string myString = "95a54e53";

            bool result = new IsNumber().FirstTry(myString);

            Assert.False(result);
        }
Exemplo n.º 12
0
        public void FirstTry_A_Number_With_Incorrect_Exponent_And_Spaces()
        {
            string myString = " 99e2.5 ";

            bool result = new IsNumber().FirstTry(myString);

            Assert.False(result);
        }
Exemplo n.º 13
0
        public void FirstTry_A_Number_Exponent()
        {
            string myString = "53.5e93";

            bool result = new IsNumber().FirstTry(myString);

            Assert.True(result);
        }
Exemplo n.º 14
0
        public void FirstTry_An_Incorrect_Exponent()
        {
            string myString = "e3";

            bool result = new IsNumber().FirstTry(myString);

            Assert.False(result);
        }
Exemplo n.º 15
0
        public void IsNumberShouldReturnfalseWhenArgIsNonNumeric()
        {
            var func   = new IsNumber();
            var args   = FunctionsHelper.CreateArgs("1");
            var result = func.Execute(args, _context);

            Assert.IsFalse((bool)result.Result);
        }
Exemplo n.º 16
0
        public void FirstTry_Single_Zero()
        {
            string myString = "0";

            bool result = new IsNumber().FirstTry(myString);

            Assert.True(result);
        }
Exemplo n.º 17
0
        public void FirstTry_A_Number_And_a_Letter()
        {
            string myString = "1 a";

            bool result = new IsNumber().FirstTry(myString);

            Assert.False(result);
        }
Exemplo n.º 18
0
        public void IsNumberWithInvalidArgumentReturnsPoundValue()
        {
            var func           = new IsNumber();
            var parsingContext = ParsingContext.Create();
            var args           = FunctionsHelper.CreateArgs();
            var result         = func.Execute(args, parsingContext);

            Assert.AreEqual(eErrorType.Value, ((ExcelErrorValue)result.Result).Type);
        }
    protected void Button1_Click(object sender, EventArgs e)
    {
        bool         kt      = true;
        bool         test    = true;
        IsNumber     n       = new IsNumber();
        Button       mua     = ((Button)sender);
        string       mahoa   = mua.CommandArgument.ToString();
        DataListItem item    = (DataListItem)mua.Parent;
        string       soluong = ((TextBox)item.FindControl("TextBox1")).Text;

        test = n.Isnumber(soluong);
        if (test == false)
        {
            kt = false;
        }
        else
        {
            if (Convert.ToDouble(soluong) < 1)
            {
                kt = false;
            }
        }
        string dongia = ((Label)item.FindControl("Label3")).Text;
        string tenhoa = ((Label)item.FindControl("Label1")).Text;
        bool   tim    = false;

        dt = (DataTable)Session["giohang"];
        if (dt == null)
        {
            TaoGio();
        }

        foreach (DataRow dataRow in dt.Rows)
        {
            if (dataRow["mahoa"].ToString() == mahoa)
            {
                dataRow["soluong"] = Convert.ToInt32(dataRow["soluong"]) + Convert.ToInt32(soluong);
                tim = true;
                break;
            }
        }

        if (!tim && kt == true)
        {
            DataRow dataRow = dt.NewRow();
            dataRow["mahoa"]   = mahoa;
            dataRow["tenhoa"]  = tenhoa;
            dataRow["soluong"] = soluong;
            dataRow["dongia"]  = dongia;
            dt.Rows.Add(dataRow);
        }
        Session["giohang"] = dt;
    }
Exemplo n.º 20
0
        public override int GetHashCode()
        {
            var hashCode = -2090149594;

            hashCode = hashCode * -1521134295 + Op.GetHashCode();
            hashCode = hashCode * -1521134295 + IsOp.GetHashCode();
            hashCode = hashCode * -1521134295 + EqualityComparer <byte[]> .Default.GetHashCode(Data);

            hashCode = hashCode * -1521134295 + IsData.GetHashCode();
            hashCode = hashCode * -1521134295 + Number.GetHashCode();
            hashCode = hashCode * -1521134295 + IsNumber.GetHashCode();
            return(hashCode);
        }
Exemplo n.º 21
0
        private void Button_build(object sender, RoutedEventArgs e)
        {
            IsNumber Isnumber = new IsNumber();
            Pump     pump     = new Pump(name.Text, id, head.Text, displacement.Text, power.Text, suctionPressure.Text, runTime.Text, inPressure.Text, outPressure.Text);

            if (Isnumber.isNumber(head.Text.Trim()) == false || Isnumber.isNumber(displacement.Text.Trim()) == false || Isnumber.isNumber(power.Text.Trim()) == false || Isnumber.isNumber(suctionPressure.Text.Trim()) == false || Isnumber.isNumber(runTime.Text.Trim()) == false || Isnumber.isNumber(inPressure.Text.Trim()) == false || Isnumber.isNumber(outPressure.Text.Trim()) == false)
            {
                MessageBox.Show("输入格式有误");
            }
            else
            {
                PumpDAL pumpdal = new PumpDAL();
                pumpdal.addPumpData(pump);
                MessageBox.Show("添加成功");
                Close();
            }
        }
Exemplo n.º 22
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            Pipe     pipe     = new Pipe(proid, pipeid, start_spot.Text, end_spot.Text, pipe_name.Text, pipe_length.Text, pipe_outer_diameter.Text, wall_thickness.Text, pipe_depth.Text, transport_medium.Text, insulation_materials.Text, tank_type_a.Text, tank_type_b.Text, tank_capacity_a.Text, tank_capacity_b.Text, maximum_pressure.Text);
            IsNumber Isnumber = new IsNumber();

            if (Isnumber.isNumber(pipe_length.Text.Trim()) == false || Isnumber.isNumber(pipe_outer_diameter.Text.Trim()) == false || Isnumber.isNumber(wall_thickness.Text.Trim()) == false || Isnumber.isNumber(pipe_depth.Text.Trim()) == false || Isnumber.isNumber(tank_capacity_a.Text.Trim()) == false || Isnumber.isNumber(tank_capacity_b.Text.Trim()) == false || Isnumber.isNumber(maximum_pressure.Text.Trim()) == false)
            {
                MessageBox.Show("输格式入有误");
            }
            else
            {
                PipeDAL pipeDAL = new PipeDAL();
                pipeDAL.addPipeData(pipe);
                MessageBox.Show("添加成功");
                Close();
            }
        }
Exemplo n.º 23
0
        private void Button_build(object sender, RoutedEventArgs e)
        {
            Oils     oils     = new Oils(id, name.Text, density.Text, viscosity.Text, masFlow.Text, outputByYear.Text, volume_concentration.Text);
            IsNumber Isnumber = new IsNumber();

            if (Isnumber.isNumber(density.Text.Trim()) == false || Isnumber.isNumber(viscosity.Text.Trim()) == false || Isnumber.isNumber(masFlow.Text.Trim()) == false || Isnumber.isNumber(outputByYear.Text.Trim()) == false || Isnumber.isNumber(volume_concentration.Text.Trim()) == false)
            {
                MessageBox.Show("输入格式有误");
            }
            else
            {
                OilsDAL oilsdal = new OilsDAL();
                oilsdal.addOilsData(oils);
                MessageBox.Show("添加成功");
                Close();
            }
        }
Exemplo n.º 24
0
        private void Button_build(object sender, RoutedEventArgs e)
        {
            IsNumber Isnumber = new IsNumber();

            Soil soil = new Soil(id, soilName.Text, soilTemp.Text, soilDiff.Text);

            if (Isnumber.isNumber(soilTemp.Text.Trim()) == false || Isnumber.isNumber(soilDiff.Text.Trim()) == false)
            {
                MessageBox.Show("输入格式有误");
            }
            else
            {
                SoilDAL dal = new SoilDAL();
                dal.addSoilData(soil);
                MessageBox.Show("添加成功");
                Close();
            }
        }
Exemplo n.º 25
0
 public List <object> SelectAll(object[] obj)
 {
     using (EFContext Context = new EFContext())
     {
         string str       = obj[0].ToString();
         int    IndexPage = IsNumber.IsNum(obj[1].ToString()) ? int.Parse(obj[1].ToString()) : 1;
         int    IndexSize = IsNumber.IsNum(obj[2].ToString()) ? int.Parse(obj[2].ToString()) : 10;
         int    state     = IsNumber.IsNum(obj[3].ToString()) ? int.Parse(obj[3].ToString()) : 1;
         var    list      = (from a in Context.OrderInfo
                             orderby a.OrderId descending
                             select a).Where(m => str == "" ? true : m.OTGAddress.Contains(str) || m.BuyGoodsAndSum.Contains(str) || m.OrderNum == str || m.OTGPhone == str).Where(m => m.OrderState == state).ToList();
         List <object> data = new List <object>();
         foreach (var item in list)
         {
             data.Add(item);
         }
         return(data);
     }
 }
Exemplo n.º 26
0
        public static Boolean IDVal(string eID)
        {
            if (eID.Length == 3)
            {
                string fID = eID.Substring(0);
                string sID = eID.Substring(1);
                string tID = eID.Substring(2);

                if (IsLetter.IsMatch(fID))
                {
                    if (IsNumber.IsMatch(sID))
                    {
                        if (IsNumber.IsMatch(tID))
                        {
                            return(true);
                        }
                        else
                        {
                            return(false);
                        }
                    }
                    else
                    {
                        return(false);
                    }
                }
                else
                {
                    return(false);
                }
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 27
0
 public BuiltInFunctions()
 {
     // Text
     Functions["text"]        = new CStr();
     Functions["len"]         = new Len();
     Functions["lower"]       = new Lower();
     Functions["upper"]       = new Upper();
     Functions["left"]        = new Left();
     Functions["right"]       = new Right();
     Functions["mid"]         = new Mid();
     Functions["replace"]     = new Replace();
     Functions["substitute"]  = new Substitute();
     Functions["concatenate"] = new Concatenate();
     // Numbers
     Functions["int"] = new CInt();
     // Math
     Functions["cos"]         = new Cos();
     Functions["cosh"]        = new Cosh();
     Functions["power"]       = new Power();
     Functions["sqrt"]        = new Sqrt();
     Functions["sqrtpi"]      = new SqrtPi();
     Functions["pi"]          = new Pi();
     Functions["product"]     = new Product();
     Functions["ceiling"]     = new Ceiling();
     Functions["count"]       = new Count();
     Functions["counta"]      = new CountA();
     Functions["floor"]       = new Floor();
     Functions["sin"]         = new Sin();
     Functions["sinh"]        = new Sinh();
     Functions["sum"]         = new Sum();
     Functions["sumif"]       = new SumIf();
     Functions["stdev"]       = new Stdev();
     Functions["stdevp"]      = new StdevP();
     Functions["subtotal"]    = new Subtotal();
     Functions["exp"]         = new Exp();
     Functions["log"]         = new Log();
     Functions["log10"]       = new Log10();
     Functions["max"]         = new Max();
     Functions["maxa"]        = new Maxa();
     Functions["min"]         = new Min();
     Functions["mod"]         = new Mod();
     Functions["average"]     = new Average();
     Functions["round"]       = new Round();
     Functions["rand"]        = new Rand();
     Functions["randbetween"] = new RandBetween();
     Functions["tan"]         = new Tan();
     Functions["tanh"]        = new Tanh();
     Functions["var"]         = new Var();
     Functions["varp"]        = new VarP();
     // Information
     Functions["isblank"]  = new IsBlank();
     Functions["isnumber"] = new IsNumber();
     Functions["istext"]   = new IsText();
     Functions["iserror"]  = new IsError();
     // Logical
     Functions["if"]   = new If();
     Functions["not"]  = new Not();
     Functions["and"]  = new And();
     Functions["or"]   = new Or();
     Functions["true"] = new True();
     // Reference and lookup
     Functions["address"] = new Address();
     Functions["hlookup"] = new HLookup();
     Functions["vlookup"] = new VLookup();
     Functions["lookup"]  = new Lookup();
     Functions["match"]   = new Match();
     Functions["row"]     = new Row();
     Functions["rows"]    = new Rows();
     Functions["column"]  = new Column();
     Functions["columns"] = new Columns();
     Functions["choose"]  = new Choose();
     // Date
     Functions["date"]   = new Date();
     Functions["today"]  = new Today();
     Functions["now"]    = new Now();
     Functions["day"]    = new Day();
     Functions["month"]  = new Month();
     Functions["year"]   = new Year();
     Functions["time"]   = new Time();
     Functions["hour"]   = new Hour();
     Functions["minute"] = new Minute();
     Functions["second"] = new Second();
 }
Exemplo n.º 28
0
 public BuiltInFunctions()
 {
     // Text
     Functions["len"]         = new Len();
     Functions["lower"]       = new Lower();
     Functions["upper"]       = new Upper();
     Functions["left"]        = new Left();
     Functions["right"]       = new Right();
     Functions["mid"]         = new Mid();
     Functions["replace"]     = new Replace();
     Functions["rept"]        = new Rept();
     Functions["substitute"]  = new Substitute();
     Functions["concatenate"] = new Concatenate();
     Functions["char"]        = new CharFunction();
     Functions["exact"]       = new Exact();
     Functions["find"]        = new Find();
     Functions["fixed"]       = new Fixed();
     Functions["proper"]      = new Proper();
     Functions["search"]      = new Search();
     Functions["text"]        = new Text.Text();
     Functions["t"]           = new T();
     Functions["hyperlink"]   = new Hyperlink();
     Functions["value"]       = new Value();
     // Numbers
     Functions["int"] = new CInt();
     // Math
     Functions["abs"]         = new Abs();
     Functions["asin"]        = new Asin();
     Functions["asinh"]       = new Asinh();
     Functions["cos"]         = new Cos();
     Functions["cosh"]        = new Cosh();
     Functions["power"]       = new Power();
     Functions["sign"]        = new Sign();
     Functions["sqrt"]        = new Sqrt();
     Functions["sqrtpi"]      = new SqrtPi();
     Functions["pi"]          = new Pi();
     Functions["product"]     = new Product();
     Functions["ceiling"]     = new Ceiling();
     Functions["count"]       = new Count();
     Functions["counta"]      = new CountA();
     Functions["countblank"]  = new CountBlank();
     Functions["countif"]     = new CountIf();
     Functions["countifs"]    = new CountIfs();
     Functions["fact"]        = new Fact();
     Functions["floor"]       = new Floor();
     Functions["sin"]         = new Sin();
     Functions["sinh"]        = new Sinh();
     Functions["sum"]         = new Sum();
     Functions["sumif"]       = new SumIf();
     Functions["sumifs"]      = new SumIfs();
     Functions["sumproduct"]  = new SumProduct();
     Functions["sumsq"]       = new Sumsq();
     Functions["stdev"]       = new Stdev();
     Functions["stdevp"]      = new StdevP();
     Functions["stdev.s"]     = new Stdev();
     Functions["stdev.p"]     = new StdevP();
     Functions["subtotal"]    = new Subtotal();
     Functions["exp"]         = new Exp();
     Functions["log"]         = new Log();
     Functions["log10"]       = new Log10();
     Functions["ln"]          = new Ln();
     Functions["max"]         = new Max();
     Functions["maxa"]        = new Maxa();
     Functions["median"]      = new Median();
     Functions["min"]         = new Min();
     Functions["mina"]        = new Mina();
     Functions["mod"]         = new Mod();
     Functions["average"]     = new Average();
     Functions["averagea"]    = new AverageA();
     Functions["averageif"]   = new AverageIf();
     Functions["averageifs"]  = new AverageIfs();
     Functions["round"]       = new Round();
     Functions["rounddown"]   = new Rounddown();
     Functions["roundup"]     = new Roundup();
     Functions["rand"]        = new Rand();
     Functions["randbetween"] = new RandBetween();
     Functions["rank"]        = new Rank();
     Functions["rank.eq"]     = new Rank();
     Functions["rank.avg"]    = new Rank(true);
     Functions["quotient"]    = new Quotient();
     Functions["trunc"]       = new Trunc();
     Functions["tan"]         = new Tan();
     Functions["tanh"]        = new Tanh();
     Functions["atan"]        = new Atan();
     Functions["atan2"]       = new Atan2();
     Functions["atanh"]       = new Atanh();
     Functions["acos"]        = new Acos();
     Functions["acosh"]       = new Acosh();
     Functions["var"]         = new Var();
     Functions["varp"]        = new VarP();
     Functions["large"]       = new Large();
     Functions["small"]       = new Small();
     Functions["degrees"]     = new Degrees();
     // Information
     Functions["isblank"]    = new IsBlank();
     Functions["isnumber"]   = new IsNumber();
     Functions["istext"]     = new IsText();
     Functions["isnontext"]  = new IsNonText();
     Functions["iserror"]    = new IsError();
     Functions["iserr"]      = new IsErr();
     Functions["error.type"] = new ErrorType();
     Functions["iseven"]     = new IsEven();
     Functions["isodd"]      = new IsOdd();
     Functions["islogical"]  = new IsLogical();
     Functions["isna"]       = new IsNa();
     Functions["na"]         = new Na();
     Functions["n"]          = new N();
     // Logical
     Functions["if"]      = new If();
     Functions["iferror"] = new IfError();
     Functions["ifna"]    = new IfNa();
     Functions["not"]     = new Not();
     Functions["and"]     = new And();
     Functions["or"]      = new Or();
     Functions["true"]    = new True();
     Functions["false"]   = new False();
     // Reference and lookup
     Functions["address"]  = new Address();
     Functions["hlookup"]  = new HLookup();
     Functions["vlookup"]  = new VLookup();
     Functions["lookup"]   = new Lookup();
     Functions["match"]    = new Match();
     Functions["row"]      = new Row();
     Functions["rows"]     = new Rows();
     Functions["column"]   = new Column();
     Functions["columns"]  = new Columns();
     Functions["choose"]   = new Choose();
     Functions["index"]    = new RefAndLookup.Index();
     Functions["indirect"] = new Indirect();
     Functions["offset"]   = new Offset();
     // Date
     Functions["date"]             = new Date();
     Functions["today"]            = new Today();
     Functions["now"]              = new Now();
     Functions["day"]              = new Day();
     Functions["month"]            = new Month();
     Functions["year"]             = new Year();
     Functions["time"]             = new Time();
     Functions["hour"]             = new Hour();
     Functions["minute"]           = new Minute();
     Functions["second"]           = new Second();
     Functions["weeknum"]          = new Weeknum();
     Functions["weekday"]          = new Weekday();
     Functions["days360"]          = new Days360();
     Functions["yearfrac"]         = new Yearfrac();
     Functions["edate"]            = new Edate();
     Functions["eomonth"]          = new Eomonth();
     Functions["isoweeknum"]       = new IsoWeekNum();
     Functions["workday"]          = new Workday();
     Functions["networkdays"]      = new Networkdays();
     Functions["networkdays.intl"] = new NetworkdaysIntl();
     Functions["datevalue"]        = new DateValue();
     Functions["timevalue"]        = new TimeValue();
     // Database
     Functions["dget"]     = new Dget();
     Functions["dcount"]   = new Dcount();
     Functions["dcounta"]  = new DcountA();
     Functions["dmax"]     = new Dmax();
     Functions["dmin"]     = new Dmin();
     Functions["dsum"]     = new Dsum();
     Functions["daverage"] = new Daverage();
     Functions["dvar"]     = new Dvar();
     Functions["dvarp"]    = new Dvarp();
     //Finance
     Functions["pmt"] = new Pmt();
 }
Exemplo n.º 29
0
 public BuiltInFunctions()
 {
     // Text
     Functions["len"]         = new Len();
     Functions["lower"]       = new Lower();
     Functions["upper"]       = new Upper();
     Functions["left"]        = new Left();
     Functions["right"]       = new Right();
     Functions["mid"]         = new Mid();
     Functions["replace"]     = new Replace();
     Functions["rept"]        = new Rept();
     Functions["substitute"]  = new Substitute();
     Functions["concatenate"] = new Concatenate();
     Functions["concat"]      = new Concat();
     Functions["textjoin"]    = new Textjoin();
     Functions["char"]        = new CharFunction();
     Functions["exact"]       = new Exact();
     Functions["find"]        = new Find();
     Functions["fixed"]       = new Fixed();
     Functions["proper"]      = new Proper();
     Functions["search"]      = new Search();
     Functions["text"]        = new Text.Text();
     Functions["t"]           = new T();
     Functions["hyperlink"]   = new Hyperlink();
     Functions["value"]       = new Value(CultureInfo.CurrentCulture);
     Functions["trim"]        = new Trim();
     Functions["clean"]       = new Clean();
     Functions["unicode"]     = new Unicode();
     Functions["unichar"]     = new Unichar();
     Functions["numbervalue"] = new NumberValue();
     Functions["dollar"]      = new Dollar();
     // Numbers
     Functions["int"] = new CInt();
     // Math
     Functions["aggregate"]       = new Aggregate();
     Functions["abs"]             = new Abs();
     Functions["asin"]            = new Asin();
     Functions["asinh"]           = new Asinh();
     Functions["acot"]            = new Acot();
     Functions["acoth"]           = new Acoth();
     Functions["cos"]             = new Cos();
     Functions["cot"]             = new Cot();
     Functions["coth"]            = new Coth();
     Functions["cosh"]            = new Cosh();
     Functions["csc"]             = new Csc();
     Functions["csch"]            = new Csch();
     Functions["power"]           = new Power();
     Functions["gcd"]             = new Gcd();
     Functions["lcm"]             = new Lcm();
     Functions["sec"]             = new Sec();
     Functions["sech"]            = new SecH();
     Functions["sign"]            = new Sign();
     Functions["sqrt"]            = new Sqrt();
     Functions["sqrtpi"]          = new SqrtPi();
     Functions["pi"]              = new Pi();
     Functions["product"]         = new Product();
     Functions["ceiling"]         = new Ceiling();
     Functions["ceiling.precise"] = new CeilingPrecise();
     Functions["ceiling.math"]    = new CeilingMath();
     Functions["iso.ceiling"]     = new IsoCeiling();
     Functions["combin"]          = new Combin();
     Functions["combina"]         = new Combina();
     Functions["permut"]          = new Permut();
     Functions["permutationa"]    = new Permutationa();
     Functions["count"]           = new Count();
     Functions["counta"]          = new CountA();
     Functions["countblank"]      = new CountBlank();
     Functions["countif"]         = new CountIf();
     Functions["countifs"]        = new CountIfs();
     Functions["fact"]            = new Fact();
     Functions["factdouble"]      = new FactDouble();
     Functions["floor"]           = new Floor();
     Functions["floor.precise"]   = new FloorPrecise();
     Functions["floor.math"]      = new FloorMath();
     Functions["radians"]         = new Radians();
     Functions["roman"]           = new Roman();
     Functions["sin"]             = new Sin();
     Functions["sinh"]            = new Sinh();
     Functions["sum"]             = new Sum();
     Functions["sumif"]           = new SumIf();
     Functions["sumifs"]          = new SumIfs();
     Functions["sumproduct"]      = new SumProduct();
     Functions["sumsq"]           = new Sumsq();
     Functions["sumxmy2"]         = new Sumxmy2();
     Functions["sumx2my2"]        = new SumX2mY2();
     Functions["sumx2py2"]        = new SumX2pY2();
     Functions["seriessum"]       = new Seriessum();
     Functions["stdev"]           = new Stdev();
     Functions["stdeva"]          = new Stdeva();
     Functions["stdevp"]          = new StdevP();
     Functions["stdevpa"]         = new Stdevpa();
     Functions["stdev.s"]         = new StdevDotS();
     Functions["stdev.p"]         = new StdevDotP();
     Functions["subtotal"]        = new Subtotal();
     Functions["exp"]             = new Exp();
     Functions["log"]             = new Log();
     Functions["log10"]           = new Log10();
     Functions["ln"]              = new Ln();
     Functions["max"]             = new Max();
     Functions["maxa"]            = new Maxa();
     Functions["median"]          = new Median();
     Functions["min"]             = new Min();
     Functions["mina"]            = new Mina();
     Functions["mod"]             = new Mod();
     Functions["mode"]            = new Mode();
     Functions["mode.sngl"]       = new ModeSngl();
     Functions["mround"]          = new Mround();
     Functions["multinomial"]     = new Multinomial();
     Functions["average"]         = new Average();
     Functions["averagea"]        = new AverageA();
     Functions["averageif"]       = new AverageIf();
     Functions["averageifs"]      = new AverageIfs();
     Functions["round"]           = new Round();
     Functions["rounddown"]       = new Rounddown();
     Functions["roundup"]         = new Roundup();
     Functions["rand"]            = new Rand();
     Functions["randbetween"]     = new RandBetween();
     Functions["rank"]            = new Rank();
     Functions["rank.eq"]         = new RankEq();
     Functions["rank.avg"]        = new RankAvg();
     Functions["percentile"]      = new Percentile();
     Functions["percentile.inc"]  = new PercentileInc();
     Functions["percentile.exc"]  = new PercentileExc();
     Functions["quartile"]        = new Quartile();
     Functions["quartile.inc"]    = new QuartileInc();
     Functions["quartile.exc"]    = new QuartileExc();
     Functions["percentrank"]     = new Percentrank();
     Functions["percentrank.inc"] = new PercentrankInc();
     Functions["percentrank.exc"] = new PercentrankExc();
     Functions["quotient"]        = new Quotient();
     Functions["trunc"]           = new Trunc();
     Functions["tan"]             = new Tan();
     Functions["tanh"]            = new Tanh();
     Functions["atan"]            = new Atan();
     Functions["atan2"]           = new Atan2();
     Functions["atanh"]           = new Atanh();
     Functions["acos"]            = new Acos();
     Functions["acosh"]           = new Acosh();
     Functions["covar"]           = new Covar();
     Functions["covariance.p"]    = new CovarianceP();
     Functions["covariance.s"]    = new CovarianceS();
     Functions["var"]             = new Var();
     Functions["vara"]            = new Vara();
     Functions["var.s"]           = new VarDotS();
     Functions["varp"]            = new VarP();
     Functions["varpa"]           = new Varpa();
     Functions["var.p"]           = new VarDotP();
     Functions["large"]           = new Large();
     Functions["small"]           = new Small();
     Functions["degrees"]         = new Degrees();
     Functions["odd"]             = new Odd();
     Functions["even"]            = new Even();
     // Information
     Functions["isblank"]    = new IsBlank();
     Functions["isnumber"]   = new IsNumber();
     Functions["istext"]     = new IsText();
     Functions["isnontext"]  = new IsNonText();
     Functions["iserror"]    = new IsError();
     Functions["iserr"]      = new IsErr();
     Functions["error.type"] = new ErrorType();
     Functions["iseven"]     = new IsEven();
     Functions["isodd"]      = new IsOdd();
     Functions["islogical"]  = new IsLogical();
     Functions["isna"]       = new IsNa();
     Functions["na"]         = new Na();
     Functions["n"]          = new N();
     Functions["type"]       = new TypeFunction();
     // Logical
     Functions["if"]      = new If();
     Functions["ifs"]     = new Ifs();
     Functions["maxifs"]  = new MaxIfs();
     Functions["minifs"]  = new MinIfs();
     Functions["iferror"] = new IfError();
     Functions["ifna"]    = new IfNa();
     Functions["not"]     = new Not();
     Functions["and"]     = new And();
     Functions["or"]      = new Or();
     Functions["true"]    = new True();
     Functions["false"]   = new False();
     Functions["switch"]  = new Switch();
     Functions["xor"]     = new Xor();
     // Reference and lookup
     Functions["address"]  = new Address();
     Functions["hlookup"]  = new HLookup();
     Functions["vlookup"]  = new VLookup();
     Functions["lookup"]   = new Lookup();
     Functions["match"]    = new Match();
     Functions["row"]      = new Row();
     Functions["rows"]     = new Rows();
     Functions["column"]   = new Column();
     Functions["columns"]  = new Columns();
     Functions["choose"]   = new Choose();
     Functions["index"]    = new RefAndLookup.Index();
     Functions["indirect"] = new Indirect();
     Functions["offset"]   = new Offset();
     // Date
     Functions["date"]             = new Date();
     Functions["datedif"]          = new DateDif();
     Functions["today"]            = new Today();
     Functions["now"]              = new Now();
     Functions["day"]              = new Day();
     Functions["month"]            = new Month();
     Functions["year"]             = new Year();
     Functions["time"]             = new Time();
     Functions["hour"]             = new Hour();
     Functions["minute"]           = new Minute();
     Functions["second"]           = new Second();
     Functions["weeknum"]          = new Weeknum();
     Functions["weekday"]          = new Weekday();
     Functions["days"]             = new Days();
     Functions["days360"]          = new Days360();
     Functions["yearfrac"]         = new Yearfrac();
     Functions["edate"]            = new Edate();
     Functions["eomonth"]          = new Eomonth();
     Functions["isoweeknum"]       = new IsoWeekNum();
     Functions["workday"]          = new Workday();
     Functions["workday.intl"]     = new WorkdayIntl();
     Functions["networkdays"]      = new Networkdays();
     Functions["networkdays.intl"] = new NetworkdaysIntl();
     Functions["datevalue"]        = new DateValue();
     Functions["timevalue"]        = new TimeValue();
     // Database
     Functions["dget"]     = new Dget();
     Functions["dcount"]   = new Dcount();
     Functions["dcounta"]  = new DcountA();
     Functions["dmax"]     = new Dmax();
     Functions["dmin"]     = new Dmin();
     Functions["dsum"]     = new Dsum();
     Functions["daverage"] = new Daverage();
     Functions["dvar"]     = new Dvar();
     Functions["dvarp"]    = new Dvarp();
     //Finance
     Functions["cumipmt"]    = new Cumipmt();
     Functions["cumprinc"]   = new Cumprinc();
     Functions["dollarde"]   = new DollarDe();
     Functions["dollarfr"]   = new DollarFr();
     Functions["ddb"]        = new Ddb();
     Functions["effect"]     = new Effect();
     Functions["fvschedule"] = new FvSchedule();
     Functions["pduration"]  = new Pduration();
     Functions["rri"]        = new Rri();
     Functions["pmt"]        = new Pmt();
     Functions["ppmt"]       = new Ppmt();
     Functions["ipmt"]       = new Ipmt();
     Functions["ispmt"]      = new IsPmt();
     Functions["pv"]         = new Pv();
     Functions["fv"]         = new Fv();
     Functions["npv"]        = new Npv();
     Functions["rate"]       = new Rate();
     Functions["nper"]       = new Nper();
     Functions["nominal"]    = new Nominal();
     Functions["irr"]        = new Irr();
     Functions["mirr"]       = new Mirr();
     Functions["xirr"]       = new Xirr();
     Functions["sln"]        = new Sln();
     Functions["syd"]        = new Syd();
     Functions["xnpv"]       = new Xnpv();
     Functions["coupdays"]   = new Coupdays();
     Functions["coupdaysnc"] = new Coupdaysnc();
     Functions["coupdaybs"]  = new Coupdaybs();
     Functions["coupnum"]    = new Coupnum();
     Functions["coupncd"]    = new Coupncd();
     Functions["couppcd"]    = new Couppcd();
     Functions["price"]      = new Price();
     Functions["yield"]      = new Yield();
     Functions["yieldmat"]   = new Yieldmat();
     Functions["duration"]   = new Duration();
     Functions["disc"]       = new Disc();
     //Engineering
     Functions["bitand"]       = new BitAnd();
     Functions["bitor"]        = new BitOr();
     Functions["bitxor"]       = new BitXor();
     Functions["bitlshift"]    = new BitLshift();
     Functions["bitrshift"]    = new BitRshift();
     Functions["convert"]      = new ConvertFunction();
     Functions["bin2dec"]      = new Bin2Dec();
     Functions["bin2hex"]      = new Bin2Hex();
     Functions["bin2oct"]      = new Bin2Oct();
     Functions["dec2bin"]      = new Dec2Bin();
     Functions["dec2hex"]      = new Dec2Hex();
     Functions["dec2oct"]      = new Dec2Oct();
     Functions["hex2bin"]      = new Hex2Bin();
     Functions["hex2dec"]      = new Hex2Dec();
     Functions["hex2oct"]      = new Hex2Oct();
     Functions["oct2bin"]      = new Oct2Bin();
     Functions["oct2dec"]      = new Oct2Dec();
     Functions["oct2hex"]      = new Oct2Hex();
     Functions["delta"]        = new Delta();
     Functions["erf"]          = new Erf();
     Functions["erf.precise"]  = new ErfPrecise();
     Functions["erfc"]         = new Erfc();
     Functions["erfc.precise"] = new ErfcPrecise();
     Functions["besseli"]      = new BesselI();
     Functions["besselj"]      = new BesselJ();
     Functions["besselk"]      = new BesselK();
     Functions["bessely"]      = new BesselY();
 }
Exemplo n.º 30
0
 public BuiltInFunctions()
 {
     // Text
     Functions["len"]         = new Len();
     Functions["lower"]       = new Lower();
     Functions["upper"]       = new Upper();
     Functions["left"]        = new Left();
     Functions["right"]       = new Right();
     Functions["mid"]         = new Mid();
     Functions["replace"]     = new Replace();
     Functions["substitute"]  = new Substitute();
     Functions["concatenate"] = new Concatenate();
     Functions["exact"]       = new Exact();
     Functions["find"]        = new Find();
     Functions["proper"]      = new Proper();
     Functions["text"]        = new Text.Text();
     Functions["t"]           = new T();
     // Numbers
     Functions["int"] = new CInt();
     // Math
     Functions["abs"]         = new Abs();
     Functions["cos"]         = new Cos();
     Functions["cosh"]        = new Cosh();
     Functions["power"]       = new Power();
     Functions["sign"]        = new Sign();
     Functions["sqrt"]        = new Sqrt();
     Functions["sqrtpi"]      = new SqrtPi();
     Functions["pi"]          = new Pi();
     Functions["product"]     = new Product();
     Functions["ceiling"]     = new Ceiling();
     Functions["count"]       = new Count();
     Functions["counta"]      = new CountA();
     Functions["countif"]     = new CountIf();
     Functions["fact"]        = new Fact();
     Functions["floor"]       = new Floor();
     Functions["sin"]         = new Sin();
     Functions["sinh"]        = new Sinh();
     Functions["sum"]         = new Sum();
     Functions["sumif"]       = new SumIf();
     Functions["sumproduct"]  = new SumProduct();
     Functions["sumsq"]       = new Sumsq();
     Functions["stdev"]       = new Stdev();
     Functions["stdevp"]      = new StdevP();
     Functions["stdev.s"]     = new Stdev();
     Functions["stdev.p"]     = new StdevP();
     Functions["subtotal"]    = new Subtotal();
     Functions["exp"]         = new Exp();
     Functions["log"]         = new Log();
     Functions["log10"]       = new Log10();
     Functions["ln"]          = new Ln();
     Functions["max"]         = new Max();
     Functions["maxa"]        = new Maxa();
     Functions["min"]         = new Min();
     Functions["mod"]         = new Mod();
     Functions["average"]     = new Average();
     Functions["averagea"]    = new AverageA();
     Functions["averageif"]   = new AverageIf();
     Functions["round"]       = new Round();
     Functions["rounddown"]   = new Rounddown();
     Functions["roundup"]     = new Roundup();
     Functions["rand"]        = new Rand();
     Functions["randbetween"] = new RandBetween();
     Functions["quotient"]    = new Quotient();
     Functions["trunc"]       = new Trunc();
     Functions["tan"]         = new Tan();
     Functions["tanh"]        = new Tanh();
     Functions["atan"]        = new Atan();
     Functions["atan2"]       = new Atan2();
     Functions["var"]         = new Var();
     Functions["varp"]        = new VarP();
     // Information
     Functions["isblank"]   = new IsBlank();
     Functions["isnumber"]  = new IsNumber();
     Functions["istext"]    = new IsText();
     Functions["iserror"]   = new IsError();
     Functions["iserr"]     = new IsErr();
     Functions["iseven"]    = new IsEven();
     Functions["isodd"]     = new IsOdd();
     Functions["islogical"] = new IsLogical();
     Functions["isna"]      = new IsNa();
     Functions["na"]        = new Na();
     Functions["n"]         = new N();
     // Logical
     Functions["if"]   = new If();
     Functions["not"]  = new Not();
     Functions["and"]  = new And();
     Functions["or"]   = new Or();
     Functions["true"] = new True();
     // Reference and lookup
     Functions["address"] = new Address();
     Functions["hlookup"] = new HLookup();
     Functions["vlookup"] = new VLookup();
     Functions["lookup"]  = new Lookup();
     Functions["match"]   = new Match();
     Functions["row"]     = new Row();
     Functions["rows"]    = new Rows()
     {
         SkipArgumentEvaluation = true
     };
     Functions["column"]  = new Column();
     Functions["columns"] = new Columns()
     {
         SkipArgumentEvaluation = true
     };
     Functions["choose"]   = new Choose();
     Functions["index"]    = new Index();
     Functions["indirect"] = new Indirect();
     // Date
     Functions["date"]       = new Date();
     Functions["today"]      = new Today();
     Functions["now"]        = new Now();
     Functions["day"]        = new Day();
     Functions["month"]      = new Month();
     Functions["year"]       = new Year();
     Functions["time"]       = new Time();
     Functions["hour"]       = new Hour();
     Functions["minute"]     = new Minute();
     Functions["second"]     = new Second();
     Functions["weeknum"]    = new Weeknum();
     Functions["weekday"]    = new Weekday();
     Functions["days360"]    = new Days360();
     Functions["yearfrac"]   = new Yearfrac();
     Functions["edate"]      = new Edate();
     Functions["eomonth"]    = new Eomonth();
     Functions["isoweeknum"] = new IsoWeekNum();
     Functions["workday"]    = new Workday();
 }