protected void Page_Load(object sender, EventArgs e)
 {
     string connstr = ConfigurationManager.ConnectionStrings["connStr"].ConnectionString;
     conn = new MySqlConnection (connstr);
     mg = new MonoGrid (conn);
     getData ();
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            string connstr = ConfigurationManager.ConnectionStrings["connStr"].ConnectionString;
            conn = new MySqlConnection(connstr);
            mg = new MonoGrid(conn);

            GridView1.DataSource = GetUsers();
            GridView1.DataBind();
        }
Exemple #3
0
    protected override void Awake()
    {
        base.Awake();

        Grid = FindObjectOfType <MonoGrid>();

        TurnManager.Instance.OnTurnStart += HandleOnTurnStart;
        TurnManager.Instance.OnRoundEnd  += HandleOnRoundEnd;
    }
        public ActionMenuContainer(bool visible) : base(TextureLoader.GUIMenuBackground, ActionMenuLayout.ActionMenuLocation, false)
        {
            this.Visible = visible;

            this.ActionGrid = new MonoGrid(new Point2D(32, 32), ActionMenuLayout.ActionGridBounds, int.MaxValue,
                                           true, TextureLoader.FontMainMenuFont12x, 5);
            this.PopulateActionGrid();

            this.Controls.Add(this.ActionGrid);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            string connstr = ConfigurationManager.ConnectionStrings["connStr"].ConnectionString;
            conn = new MySqlConnection(connstr);
            mg = new MonoGrid(conn);

            //初始化获取系统参数
            molDiv = int.Parse(mg.Parameter.FirstOrDefault(i => i.PnAme == "molDiv").PvAlue);

            Update();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            string connstr = ConfigurationManager.ConnectionStrings["connStr"].ConnectionString;
            conn = new MySqlConnection(connstr);
            mg = new MonoGrid(conn);
            if (!IsPostBack)
            {

                GridView1.DataSource = mg.Parameter;
                GridView1.DataBind();
            }
            Tbx_Name.Text = "";
            Tbx_Value.Text = "";
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     Session["User"]=1;
     string connstr = ConfigurationManager.ConnectionStrings["connStr"].ConnectionString;
     conn = new MySqlConnection(connstr);
     mg = new MonoGrid(conn);
     if (!IsPostBack)
     {
         Client c = new Client();
         c = mg.Client.FirstOrDefault(item => item.IDClient == 1);//暂时赋值
         TextBoxUserName.Text = c.UserName;
         TextBoxEMail.Text = c.Email;
         Session["Pwd"] = c.Pwd;
     }
 }
        protected void ButtonRegister_Click(object sender, EventArgs e)
        {
            //验证信息输入

            //写入数据库Client表

            Client cToAdd = new Client();
            cToAdd.UserName = TextBoxUserName.Text;
            cToAdd.Pwd = TextBoxPWD.Text;
            cToAdd.Email = TextBoxEMail.Text;
            cToAdd.RegisterTime = DateTime.Now;

            string connstr = ConfigurationManager.ConnectionStrings["connStr"].ConnectionString;
            conn = new MySqlConnection(connstr);
            mg = new MonoGrid(conn);
            mg.Client.InsertOnSubmit(cToAdd);
            mg.SubmitChanges();
        }
Exemple #9
0
    public void OnCellInput(MonoGrid grid, Cell cell)
    {
        // If tapping again in same position.
        if (ActionManager.Instance.HasTarget &&
            ActionManager.Instance.SelectedAction.TargetCell == cell)
        {
            ActionManager.Instance.DoAction();
        }


        // If we've got an action and just need a target
        else if (ActionManager.Instance.HasAction)
        {
            // Set target if its valid
            ActionManager.Instance.SetTarget(cell);
            //if (ActionManager.Instance.SetTarget(formation, coordinate))
            //    ActionManager.Instance.DoAction();
        }
    }
Exemple #10
0
        protected void btnUpload_Click(object sender, EventArgs e)
        {
            HttpFileCollection files = HttpContext.Current.Request.Files;
            Task tToUpload = new Task ();
            tToUpload.IDTask = DateTime.Now.ToString ("yyyyMMddHHmmss");
            string folder = Server.MapPath (@"~/Files/Upload/" + tToUpload.IDTask);
            if (!Directory.Exists (folder))
                Directory.CreateDirectory (folder);

            for (int i = 0; i < files.Count; i++) {
                if (i < files.Count && i < 10) {
                    if (files[i].FileName != "" || files[i] != null) {
                        HttpPostedFile myFile = files[i];
                        string FileName = myFile.FileName.ToString ().Trim ();
                        this.lblAttachmentError.Text = "<" + FileName + ">";
                        // Show file name
                        // Empty value in Browse Box
                        if (myFile.FileName.Trim () == "") {
                            this.lblAttachmentError.Text = "No file selected.";
                            return;
                        }

                        if (myFile.ContentLength != 0) {
                            this.lblAttachment.Text += "<BR>" + FileName;
                            this.lblAttachmentError.Text = "";
                            string temp=null;
                            if (FileName.EndsWith("mol2")) {

                             temp=this.Request.PhysicalApplicationPath.ToString ().Trim () + @"Files/Upload/" + tToUpload.IDTask + @"/" + tToUpload.IDTask + ".mol2";
                            }
                            else
                             temp=this.Request.PhysicalApplicationPath.ToString ().Trim () + @"Files/Upload/" + tToUpload.IDTask + @"/" + FileName;
                            myFile.SaveAs (temp);
                        }
                        else
                        {
                            this.lblAttachmentError.Text = "File not found.";
                            return;
                        }
                    }
                } else
                    this.lblAttachmentError.Text = "Uploaded File exceed limits.";

            }

            //Mol文件内节点个数
            string molPath = folder + @"/" + tToUpload.IDTask + ".mol2";
            string[] molStrings = System.IO.File.ReadAllLines (molPath);
            int molCount = (from str in molStrings
                where str == "@<TRIPOS>MOLECULE"
                select str).Count ();

            tToUpload.MolCount=molCount;
            tToUpload.UserID=1;
            tToUpload.Status=0;
            tToUpload.UploadTime=DateTime.Now;
            tToUpload.Intro="无";

            string connstr = ConfigurationManager.ConnectionStrings["connStr"].ConnectionString;
            MySqlConnection conn = new MySqlConnection (connstr);
            MonoGrid mg = new MonoGrid (conn);
            mg.Task.InsertOnSubmit (tToUpload);
            mg.SubmitChanges ();
            //检测其他文件的完整性合法性
            //写入数据库

            FileHelper.Grand(Server.MapPath("~/Files/Upload"),tToUpload.IDTask);
        }