Ejemplo n.º 1
0
        void NewRepeater1_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            switch (e.CommandName)
            {
            case "btnOpenProject":
                Session["currentproject"] = ((Label)e.Item.FindControl("prjID")).Text;
                Response.Redirect("/project/projectgantt.aspx?m=74&dgb=1&si=75");

                break;

            case "btnModify":
                tblEvents.Visible    = true;
                tblRelations.Visible = true;
                tblSendmail.Visible  = true;
                Label   prjID = (Label)e.Item.FindControl("prjID");
                DataRow dr    = DatabaseConnection.CreateDataset("SELECT * FROM PROJECT WHERE ID=" + prjID.Text).Tables[0].Rows[0];
                this.prjID.Text     = dr["ID"].ToString();
                prjTitle.Text       = dr["TITLE"].ToString();
                prjDescription.Text = dr["DESCRIPTION"].ToString();
                prjOwnerID.Text     = dr["OWNER"].ToString();
                prjOwner.Text       = DatabaseConnection.SqlScalar("SELECT NAME+' '+SURNAME AS OWNER FROM ACCOUNT WHERE UID=" + prjOwnerID.Text);
                prjOpen.Checked     = (bool)dr["PRJOPEN"];
                prjSuspend.Checked  = (bool)dr["PRJSUSPEND"];

                if (dr["ADMINACCOUNT"].ToString().Length > 0)
                {
                    FillAdminAccount(dr["ADMINACCOUNT"].ToString());
                }

                NewRepeater1.Visible   = false;
                Tabber.Visible         = true;
                ProjectSessions1.prjID = long.Parse(prjID.Text);
                ProjectSessions1.BindSections();
                TeamManager1.prjID = long.Parse(prjID.Text);
                TeamManager1.BindTeam();
                ProjectEvents1.prjID = long.Parse(prjID.Text);
                ProjectEvents1.FillSections();
                ProjectEvents1.FillEvents();
                ProjectSectionRelation1.prjID = long.Parse(prjID.Text);
                ProjectSectionRelation1.FillSections();
                ProjectSectionRelation1.FillRelations();
                break;

            case "MultiDeleteButton":
                DeleteChecked.MultiDelete(this.NewRepeater1.MultiDeleteListArray, "Project");
                this.NewRepeater1.DataBind();
                break;
            }
        }
Ejemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Login())
            {
                ClientScript.RegisterStartupScript(this.GetType(), "endsession", "<script>opener.location.href=opener.location.href;self.close();</script>");
            }
            else
            {
                if (!Page.IsPostBack)
                {
                    ProjectSessions1.prjID     = long.Parse(DatabaseConnection.SqlScalar("SELECT IDRIF FROM PROJECT_SECTION WHERE ID=" + Request["Sec"]));
                    ProjectSessions1.SectionId = long.Parse(Request["Sec"]);
                    ProjectSessions1.GanttEdit = true;
                    ProjectSessions1.FillSection();
                    switchControl.Text = "Relazioni";

                    ProjectSectionRelation1.Visible = false;
                    saveRelations.Visible           = false;
                }
            }
        }