Пример #1
0
        public override void Run(Combat.Character character)
        {
            Int32   animationnumber    = EvaluationHelper.AsInt32(character, AnimationNumber, 0);
            Boolean drawunder          = EvaluationHelper.AsBoolean(character, DrawUnder, false);
            Point   offset             = EvaluationHelper.AsPoint(character, DrawPosition, new Point(0, 0));
            Int32   randomdisplacement = EvaluationHelper.AsInt32(character, RandomDisplacement, 0);

            Combat.ExplodData data = new xnaMugen.Combat.ExplodData();
            data.Scale           = Vector2.One;
            data.AnimationNumber = animationnumber;
            data.CommonAnimation = true;
            data.Location        = (Vector2)offset;
            data.PositionType    = PositionType.P1;
            data.RemoveTime      = -2;
            data.DrawOnTop       = false;
            data.OwnPalFx        = true;
            data.SpritePriority  = (drawunder == true) ? -9 : 9;
            data.Random          = new Point(randomdisplacement / 2, randomdisplacement / 2);
            data.Transparency    = new Blending();
            data.Creator         = character;
            data.Offseter        = character;

            Combat.Explod explod = new Combat.Explod(character.Engine, data);
            if (explod.IsValid == true)
            {
                explod.Engine.Entities.Add(explod);
            }
        }
        public void Visit(CreateTableNode node)
        {
            var columns = new List <ISchemaColumn>();

            for (int i = 0; i < node.TableTypePairs.Length; i++)
            {
                (string ColumnName, string TypeName) = node.TableTypePairs[i];

                var remappedType = EvaluationHelper.RemapPrimitiveTypes(TypeName);

                var type = EvaluationHelper.GetType(remappedType);

                if (type == null)
                {
                    throw new TypeNotFoundException($"Type '{remappedType}' could not be found.");
                }

                columns.Add(new SchemaColumn(ColumnName, i, type));
            }

            var table = new DynamicTable(columns.ToArray());

            _explicitlyDefinedTables.Add(node.Name, table);

            Nodes.Push(new CreateTableNode(node.Name, node.TableTypePairs));
        }
        private Point ConvertGroupHeader(ExporterCollection exportList, BaseSection section, Point offset)
        {
            var retVal  = Point.Empty;
            var rowSize = Size.Empty;
            ReportItemCollection groupCollection = null;
            var groupedRows = section.Items.FindGroupHeader();

            if (groupedRows.Count == 0)
            {
                groupCollection = section.Items.ExtractGroupedColumns();
                base.DataNavigator.Fill(groupCollection);
                base.FireSectionRendering(section);
                ExporterCollection list = ExportHelper.ConvertPlainCollection(groupCollection, offset);

                EvaluationHelper.EvaluateRow(base.Evaluator, list);

                exportList.AddRange(list);

                retVal = new Point(DefaultLeftPosition, offset.Y + groupCollection[0].Size.Height + 20 + (3 * GlobalValues.GapBetweenContainer));
            }
            else
            {
                FillRow(groupedRows[0], base.DataNavigator);
                rowSize = groupedRows[0].Size;
                base.FireGroupHeaderRendering(groupedRows[0]);
                retVal = ConvertStandardRow(exportList, groupedRows[0]);

                groupedRows[0].Size = rowSize;
            }
            return(retVal);
        }
Пример #4
0
 private void ApplyML1stResult(List <PredictionResultModel> resultList)
 {
     if (resultList.Count >= 1)
     {
         ML1stCarName.Text = resultList[0].Name + " - Confidence: " + resultList[0].Confidence + "%";
         CSVCarModel exactCarModel = FindCarObjectPerName(resultList[0].Name);
         ML1stCarPrice.Text            = EvaluationHelper.USDToKunas(exactCarModel.Price) + " kn";
         ML1stHorsepower.Text          = exactCarModel.Horsepower.ToString();
         ML1stLitres.Text              = exactCarModel.Litres100km.ToString();
         ML1stFuelType.Text            = exactCarModel.FuelType;
         ML1stTransmission.Text        = exactCarModel.Transmission;
         pictureBox1stML.ImageLocation = imageDir + exactCarModel.ID + ".png";
     }
     else
     {
         // Should never be executed
         ML1stCarName.Text         = "Something went wrong with generating M rediction.";
         ML1stNumber.Visible       = false;
         ML1stCarPrice.Visible     = false;
         ML1stHorsepower.Visible   = false;
         ML1stLitres.Visible       = false;
         ML1stFuelType.Visible     = false;
         ML1stTransmission.Visible = false;
         pictureBox1stML.Visible   = false;
     }
 }
