Exemplo n.º 1
0
	void Awake ()
	{
		//Make this active and only instance (since it's already part of persistent game object, we don't have to repeat
		//all the DontDestroyOnLoad part present in FlowControl)
		instance = this;
		levels = Levels.LoadDictionary (Path.Combine (Application.dataPath, LEVELS_FILENAME));
		players = Players.LoadDictionary (Path.Combine (Application.dataPath, SAVEGAMES_FILENAME));
	}
Exemplo n.º 2
0
 void Awake()
 {
     if (control == null)
     {
         DontDestroyOnLoad(gameObject);
         control = this;
     }
     else if (control != this)
     {
         Destroy(gameObject);
     }
 }
Exemplo n.º 3
0
	public void InitEvents ()
	{
		fc = FlowControl.Instance;
		lc = LevelControl.Instance;
		sc = ScoreControl.Instance;
		uic = UIControl.Instance;
		dc = DataControl.Instance;
		shootC = GameObject.Find ("Player").GetComponent<ShootingController> ();

		lc.BallsChanged += OnBallsChanged;
		lc.LevelChanged += OnLevelChanged;
		lc.TargetsChanged += OnTargetsChanged;
		sc.ScoreChanged += OnScoreChanged;
		shootC.InitPowerSlider += OnInitPowerSlider;
		shootC.UpdatePowerSlider += OnUpdatePowerSlider;

		string levelKind = dc.GetLevel (fc.Level).Kind;
		if (levelKind.Equals ("T"))
			GameObject.Find ("Player").GetComponent<MoveOnTrails> ().TrailsEndReached += OnTrailsEndReached;
	}
Exemplo n.º 4
0
 public override bool deleteElement(DataControl dataControl, bool askConfirmation)
 {
     return(false);
 }
Exemplo n.º 5
0
        public FormMain()
        {
            InitializeComponent();

            dc = new DataControl();
        }
Exemplo n.º 6
0
 public static ValidationException Make(
     DataControl ctrl, string sMessage)
 {
     return(new ValidationException(ctrl, sMessage));
 }
Exemplo n.º 7
0
    void updateScrollView()
    {
        // データを全て取得
        DataTable dt = DataControl.getData();

        foreach (DataRow dr in dt.Rows)
        {
            var item = GameObject.Instantiate(prefab) as RectTransform;
            item.SetParent(transform, false);

            listViewNode node = item.gameObject.GetComponent <listViewNode>();
            node.setOwner(this);

            //詳細情報をノードに設定する

            photoDetailInfo info = new photoDetailInfo();
            info.photoID = int.Parse(dr["id"].ToString());
            node.setDetailInfo(info);


            listViewNodes.Add(node);

            //データベースから取得した情報を、各カラムに保存する。
            //画像エリアの取得
            Image childImageName = item.gameObject.transform.Find("Image").gameObject.GetComponent <Image>();
            childImageName.sprite = Resources.Load <Sprite>("Icon");

            //Debug.Log(dr["name"]);

            //お店の名前の取得
            Text childTitleName = item.gameObject.transform.Find("titleText").gameObject.GetComponent <Text>();
            childTitleName.text = dr["name"].ToString(); //jn["titlename"].Get<string>();

            Image ratingStar = item.gameObject.transform.Find("ratingonImage").gameObject.GetComponent <Image>();


            //評価の星を取得
            string rate = dr["myrating"].ToString();

            if (rate == "")
            {
                rate = dr["rating"].ToString();
            }
            ratingStar.fillAmount = float.Parse(rate) / 5.0f;


            //自分で評価した内容
            myComment = item.gameObject.transform.Find("descriptionText ").gameObject.GetComponent <Text>();
            string comment = dr["mycomment"].ToString();
            if (comment != "")
            {
                myComment.text = comment;
            }
        }

        if (listViewNodes.Count != 0)
        {
            scrollBar.SetActive(false);
            noDataText.SetActive(false);
        }
        //スクロールビューの頭から表示されるように
        scrollRect = scrollView.GetComponent <ScrollRect>();
        scrollRect.verticalNormalizedPosition = 1;
    }
Exemplo n.º 8
0
 private ValidationException(DataControl ctrl,
                             string sMessage) : base(sMessage)
 {
     Control = ctrl;
 }
