コード例 #1
0
        protected void PositionList_ItemCommand(object source, DataListCommandEventArgs e)
        {
            int positionId = int.Parse(e.CommandArgument.ToString());

            if (positionId > 0)
            {
                IbnCalendar.AddStickedObject(UserId, ObjectId, ObjectTypeId, AssignmentId, positionId);
            }
            else
            {
                IbnCalendar.DeleteStickedObject(UserId, ObjectId, ObjectTypeId, AssignmentId);
            }

            CommandParameters cp = new CommandParameters(CommandName);

            Mediachase.Ibn.Web.UI.WebControls.CommandHandler.RegisterCloseOpenedFrameScript(this.Page, cp.ToString());
        }
コード例 #2
0
        private void BindData()
        {
            // Positions
            DataTable dt = new DataTable();

            dt.Columns.Add(new DataColumn("PositionId", typeof(int)));
            dt.Columns.Add(new DataColumn("PositionName", typeof(string)));

            bool objectIsSticked = IbnCalendar.CheckStickedObject(UserId, ObjectId, ObjectTypeId, AssignmentId);
            int  stickedCount    = IbnCalendar.GetStickedObjectsCount(UserId);

            if (!objectIsSticked)
            {
                stickedCount++;
            }

            for (int i = 1; i <= stickedCount; i++)
            {
                DataRow row = dt.NewRow();
                row["PositionId"]   = i;
                row["PositionName"] = String.Format(CultureInfo.InvariantCulture,
                                                    "{0} {1}", GetGlobalResourceObject("IbnFramework.Calendar", "AtPositionN").ToString(), i);
                dt.Rows.Add(row);
            }
            if (objectIsSticked)
            {
                DataRow row = dt.NewRow();
                row["PositionId"]   = -1;
                row["PositionName"] = String.Concat("[ ", GetGlobalResourceObject("IbnFramework.Calendar", "Unpin").ToString(), " ]");
                dt.Rows.Add(row);
            }

            PositionList.DataSource = dt;
            PositionList.DataBind();

            // Priorities
            PriorityList.DataSource = Project.GetListPriorities();
            PriorityList.DataBind();

            // strings
            ObjectLabel.Text = CommonHelper.GetObjectTitle(ObjectTypeId, ObjectId);
        }