Пример #5
0
        public EvaluationRealm To(eKreta.Mobile.Core.Models.Evaluation item)
        {
            EvaluationRealm evaluationRealm = new EvaluationRealm();

            evaluationRealm.Id                  = EvaluationHelper.GetId(item);
            evaluationRealm.CreatingTime        = new DateTimeOffset(item.CreatingTime);
            evaluationRealm.Date                = new DateTimeOffset(item.Date);
            evaluationRealm.Form                = item.Form;
            evaluationRealm.FormName            = item.FormName;
            evaluationRealm.Mode                = item.Mode;
            evaluationRealm.NumberValue         = item.NumberValue;
            evaluationRealm.Subject             = item.Subject;
            evaluationRealm.SubjectCategory     = item.SubjectCategory;
            evaluationRealm.SubjectCategoryName = item.SubjectCategoryName;
            evaluationRealm.Teacher             = item.Teacher;
            evaluationRealm.Theme               = item.Theme;
            evaluationRealm.Type                = item.Type;
            evaluationRealm.TypeName            = item.TypeName;
            evaluationRealm.Value               = item.Value;
            evaluationRealm.Weight              = item.Weight;
            evaluationRealm.ProfileId           = item.ProfileId;
            evaluationRealm.SeenByUser          = item.SeenByUser;
            evaluationRealm.OsztalyCsoportUid   = item.OsztalyCsoportUid;
            if (item.EvaluationNature != null)
            {
                evaluationRealm.EvaluationNatureRealm = new EvaluationNatureRealm()
                {
                    Id          = item.EvaluationNature.Id,
                    Description = item.EvaluationNature.Description,
                    Name        = item.EvaluationNature.Name
                }
            }
            ;
            return(evaluationRealm);
        }
