Esempio n. 1
0
        public static decimal GetProcessPrice(int ProcessId, int num)
        {
            decimal result = 0;

            DataRow[]      drs = AllData.Select("ProcessId='" + ProcessId.ToString() + "'");
            C_ProcessPrice cp  = null;

            if (drs.Length > 0)
            {
                cp = DataSource.ORMHelper.RowToModel <C_ProcessPrice>(drs[0]);
            }
            if (cp != null)
            {
                decimal r1 = cp.SinglePrice1 * num;
                if (cp.StartPrice > 0)
                {
                    if (r1 < cp.StartPrice)
                    {
                        r1 = cp.StartPrice;
                    }
                }
                result = r1;
                return(result);
            }
            return(-1);
        }
Esempio n. 2
0
        public static C_ProcessPrice GetById(int processid)
        {
            DataRow[]      drs = AllData.Select("ProcessId='" + processid.ToString() + "'");
            C_ProcessPrice cp  = null;

            if (drs.Length > 0)
            {
                cp = DataSource.ORMHelper.RowToModel <C_ProcessPrice>(drs[0]);
            }
            if (cp != null)
            {
                return(cp);
            }
            else
            {
                return(null);
            }
        }