Exemplo n.º 9
0
 private ValidationException(string sMessage) : base(sMessage)
 {
     Control = DataControl.NA;
 }
Exemplo n.º 10
0
 /// <summary>
 /// The DataControl Instante will Handle all the Data needed
 /// </summary>
 /// <returns></returns>
 public static DataControl GetDataControl()
 {
     return(DataControl.Instantiate());
 }
Exemplo n.º 11
0
 void Die()
 {
     DataControl.Respawn();
     //Destroy(gameObject);
 }
Exemplo n.º 12
0
        public bool UpdateConhecimento(string Id, List <string> ls)
        {
            var           bd           = new BDKnowLedge();
            bool          done         = true;
            var           dataControl  = new DataControl();
            DateTime      dt           = dataControl.GeraDataHora();
            var           encoding     = new ASCIIEncoding();
            Conhecimentos conhecimento = bd.Conhecimentos.Single(u => u.StampConhecimento == Id);

            Byte[] bytes;
            int    i = 0, nr = 0;


            try
            {
                foreach (string res in ls)
                {
                    switch (i)
                    {
                    case 0:
                        conhecimento.StampConhecimento = conhecimento.StampConhecimento;
                        break;

                    case 1:
                        conhecimento.StampProjeto = res;
                        break;

                    case 2:
                        conhecimento.StampSubtipo = res;
                        break;

                    case 3:
                        conhecimento.StampTipo = res;
                        break;

                    case 4:
                        conhecimento.Descricao = res;
                        break;

                    case 5:
                        conhecimento.Codigo = res;
                        break;

                    case 6:
                        conhecimento.Metadados = res;
                        break;

                    case 7:
                        conhecimento.Ecra = res;
                        break;

                    case 8:
                        conhecimento.Mensagem = res;
                        break;

                    case 9:
                        conhecimento.Teclas = res;
                        break;

                    case 10:
                        conhecimento.Tabela = res;
                        break;

                    case 11:
                        try
                        {
                            nr = Convert.ToInt32(res);
                            if (nr > 0)
                            {
                                conhecimento.NivelAprovacao = nr;
                            }
                            else
                            {
                                conhecimento.NivelAprovacao = conhecimento.NivelAprovacao;
                            }
                        }
                        catch
                        {
                            conhecimento.NivelAprovacao = conhecimento.NivelAprovacao;
                        }
                        break;

                    case 12:
                        conhecimento.Ousrinis = conhecimento.Ousrinis;
                        break;

                    case 13:
                        try
                        {
                            conhecimento.Ousrdata = conhecimento.Ousrdata;
                        }
                        catch
                        {
                        }
                        break;

                    case 14:
                        conhecimento.Ousrhora = conhecimento.Ousrhora;
                        break;

                    case 15:
                        conhecimento.Usrinis = Global.idUser;
                        break;

                    case 16:
                        try
                        {
                            conhecimento.Usrdata = dt;
                        }
                        catch
                        {
                        }
                        break;

                    case 17:
                        conhecimento.Usrhora = dataControl.GeraHora(dt);
                        break;
                    }
                    i++;
                }

                bd.SaveChanges();
            }
            catch
            {
                done = false;
            }

            return(done);
        }
