Exemplo n.º 1
0
 protected override void OnPreRender(EventArgs e)
 {
     if (Page.IsPostBack)
     {
         if (Tabber.Visible)
         {
             if (this.prjID.Text.Length > 0 && this.prjID.Text != "-1")
             {
                 TeamManager1.prjID   = long.Parse(prjID.Text);
                 ProjectEvents1.prjID = long.Parse(prjID.Text);
                 ProjectEvents1.FillSections();
                 ProjectEvents1.FillEvents();
                 ProjectSectionRelation1.prjID = long.Parse(prjID.Text);
                 ProjectSectionRelation1.FillSections();
                 ProjectSectionRelation1.FillRelations();
                 string adminaccount = DatabaseConnection.SqlScalar("SELECT ADMINACCOUNT FROM PROJECT WHERE ID=" + prjID.Text);
                 if (adminaccount.Length > 0)
                 {
                     FillAdminAccount(adminaccount);
                 }
             }
         }
     }
     base.OnPreRender(e);
 }
Exemplo n.º 2
0
        void btnSaveprj_Click(object sender, EventArgs e)
        {
            object newid;

            using (DigiDapter dg = new DigiDapter())
            {
                dg.Add("TITLE", prjTitle.Text);
                dg.Add("DESCRIPTION", prjDescription.Text);
                dg.Add("OWNER", prjOwnerID.Text);
                dg.Add("PRJOPEN", ((prjOpen.Checked)?1:0));
                dg.Add("PRJSUSPEND", ((prjSuspend.Checked) ? 1 : 0));
                dg.Add("LASTMODIFIEDDATE", UC.LTZ.ToUniversalTime(DateTime.Now));
                dg.Add("LASTMODIFIEDBYID", UC.UserId);

                if (prjID.Text == "-1")
                {
                    dg.Add("CREATEDDATE", UC.LTZ.ToUniversalTime(DateTime.Now));
                    dg.Add("CREATEDBYID", UC.UserId);
                }

                if (Request["OtherOwnerID"] != null && Request["OtherOwnerID"].Length > 0)
                {
                    string otherowner = "|" + Request["OtherOwnerID"];
                    int    other      = 1;
                    while (Request["OtherOwnerID_" + other] != null && Request["OtherOwnerID_" + other].Length > 0)
                    {
                        otherowner += "|" + Request["OtherOwnerID_" + other];
                        other++;
                    }
                    dg.Add("ADMINACCOUNT", otherowner + "|");
                }
                else
                {
                    dg.Add("ADMINACCOUNT", string.Empty);
                }

                dg.Add("GROUPS", "|1|");

                newid = dg.Execute("PROJECT", "ID=" + prjID.Text, DigiDapter.Identities.Identity);
            }
            if (prjID.Text == "-1")
            {
                prjID.Text = newid.ToString();
            }

            ProjectEvents1.prjID = long.Parse(prjID.Text);
            ProjectEvents1.SaveEvents();
            ProjectSectionRelation1.prjID = long.Parse(prjID.Text);
            ProjectSectionRelation1.SaveRelation();
            NewRepeater1.Visible = true;
            Tabber.Visible       = false;
            FillRepeater();
        }
Exemplo n.º 3
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;
            }
        }