Пример #1
0
    public static decimal?SumDataToDecimal(List <string> lstData)
    {
        decimal?nTotal   = null;
        bool    cNullAll = true;
        decimal nSum     = 0;

        foreach (string sval in lstData)
        {
            if (SystemFunction.IsNumberic(sval + ""))
            {
                cNullAll = false;
                nSum     = nSum + SystemFunction.GetNumberNullToZero(sval + "");
            }
        }

        if (!cNullAll)
        {
            nTotal = nSum;
        }

        return(nTotal);
    }
Пример #2
0
    public static decimal?SumDataToDecimal(string[] ArrValue)
    {
        decimal?nTotal   = null;
        bool    cNullAll = true;
        decimal nSum     = 0;

        for (int i = 0; i < ArrValue.Length; i++)
        {
            if (SystemFunction.IsNumberic(ArrValue[i]))
            {
                cNullAll = false;
                nSum     = nSum + SystemFunction.GetNumberNullToZero(ArrValue[i]);
            }
        }

        if (!cNullAll)
        {
            nTotal = nSum;
        }

        return(nTotal);
    }
Пример #3
0
    public static decimal?SumDataToDecimal(string sM1, string sM2, string sM3, string sM4, string sM5, string sM6, string sM7, string sM8, string sM9, string sM10, string sM11, string sM12)
    {
        string[] ArrValue = { sM1, sM2, sM3, sM4, sM5, sM6, sM7, sM8, sM9, sM10, sM11, sM12 };
        decimal? nTotal   = null;
        bool     cNullAll = true;
        decimal  nSum     = 0;

        for (int i = 0; i < ArrValue.Length; i++)
        {
            if (SystemFunction.IsNumberic(ArrValue[i]))
            {
                cNullAll = false;
                nSum     = nSum + SystemFunction.GetNumberNullToZero(ArrValue[i]);
            }
        }

        if (!cNullAll)
        {
            nTotal = nSum;
        }

        return(nTotal);
    }