Exemplo n.º 13
0
        public bool InsertConhecimento(List <string> ls)
        {
            bool     done         = true;
            var      bd           = new BDKnowLedge();
            var      conhecimento = new Conhecimentos();
            var      dataControl  = new DataControl();
            DateTime dt           = dataControl.GeraDataHora();
            var      encoding     = new ASCIIEncoding();

            Byte[] bytes = null;
            int    nr    = 0;

            int i = 0;

            try
            {
                foreach (string res in ls)
                {
                    switch (i)
                    {
                    case 0:
                        if (res.Trim() == "")
                        {
                            _returnStamp = dataControl.GenerateStamp();
                            conhecimento.StampConhecimento = _returnStamp;
                        }
                        else
                        {
                            _returnStamp = res;
                            conhecimento.StampConhecimento = _returnStamp;
                        }
                        break;

                    case 1:
                        conhecimento.StampProjeto = res;
                        break;

                    case 2:
                        conhecimento.StampSubtipo = res;
                        break;

                    case 3:
                        conhecimento.StampTipo = res;
                        break;

                    case 4:
                        conhecimento.Descricao = res;
                        break;

                    case 5:
                        conhecimento.Codigo = res;
                        break;

                    case 6:
                        conhecimento.Metadados = res;
                        break;

                    case 7:
                        conhecimento.Ecra = res;
                        break;

                    case 8:
                        conhecimento.Mensagem = res;
                        break;

                    case 9:
                        conhecimento.Teclas = res;
                        break;

                    case 10:
                        conhecimento.Tabela = res;
                        break;

                    case 11:
                        try
                        {
                            nr = Convert.ToInt32(res);
                            if (nr > 0)
                            {
                                conhecimento.NivelAprovacao = nr;
                            }
                            else
                            {
                                conhecimento.NivelAprovacao = 0;
                            }
                        }
                        catch
                        {
                            conhecimento.NivelAprovacao = 0;
                        }
                        break;

                    case 12:
                        conhecimento.Ousrinis = Global.idUser;
                        break;

                    case 13:
                        try
                        {
                            if (res.Trim() == "")
                            {
                                conhecimento.Ousrdata = dt;
                            }
                            else
                            {
                                conhecimento.Ousrdata = Convert.ToDateTime(res);
                            }
                        }
                        catch
                        {
                            conhecimento.Ousrdata = dt;
                        }
                        break;

                    case 14:
                        if (res.Trim() == "")
                        {
                            conhecimento.Ousrhora = dataControl.GeraHora(dt);
                        }
                        else
                        {
                            conhecimento.Ousrhora = res;
                        }
                        break;

                    case 15:
                        conhecimento.Usrinis = Global.idUser;
                        break;

                    case 16:
                        try
                        {
                            if (res.Trim() == "")
                            {
                                conhecimento.Usrdata = dt;
                            }
                            else
                            {
                                conhecimento.Usrdata = Convert.ToDateTime(res);
                            }
                        }
                        catch
                        {
                            conhecimento.Usrdata = dt;
                        }
                        break;

                    case 17:
                        if (res.Trim() == "")
                        {
                            conhecimento.Usrhora = dataControl.GeraHora(dt);
                        }
                        else
                        {
                            conhecimento.Usrhora = res;
                        }
                        break;
                    }
                    i++;
                }

                bd.Conhecimentos.Add(conhecimento);


                bd.SaveChanges();
            }
            catch
            {
                done = false;
            }

            return(done);
        }
Exemplo n.º 14
0
 private void StripRedundantWhiteSpace()
 {
     DataControl.SetValue(DataControl.GetValue().StripRedundantWhiteSpace());
 }
Exemplo n.º 15
0
 public virtual void ResetControl()
 {
     DataControl.SetValue(GetDefaultValue());
 }
Exemplo n.º 16
0
 public override void LoadControl() => DataControl.SetValue("");
Exemplo n.º 17
0
 protected override bool ReleaseHandle()
 {
     DataControl.Destroy(this.handle);
     this.SetHandle(IntPtr.Zero);
     return(true);
 }
Exemplo n.º 18
0
 protected void SortListLinkButton_Command(object sender, CommandEventArgs e)
 {
     DataControl.UpdateSortExpression(e.CommandArgument.ToString());
     PerformSearchAndBindGrid(1);
 }
Exemplo n.º 19
0
 protected override bool ReleaseHandle()
 {
     DataControl.BulkResultFree(this.handle);
     this.SetHandle(IntPtr.Zero);
     return(true);
 }
Exemplo n.º 20
0
 protected virtual void BindGrid(EntityList <EntityType> data)
 {
     DataControl.DataSource = data;
     DataControl.DataBind();
 }
Exemplo n.º 21
0
 public ValidationException(DataControl ctrl,
                            string sMessage, Exception innerException)
     : base(sMessage, innerException)
 {
     Control = ctrl;
 }
Exemplo n.º 22
0
 protected void btn_Click(object sender, EventArgs e)
 {
     DataControl.UpdataWorking_hours(grid);
 }
Exemplo n.º 23
0
 private ValidationException(string sMessage,
                             Exception innerException)
     : base(sMessage, innerException)
 {
     Control = DataControl.NA;
 }
Exemplo n.º 24
0
 public string GetVal_All()
 {
     return(DataControl.GetValues(IMEIs));
 }