Пример #6
0
        public static void GetGeo(ref List <GeoPoint> listGeo)
        {
            string          sql = "select * from ipvt_geoinfotable";
            MySqlDataReader rd  = CustomMySqlHelper.ExecuteDataReader(sql);

            try
            {
                DataSet set = CustomMySqlHelper.ExecuteDataSet(sql);
                if (set.Tables.Count > 0)
                {
                    DataRowCollection rows = set.Tables[0].Rows;
                    if (rows != null)
                    {
                        foreach (DataRow row in rows)
                        {
                            var pnt = new GeoPoint();
                            pnt.Id        = EvaluationHelper.ObjectToInt(row["GeoID"]);
                            pnt.Name      = Convert.ToString(row["Name"]);
                            pnt.Address   = Convert.ToString(row["FormattedAddress"]);
                            pnt.Note      = Convert.ToString(row["Note"]);
                            pnt.Phone     = Convert.ToString(row["Phone"]);
                            pnt.Latitude  = EvaluationHelper.ObjectToDouble(row["Latitude"]);
                            pnt.Longitude = EvaluationHelper.ObjectToDouble(row["Longitude"]);
                            listGeo.Add(pnt);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                LogHelper.MainLog("GeoPointManager.Get error!" + ex);
            }
        }
Пример #7
0
 private void ApplyML3rdResult(List <PredictionResultModel> resultList)
 {
     if (resultList.Count >= 3)
     {
         ML3rdCarName.Text = resultList[2].Name + " - Confidence: " + resultList[2].Confidence + "%";
         CSVCarModel exactCarModel = FindCarObjectPerName(resultList[2].Name);
         ML3rdPrice.Text               = EvaluationHelper.USDToKunas(exactCarModel.Price) + " kn";
         ML3rdHorsepower.Text          = exactCarModel.Horsepower.ToString();
         ML3rdLitres.Text              = exactCarModel.Litres100km.ToString();
         ML3rdFuelType.Text            = exactCarModel.FuelType;
         ML3rdTransmission.Text        = exactCarModel.Transmission;
         pictureBox3rdML.ImageLocation = imageDir + exactCarModel.ID + ".png";
     }
     else
     {
         ML3rdCarName.Text         = "3rd Prediction had too low confidence.";
         ML3rdNumber.Visible       = false;
         ML3rdPrice.Visible        = false;
         ML3rdHorsepower.Visible   = false;
         ML3rdLitres.Visible       = false;
         ML3rdFuelType.Visible     = false;
         ML3rdTransmission.Visible = false;
         pictureBox3rdML.Visible   = false;
     }
 }
Пример #8
0
        /// <summary>
        /// 根据组id获取组信息
        /// </summary>
        /// <param name="gid"></param>
        /// <returns></returns>
        public static DeviceGroup GetGroup(int gid)
        {
            DeviceGroup     group  = null;
            string          sql    = "SELECT GroupID,GroupName,ParentID,GroupLevel FROM ipvt_groupinfotable where GroupID=?gid";
            MySqlDataReader reader = null;

            try
            {
                reader = CustomMySqlHelper.ExecuteDataReader(sql, new MySqlParameter("?gid", gid));
                while (reader.Read())
                {
                    group          = new DeviceGroup();
                    group.Id       = EvaluationHelper.ObjectToInt(reader["GroupID"]);
                    group.Name     = Convert.ToString(reader["GroupName"]);
                    group.ParentId = EvaluationHelper.ObjectToInt(reader["ParentID"]);
                    group.Level    = EvaluationHelper.ObjectToInt(reader["GroupLevel"]);
                    break;
                }
            }
            catch (Exception ex)
            {
                LogHelper.MainLog(ex.Message);
            }
            finally
            {
                if (reader != null)
                {
                    reader.Close();
                }
            }
            return(group);
        }
Пример #9
0
 /// <summary>
 /// 获取设备分组信息
 /// </summary>
 /// <returns></returns>
 public static void GetGroups(ref List <DeviceGroup> groups)
 {
     try
     {
         string          sql    = "SELECT * FROM ipvt_groupinfotable";
         MySqlDataReader reader = null;
         reader = CustomMySqlHelper.ExecuteDataReader(sql);
         if (reader != null)
         {
             while (reader.Read())
             {
                 var grp = new DeviceGroup();
                 grp.Id       = EvaluationHelper.ObjectToInt(reader["GroupID"]);
                 grp.Name     = Convert.ToString(reader["GroupName"]);
                 grp.ParentId = EvaluationHelper.ObjectToInt(reader["ParentID"]);
                 grp.Level    = EvaluationHelper.ObjectToInt(reader["GroupLevel"]);
                 groups.Add(grp);
             }
         }
     }
     catch (Exception ex)
     {
         LogHelper.MainLog("error int GetGroups()!" + ex.StackTrace);
     }
 }
Пример #10
0
        /// <summary>
        /// 通过单个分机号获取正在等待的分机信息
        /// </summary>
        /// <param name="exten">分机号</param>
        /// <returns></returns>
        public static Channelsinfo GetChannelsinfo(string exten)
        {
            string sql = "SELECT uuid,ExtensionNO,application,application_data from ipvt_channelsinfotable where ExtensionNO=?extenNo";

            var ps = new MySqlParameter[1];

            ps[0] = new MySqlParameter("?extenNo", exten);
            MySqlDataReader reader = null;

            try
            {
                reader = CustomMySqlHelper.ExecuteDataReader(sql, ps);
                while (reader.Read())
                {
                    Channelsinfo model = new Channelsinfo();
                    model.Uuid            = EvaluationHelper.ObjectToString(reader["uuid"]);
                    model.ExtNo           = EvaluationHelper.ObjectToString(reader["ExtensionNO"]);
                    model.ApplicationInfo = EvaluationHelper.ObjectToString(reader["application"]);
                    model.ApplicationDate = EvaluationHelper.ObjectToString(reader["application_data"]);
                    return(model);
                }
            }
            catch (Exception ex)
            {
                LogHelper.MainLog(ex.Message);
            }
            finally
            {
                if (reader != null)
                {
                    reader.Close();
                }
            }
            return(null);
        }
Пример #11
0
        /// <summary>
        /// 通过单个分机号获取正在等待的分机信息
        /// </summary>
        /// <returns></returns>
        public static void GetChannelsinfo(out List <Channelsinfo> infoes)
        {
            infoes = new List <Channelsinfo>();
            string sql = "SELECT uuid,ExtensionNO,application,application_data from ipvt_channelsinfotable";

            MySqlDataReader reader = null;

            try
            {
                reader = CustomMySqlHelper.ExecuteDataReader(sql);
                while (reader.Read())
                {
                    Channelsinfo model = new Channelsinfo();
                    model.Uuid            = EvaluationHelper.ObjectToString(reader["uuid"]);
                    model.ExtNo           = EvaluationHelper.ObjectToString(reader["ExtensionNO"]);
                    model.ApplicationInfo = EvaluationHelper.ObjectToString(reader["application"]);
                    model.ApplicationDate = EvaluationHelper.ObjectToString(reader["application_data"]);
                    infoes.Add(model);
                }
            }
            catch (Exception ex)
            {
                LogHelper.MainLog(ex.Message);
            }
            finally
            {
                if (reader != null)
                {
                    reader.Close();
                }
            }
        }
Пример #12
0
        public void RemapPrimitiveTypesTest()
        {
            Assert.AreEqual("System.Int16", EvaluationHelper.RemapPrimitiveTypes("short"));
            Assert.AreEqual("System.Int32", EvaluationHelper.RemapPrimitiveTypes("int"));
            Assert.AreEqual("System.Int64", EvaluationHelper.RemapPrimitiveTypes("long"));

            Assert.AreEqual("System.UInt16", EvaluationHelper.RemapPrimitiveTypes("ushort"));
            Assert.AreEqual("System.UInt32", EvaluationHelper.RemapPrimitiveTypes("uint"));
            Assert.AreEqual("System.UInt64", EvaluationHelper.RemapPrimitiveTypes("ulong"));

            Assert.AreEqual("System.String", EvaluationHelper.RemapPrimitiveTypes("string"));

            Assert.AreEqual("System.Char", EvaluationHelper.RemapPrimitiveTypes("char"));

            Assert.AreEqual("System.Boolean", EvaluationHelper.RemapPrimitiveTypes("bool"));
            Assert.AreEqual("System.Boolean", EvaluationHelper.RemapPrimitiveTypes("boolean"));
            Assert.AreEqual("System.Boolean", EvaluationHelper.RemapPrimitiveTypes("bit"));

            Assert.AreEqual("System.Single", EvaluationHelper.RemapPrimitiveTypes("float"));
            Assert.AreEqual("System.Double", EvaluationHelper.RemapPrimitiveTypes("double"));

            Assert.AreEqual("System.Decimal", EvaluationHelper.RemapPrimitiveTypes("decimal"));
            Assert.AreEqual("System.Decimal", EvaluationHelper.RemapPrimitiveTypes("money"));

            Assert.AreEqual("System.Guid", EvaluationHelper.RemapPrimitiveTypes("guid"));

            Assert.AreEqual("System.SomeType", EvaluationHelper.RemapPrimitiveTypes("System.SomeType"));
        }
Пример #13
0
        /// <summary>
        /// 获取角色集
        /// </summary>
        public static void GetRoles(out List <Role> list)
        {
            list = new List <Role>();
            string          sqlStr = "select GroupID,GroupName from ipvt_jurgrouptable";
            MySqlDataReader reader = null;

            try
            {
                reader = CustomMySqlHelper.ExecuteDataReader(sqlStr);
                while (reader.Read())
                {
                    var r = new Role();
                    r.RoleId   = EvaluationHelper.ObjectToInt(reader["GroupID"]);
                    r.RoleName = reader["GroupName"].ToString();
                    list.Add(r);
                }
            }
            catch (Exception ex)
            {
                LogHelper.MainLog("error in UserManager.GetRoles()!" + ex);
            }
            finally
            {
                if (reader != null)
                {
                    reader.Close();                 //读取完关闭reader对象
                }
            }
        }
Пример #14
0
        /// <summary>
        /// 获取职位集
        /// </summary>
        public static void GetPositions(out List <Position> list)
        {
            list = new List <Position>();
            string          sqlStr = "select PositionID,PositionName from ipvt_positiontable";
            MySqlDataReader reader = null;

            try
            {
                reader = CustomMySqlHelper.ExecuteDataReader(sqlStr);
                while (reader.Read())
                {
                    var p = new Position();
                    p.PositionId   = EvaluationHelper.ObjectToInt(reader["PositionID"]);
                    p.PositionName = reader["PositionName"].ToString();
                    list.Add(p);
                }
            }
            catch (Exception ex)
            {
                LogHelper.MainLog("error in UserManager.GetPositions()!" + ex.Message);
            }
            finally
            {
                if (reader != null)
                {
                    reader.Close();
                }
            }
        }
Пример #15
0
        /// <summary>
        /// 添加网点信息
        /// </summary>
        /// <param name="point">网点信息</param>
        public static void Add(ref GeoPoint point)
        {
            if (point == null)
            {
                return;
            }

            var sqlBuilder =
                new StringBuilder("INSERT INTO ipvt_geoinfotable(Name,FormattedAddress,Latitude,Longitude,Phone,Note) ");

            sqlBuilder.Append("VALUES(?name,?address,?lat,?lng,?phone,?note);");
            sqlBuilder.Append("SELECT @@IDENTITY");
            //string sql = " ";
            var parameters = new MySqlParameter[6];

            parameters[0] = new MySqlParameter("?name", point.Name);
            parameters[1] = new MySqlParameter("?address", point.Address);
            parameters[2] = new MySqlParameter("?lat", point.Latitude);
            parameters[3] = new MySqlParameter("?lng", point.Longitude);
            parameters[4] = new MySqlParameter("?phone", point.Phone);
            parameters[5] = new MySqlParameter("?note", point.Note);

            object obj = CustomMySqlHelper.ExecuteScalar(sqlBuilder.ToString(), parameters);

            if (obj != null)
            {
                point.Id = EvaluationHelper.ObjectToInt(obj);
            }
        }
Пример #16
0
        public override void Run(Combat.Character character)
        {
            Int32?  statenumber     = EvaluationHelper.AsInt32(character, StateNumber, null);
            Boolean?playercontrol   = EvaluationHelper.AsBoolean(character, Control, null);
            Int32?  animationnumber = EvaluationHelper.AsInt32(character, AnimationNumber, null);

            if (statenumber == null)
            {
                return;
            }
            character.StateManager.ChangeState(statenumber.Value);

            if (playercontrol != null)
            {
                if (playercontrol == true)
                {
                    character.PlayerControl = PlayerControl.InControl;
                }
                if (playercontrol == false)
                {
                    character.PlayerControl = PlayerControl.NoControl;
                }
            }

            if (animationnumber != null)
            {
                character.SetLocalAnimation(animationnumber.Value, 0);
            }
        }
Пример #17
0
        public static int GetCount()
        {
            int             count       = 0;
            string          sqlcount    = " select count(*) as count from ipvt_geoinfotable";
            MySqlDataReader readercount = CustomMySqlHelper.ExecuteDataReader(sqlcount);

            try
            {
                while (readercount.Read())
                {
                    count = EvaluationHelper.ObjectToInt(readercount["count"]);
                }
            }
            catch (Exception ex)
            {
                LogHelper.MainLog("Error in GetCallLogCount!" + ex.Message);
            }
            finally
            {
                if (readercount != null)
                {
                    readercount.Close();                      //读取完关闭reader对象
                }
            }
            return(count);
        }
Пример #18
0
        public override void Run(Combat.Character character)
        {
            var x = EvaluationHelper.AsSingle(character, X, 0);
            var y = EvaluationHelper.AsSingle(character, Y, 0);

            character.Move(new Vector2(x, y));
        }
Пример #19
0
        public override void Run(Combat.Character character)
        {
            SoundId?soundid             = EvaluationHelper.AsSoundId(character, SoundId, null);
            Int32   volume              = EvaluationHelper.AsInt32(character, Volume, 0);
            Int32   channelindex        = EvaluationHelper.AsInt32(character, ChannelNumber, -1);
            Boolean priority            = EvaluationHelper.AsBoolean(character, ChannelPriority, false);
            Single  frequencymultiplier = EvaluationHelper.AsSingle(character, FrequencyMultiplier, 1.0f);
            Boolean loop   = EvaluationHelper.AsBoolean(character, LoopSound, false);
            Int32?  pan    = EvaluationHelper.AsInt32(character, PanSound, null);
            Int32?  abspan = EvaluationHelper.AsInt32(character, PanSoundAbsolute, null);

            if (soundid == null)
            {
                return;
            }

            Audio.SoundManager soundmanager = SoundId.IsCommon(false) ? character.Engine.CommonSounds : character.SoundManager;

            Audio.Channel channel = soundmanager.Play(channelindex, soundid.Value, priority, volume, frequencymultiplier, loop);
            if (channel != null && pan != null)
            {
                channel.RelativePan(pan.Value);
            }
            if (channel != null && abspan != null)
            {
                channel.AbsolutePan(abspan.Value);
            }
        }
Пример #20
0
        private void AssignEvaluationModelValue()
        {
            int budgetHRK = int.Parse(txtBudget.Text);
            int budgetUSD = EvaluationHelper.KunasToUSD(budgetHRK);

            EvaluationModel.Price = budgetUSD;
        }
Пример #21
0
        private void ApplyResults(List <CSVCarModel> orderedList)
        {
            // 1st
            Alg1stCarName.Text             = orderedList[0].Name + " - Score: " + orderedList[0].Score;
            Alg1stPrice.Text               = EvaluationHelper.USDToKunas(orderedList[0].Price) + " kn";
            Alg1stHorsepower.Text          = orderedList[0].Horsepower.ToString();
            Alg1stLitres.Text              = orderedList[0].Litres100km.ToString();
            Alg1stFuelType.Text            = orderedList[0].FuelType;
            Alg1stTransmission.Text        = orderedList[0].Transmission;
            pictureBox1stAlg.ImageLocation = imageDir + orderedList[0].ID + ".png";

            //2nd
            Alg2ndCarName.Text             = orderedList[1].Name + " - Score: " + orderedList[1].Score;
            Alg2ndPrice.Text               = EvaluationHelper.USDToKunas(orderedList[1].Price) + " kn";
            Alg2ndHorsepower.Text          = orderedList[1].Horsepower.ToString();
            Alg2ndLitres.Text              = orderedList[1].Litres100km.ToString();
            Alg2ndFuelType.Text            = orderedList[1].FuelType;
            Alg2ndTransmission.Text        = orderedList[1].Transmission;
            pictureBox2ndAlg.ImageLocation = imageDir + orderedList[1].ID + ".png";

            //3rd
            Alg3rdCarName.Text             = orderedList[2].Name + " - Score: " + orderedList[2].Score;
            Alg3rdPrice.Text               = EvaluationHelper.USDToKunas(orderedList[2].Price) + " kn";
            Alg3rdHorsepower.Text          = orderedList[2].Horsepower.ToString();
            Alg3rdLitres.Text              = orderedList[2].Litres100km.ToString();
            Alg3rdFuelType.Text            = orderedList[2].FuelType;
            Alg3rdTransmission.Text        = orderedList[2].Transmission;
            pictureBox3rdAlg.ImageLocation = imageDir + orderedList[2].ID + ".png";
        }
Пример #22
0
        public override void Run(Combat.Character character)
        {
            Int32   time      = EvaluationHelper.AsInt32(character, Time, 1);
            Int32   target_id = EvaluationHelper.AsInt32(character, TargetId, Int32.MinValue);
            Vector2 offset    = EvaluationHelper.AsVector2(character, Position, new Vector2(0, 0));

            foreach (Combat.Character target in character.GetTargets(target_id))
            {
                switch (BindPosition)
                {
                case BindToTargetPostion.Mid:
                    offset += target.BasePlayer.Constants.Midposition;
                    break;

                case BindToTargetPostion.Head:
                    offset += target.BasePlayer.Constants.Headposition;
                    break;

                case BindToTargetPostion.None:
                case BindToTargetPostion.Foot:
                default:
                    break;
                }

                character.Bind.Set(target, offset, time, 0, false);
                break;
            }
        }
Пример #23
0
        public override void Run(Combat.Character character)
        {
            Single x = EvaluationHelper.AsSingle(character, X, 1);
            Single y = EvaluationHelper.AsSingle(character, Y, 1);

            character.CurrentVelocity *= new Vector2(x, y);
        }
Пример #24
0
 /// <summary>
 /// 获取指定分机的呼叫转移列表
 /// </summary>
 /// <param name="transfers"></param>
 /// <param name="exten"></param>
 /// <returns></returns>
 public static void GetTransferTableByExtension(out List <Transfer> transfers, Extension exten)
 {
     transfers = new List <Transfer>();
     if (exten != null)
     {
         DataSet set;
         string  sql =
             "SELECT TransferID,TransferLevel,TransferExtensionNo," +
             "TransferLevel FROM ipvt_transferinfotable WHERE ExtensionNo=" +
             exten.Number + " ORDER BY TransferLevel ASC";
         try
         {
             set = CustomMySqlHelper.ExecuteDataSet(sql);
             DataRowCollection rows = set.Tables[0].Rows;
             if (rows != null)
             {
                 foreach (DataRow row in rows)
                 {
                     Transfer tran = new Transfer();
                     tran.Id                  = EvaluationHelper.ObjectToInt(row["TransferID"]);
                     tran.Level               = EvaluationHelper.ObjectToInt(row["TransferLevel"]);
                     tran.ExtensionNo         = exten.Number;
                     tran.TransferExtensionNo = row["TransferExtensionNo"].ToString();
                     transfers.Add(tran);
                 }
             }
         }
         catch (Exception ex)
         {
             LogHelper.MainLog(ex.ToString());
         }
     }
 }
Пример #25
0
        public override void Run(Combat.Character character)
        {
            var x = EvaluationHelper.AsSingle(character, X, 0);
            var y = EvaluationHelper.AsSingle(character, Y, 0);

            character.CurrentVelocity += new Vector2(x, y);
        }
 protected virtual void CharAdded(object sender, CharAddedEventArgs e)
 {
     if (e.Ch == '(')
     {
         this._sca.CallTip.Show("TODO: parameters", _sca.CurrentPos);
     }
     else
     {
         this._sca.CallTip.Cancel();
         try
         {
             string entry = GetSentenceAt(_sca.CurrentPos);
             this._sca.CallTip.Show(entry, _sca.CurrentPos);
             var autocomplete = EvaluationHelper.GetCompletions(entry, _sca.Text);
             if (autocomplete.Count > 0)
             {
                 if (entry.Length == 1 || entry.Length > 2 && entry[entry.Length - 2] == '.')
                 {
                     _sca.AutoComplete.Show(_sca.GetWordFromPosition(_sca.CurrentPos).Length, autocomplete);
                 }
                 _sca.AutoComplete.List = autocomplete;
             }
         }
         catch (Exception ex)
         {
             this._sca.CallTip.Show(ex.Message, _sca.CurrentPos);
         }
     }
 }
Пример #27
0
        public override void Run(Combat.Character character)
        {
            Int32?varindex = EvaluationHelper.AsInt32(character, IntNumber, null);

            if (varindex == null)
            {
                return;
            }

            Int32 min = 0;
            Int32 max = 1;

            if (GetRange(character, out min, out max) == false)
            {
                return;
            }

            if (min > max)
            {
                Misc.Swap(ref min, ref max);
            }

            Int32 randomvalue = StateSystem.GetSubSystem <Random>().NewInt(min, max);

            if (character.Variables.SetInteger(varindex.Value, false, randomvalue) == false)
            {
            }
        }
Пример #28
0
        private void btnStart_Click(object sender, EventArgs e)
        {
            EvaluationHelper.ResetModel();
            Question1 q1 = new Question1();

            NavigationHelper.GoToForm(this, q1);
        }
Пример #29
0
        public override void Run(Combat.Character character)
        {
            Int32?  amount   = EvaluationHelper.AsInt32(character, Amount, null);
            Boolean cankill  = EvaluationHelper.AsBoolean(character, CanKill, true);
            Boolean absolute = EvaluationHelper.AsBoolean(character, Absolute, false);

            if (amount == null)
            {
                return;
            }

            Int32 scaledamount = amount.Value;

            if (absolute == false)
            {
                scaledamount = (Int32)(scaledamount / character.DefensiveInfo.DefenseMultiplier);
            }

            character.Life += scaledamount;

            if (cankill == false && character.Life == 0)
            {
                character.Life = 1;
            }
        }
Пример #30
0
        private void btnSpreman_Click(object sender, EventArgs e)
        {
            EvaluationHelper.ResetirajModel();
            PrvoPitanje prvoPitanje = new PrvoPitanje();

            NavigationHelper.IdiNaFormu(this, prvoPitanje);
        }