Exemplo n.º 25
0
 private ValidationException()
 {
     Control = DataControl.NA;
 }
Exemplo n.º 26
0
    public override bool deleteElement(DataControl dataControl, bool askConfirmation)
    {
        bool elementDeleted = false;

        return(elementDeleted);
    }
Exemplo n.º 27
0
 protected void btnAdd_Click(object sender, ImageClickEventArgs e)
 {
     DataControl.Execute("update 实验室介绍 set 主题='" + this.txt主题.Text + "',内容='" + txt内容.Text + "'");
     Page.ClientScript.RegisterStartupScript(this.GetType(), "info", "<script>alert('已经上传!'); </script>");
 }
Exemplo n.º 28
0
 private void OnEnable()
 {
     data = GameObject.Find("Data Control").GetComponent <DataControl>();
 }
Exemplo n.º 29
0
 protected void btn1_Click(object sender, EventArgs e)
 {
     //上传并更新班级
     DataControl.UpdataStudent(grid);
 }
Exemplo n.º 30
0
        public List <DataControlInfo> GetDataControlsInfos()
        {
            List <DataControlInfo> result = AppCtx.Cache.RetrieveObject <List <DataControlInfo> >(DCIKEY);

            if (result == null)
            {
                string path = Path.Combine(Constants.We7ControlPhysicalPath, "We7DataControlIndex.xml");
                if (!File.Exists(path))
                {
                    CreateDataControlIndex();
                    if (!File.Exists(path))
                    {
                        throw new Exception(path + "文件不存在!");
                    }
                }

                result = new List <DataControlInfo>();
                XmlDocument doc = new XmlDocument();
                doc.Load(path);
                XmlNodeList ctrs = doc.DocumentElement.SelectNodes("control");
                foreach (XmlElement ctr in ctrs)
                {
                    DataControlInfo dci = new DataControlInfo();
                    dci.Name      = ctr.GetAttribute("name");
                    dci.Group     = ctr.GetAttribute("group");
                    dci.Path      = ctr.GetAttribute("path");
                    dci.Directory = ctr.GetAttribute("directory");
                    dci.Desc      = ctr.GetAttribute("desc");
                    dci.Default   = ctr.GetAttribute("default");
                    XmlNodeList items = ctr.SelectNodes("item");
                    foreach (XmlElement item in items)
                    {
                        DataControl dc = new DataControl();
                        dc.Control = item.GetAttribute("control");
                        dc.Name    = item.GetAttribute("name");
                        dc.Type    = item.GetAttribute("type");
                        dc.Version = item.GetAttribute("version");
                        DateTime dt;
                        DateTime.TryParse(item.GetAttribute("created"), out dt);
                        dc.Created  = dt;
                        dc.FileName = item.GetAttribute("fileName");
                        dc.DemoUrl  = item.GetAttribute("demoUrl");
                        dci.Controls.Add(dc);
                    }
                    if (dci.Controls == null || dci.Controls.Count == 0)
                    {
                        continue;
                    }

                    if (String.IsNullOrEmpty(dci.Default))
                    {
                        dci.DefaultControl = dci.Controls.Find(delegate(DataControl dctr)
                        {
                            return(String.Compare(dci.Default, dctr.Control, true) == 0);
                        });
                    }

                    if (dci.DefaultControl == null)
                    {
                        dci.DefaultControl = dci.Controls[0];
                    }

                    result.Add(dci);
                }
                AppCtx.Cache.AddObjectWithFileChange(DCIKEY, result, path);
            }
            return(result);
        }
Exemplo n.º 31
0
    public override bool moveElementDown(DataControl dataControl)
    {
        bool elementMoved = false;

        return(elementMoved);
    }
Exemplo n.º 32
0
 public FormOutlookContactlist(DataControl dc, Person p)
 {
     InitializeComponent();
     _pEdit = p;
 }
Exemplo n.º 33
0
 public override bool moveElementDown(DataControl dataControl)
 {
     return(false);
 }
Exemplo n.º 34
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string strConnection = "Provider=Microsoft.Jet.OLEDB.4.0;";

        strConnection += @"Data Source='" + MapPath("news_pgg.mdb") + "'";
        OleDbConnection objConnection = new OleDbConnection(strConnection);

        objConnection.Open();
        String           adapt     = "select * from news";
        OleDbDataAdapter m_adapter = new OleDbDataAdapter(adapt, objConnection);
        DataTable        table1    = new DataTable();

        m_adapter.Fill(table1);
        if (table1.Rows.Count >= 1)
        {
            HyperLink1.Text        = table1.Rows[table1.Rows.Count - 1][1].ToString();
            HyperLink1.NavigateUrl = table1.Rows[table1.Rows.Count - 1][2].ToString();
        }
        else
        {
            HyperLink1.Text = ""; HyperLink1.NavigateUrl = "";
        }
        if (table1.Rows.Count >= 2)
        {
            HyperLink2.Text        = table1.Rows[table1.Rows.Count - 2][1].ToString();
            HyperLink2.NavigateUrl = table1.Rows[table1.Rows.Count - 2][2].ToString();
        }
        else
        {
            HyperLink2.Text = ""; HyperLink2.NavigateUrl = "";
        }
        if (table1.Rows.Count >= 3)
        {
            HyperLink3.Text        = table1.Rows[table1.Rows.Count - 3][1].ToString();
            HyperLink3.NavigateUrl = table1.Rows[table1.Rows.Count - 3][2].ToString();
        }
        else
        {
            HyperLink3.Text = ""; HyperLink3.NavigateUrl = "";
        }
        if (table1.Rows.Count >= 4)
        {
            HyperLink4.Text        = table1.Rows[table1.Rows.Count - 4][1].ToString();
            HyperLink4.NavigateUrl = table1.Rows[table1.Rows.Count - 4][2].ToString();
        }
        else
        {
            HyperLink4.Text = ""; HyperLink4.NavigateUrl = "";
        }
        if (table1.Rows.Count >= 5)
        {
            HyperLink5.Text        = table1.Rows[table1.Rows.Count - 5][1].ToString();
            HyperLink5.NavigateUrl = table1.Rows[table1.Rows.Count - 5][2].ToString();
        }
        else
        {
            HyperLink5.Text = ""; HyperLink5.NavigateUrl = "";
        }
        if (table1.Rows.Count >= 6)
        {
            HyperLink6.Text        = table1.Rows[table1.Rows.Count - 6][1].ToString();
            HyperLink6.NavigateUrl = table1.Rows[table1.Rows.Count - 6][2].ToString();
        }
        else
        {
            HyperLink6.Text = ""; HyperLink6.NavigateUrl = "";
        }
        if (table1.Rows.Count >= 7)
        {
            HyperLink7.Text        = table1.Rows[table1.Rows.Count - 7][1].ToString();
            HyperLink7.NavigateUrl = table1.Rows[table1.Rows.Count - 7][2].ToString();
        }
        else
        {
            HyperLink7.Text = ""; HyperLink7.NavigateUrl = "";
        }
        if (table1.Rows.Count >= 8)
        {
            HyperLink8.Text        = table1.Rows[table1.Rows.Count - 8][1].ToString();
            HyperLink8.NavigateUrl = table1.Rows[table1.Rows.Count - 8][2].ToString();
        }
        else
        {
            HyperLink8.Text = ""; HyperLink8.NavigateUrl = "";
        }
        if (table1.Rows.Count >= 9)
        {
            HyperLink9.Text        = table1.Rows[table1.Rows.Count - 9][1].ToString();
            HyperLink9.NavigateUrl = table1.Rows[table1.Rows.Count - 9][2].ToString();
        }
        else
        {
            HyperLink9.Text = ""; HyperLink9.NavigateUrl = "";
        }
        if (table1.Rows.Count >= 10)
        {
            HyperLink10.Text        = table1.Rows[table1.Rows.Count - 10][1].ToString();
            HyperLink10.NavigateUrl = table1.Rows[table1.Rows.Count - 10][2].ToString();
        }
        else
        {
            HyperLink10.Text = ""; HyperLink10.NavigateUrl = "";
        }

        objConnection.Close();

        if (!Page.IsPostBack)
        {
            DataTable dt = DataControl.GetData("select * from 新闻图片维护");
            if (dt.Rows.Count > 0)
            {
                strTP2 = dt.Rows[0]["图片1"] + "";
                strTP3 = dt.Rows[0]["图片2"] + "";
                strTP4 = dt.Rows[0]["图片3"] + "";
            }
        }
    }