示例#1
0
        protected void OkButton_Click(object sender, EventArgs e)
        {
            string refreshCommand = Mediachase.Ibn.Web.UI.WebControls.CommandHandler.GetRefreshCommand(this.Page);
            string paramString    = String.Empty;

            if (!String.IsNullOrEmpty(refreshCommand))
            {
                CommandParameters cp = new CommandParameters(refreshCommand);
                cp.CommandArguments = new Dictionary <string, string>();
                cp.AddCommandArgument("DeleteType", DeleteTypeList.SelectedValue);

                if (ObjectId != PrimaryKeyId.Empty)
                {
                    cp.AddCommandArgument("ObjectId", ObjectId.ToString());
                    paramString = cp.ToString();
                }
                else if (Request.QueryString["GridId"] != null)
                {
                    cp.AddCommandArgument("GridId", Request.QueryString["GridId"]);
                    paramString = cp.ToString();
                }
                else
                {
                    paramString = String.Empty;
                }
            }
            Mediachase.Ibn.Web.UI.WebControls.CommandHandler.RegisterCloseOpenedFrameScript(this.Page, paramString);
        }
示例#2
0
        protected void OkButton_Click(object sender, EventArgs e)
        {
            string refreshCommand = Mediachase.Ibn.Web.UI.WebControls.CommandHandler.GetRefreshCommand(this.Page);
            string paramString = String.Empty;

            if (!String.IsNullOrEmpty(refreshCommand))
            {
                CommandParameters cp = new CommandParameters(refreshCommand);
                cp.CommandArguments = new Dictionary<string, string>();
                cp.AddCommandArgument("DeleteType", DeleteTypeList.SelectedValue);

                if (ObjectId != PrimaryKeyId.Empty)
                {
                    cp.AddCommandArgument("ObjectId", ObjectId.ToString());
                    paramString = cp.ToString();
                }
                else if (Request.QueryString["GridId"] != null)
                {
                    cp.AddCommandArgument("GridId", Request.QueryString["GridId"]);
                    paramString = cp.ToString();
                }
                else
                {
                    paramString = String.Empty;
                }
            }
            Mediachase.Ibn.Web.UI.WebControls.CommandHandler.RegisterCloseOpenedFrameScript(this.Page, paramString);
        }
示例#3
0
        protected void SaveButton_Click(object sender, EventArgs e)
        {
            if (!String.IsNullOrEmpty(ClassName))
            {
                MetaClass mc = MetaDataWrapper.GetMetaClassByName(ClassName);

                HistoryMetaClassInfo historyInfo = HistoryManager.GetInfo(mc);
                historyInfo.SelectedFields.Add(FieldList.SelectedValue);
                HistoryManager.SetInfo(mc, historyInfo);

                ListViewProfile[] mas = ListViewProfile.GetSystemProfiles(HistoryManager.GetHistoryMetaClassName(ClassName), "ItemHistoryList");
                if (mas.Length == 0)
                {
                    CHelper.GetHistorySystemListViewProfile(HistoryManager.GetHistoryMetaClassName(ClassName), "ItemHistoryList");
                    mas = ListViewProfile.GetSystemProfiles(HistoryManager.GetHistoryMetaClassName(ClassName), "ItemHistoryList");
                }
                if (!mas[0].FieldSet.Contains(FieldList.SelectedValue))
                {
                    mas[0].FieldSet.Add(FieldList.SelectedValue);
                    mas[0].ColumnsUI.Add(new ColumnProperties(FieldList.SelectedValue, "150px", String.Empty));
                    ListViewProfile.SaveSystemProfile(HistoryManager.GetHistoryMetaClassName(ClassName), "ItemHistoryList", Mediachase.IBN.Business.Security.CurrentUser.UserID, mas[0]);
                }

                CommandParameters cp = new CommandParameters(CommandName);
                Mediachase.Ibn.Web.UI.WebControls.CommandHandler.RegisterCloseOpenedFrameScript(this.Page, cp.ToString());
                //CHelper.UpdateModalPopupContainer(this, ContainerId);
                //CHelper.RequireDataBind();
            }
        }
示例#4
0
        public void Invoke(object sender, object element)
        {
            if (element is CommandParameters)
            {
                CommandParameters cp = (CommandParameters)element;
                //if (!cp.CommandArguments.ContainsKey("ControlId"))
                //    throw new ArgumentNullException("CommandParameters.ControlId @ GoogleGadgetRefresh");

                //string _cid = cp.CommandArguments["ControlId"];
                if (HttpContext.Current.Session["ControlId"] == null)
                    throw new ArgumentNullException("Session.ControlId @ GoogleGadgetRefresh");

                string _cid = HttpContext.Current.Session["ControlId"].ToString();
                string id = MetaViewGroupUtil.GetIdFromUniqueKey(cp.CommandArguments["primaryKeyId"]);
                HttpRequest request = HttpContext.Current.Request;

                if (request != null)
                {
                    GoogleGadgetEntity gge = (GoogleGadgetEntity)BusinessManager.Load("GoogleGadget", PrimaryKeyId.Parse(id));
                    ControlProperties.Provider.SaveValue(_cid, "PageSource", id);

                    if (gge != null)
                        ControlProperties.Provider.SaveValue(_cid, ControlProperties._titleKey, CHelper.GetResFileString(gge.Title));

                    CommandParameters cp2 = new CommandParameters("MC_GG_SelectItem");
                    Mediachase.Ibn.Web.UI.WebControls.CommandHandler.RegisterCloseOpenedFrameScript(((CommandManager)sender).Page, cp2.ToString());
                    //((CommandManager)sender).Page.ClientScript.RegisterClientScriptBlock(this.GetType(), Guid.NewGuid().ToString(), "", true);

                }
            }
        }
示例#5
0
        /// <summary>
        /// Handles the Load event of the Page control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        protected void Page_Load(object sender, EventArgs e)
        {
            _ExpressionDto = (ExpressionDto)HttpContext.Current.Session[_ExpressionDtoEditSessionKey];
            _SegmentDto    = HttpContext.Current.Session[_SegmentDtoEditSessionKey] as SegmentDto;
            if (_ExpressionDto == null || _SegmentDto == null)  // close the window
            {
                CommandParameters cp = new CommandParameters(_RuleEditCommandString);
                CommandHandler.RegisterCloseOpenedFrameScript(this.Page, cp.ToString());
                ExprFilter.Visible = false;
            }


            if (!this.IsPostBack)
            {
                if (_ExpressionDto != null)
                {
                    //Request for create expresion
                    if (IsCreateExpression)
                    {
                        //Add new ExpressionCollection to session
                        ExpressionFilters.Add(new FilterExpressionNodeCollection());
                        //Change iterator position to new collections
                        ExpressionIndex = ExpressionFilters.Count - 1;
                    }
                    else
                    {
                        BindForm();
                    }
                    BindExpressionEditor(ExpressionFilter);
                }
            }
        }
示例#6
0
 void btnCancel_Click(object sender, EventArgs e)
 {
     CommandParameters cp = new CommandParameters(Request["CommandName"]);
     cp.CommandArguments = new Dictionary<string, string>();
     cp.AddCommandArgument("Uid", "null");
     CommandHandler.RegisterCloseOpenedFrameScript(this.Page, cp.ToString());
 }
示例#7
0
    }//END AddParameter method

    // ==================================================================================
    /// <summary>
    /// This method test to see if the parameter is in the list.
    /// </summary>
    /// <param name="Name">String: the name of the parameter.</param>
    /// <returns>True: parameter exists</returns>
    // ---------------------------------------------------------------------------------
    public bool hasParameter ( CommandParameters Name )
    {
      //
      // get the string value of the parameter list.
      //
      String name = Name.ToString ( );
      name = name.Trim ( );

      //
      // Iterate through the parameters to get the selectev value.
      //
      foreach ( Parameter parameter in this._ParameterList )
      {
        if ( parameter.Name == name )
        {
          return true;
        }
      }

      //
      // Return result
      //
      return false;

    }//END hasParameter method
示例#8
0
 protected void AddButton_Click(object sender, EventArgs e)
 {
     if (Process())
     {
         CommandParameters cp = new CommandParameters("MC_TimeTracking_QuickAddManagerFrame");
         Mediachase.Ibn.Web.UI.WebControls.CommandHandler.RegisterRefreshParentFromFrameScript(this.Page, cp.ToString());
     }
 }
示例#9
0
 void btnOnlyThis_Click(object sender, EventArgs e)
 {
     PrimaryKeyId pKey = PrimaryKeyId.Parse(Request["ObjectId"]);
     CommandParameters cp = new CommandParameters(Request["CommandName"]);
     cp.CommandArguments = new Dictionary<string, string>();
     cp.AddCommandArgument("Uid", pKey.ToString());
     CommandHandler.RegisterCloseOpenedFrameScript(this.Page, cp.ToString());
 }
示例#10
0
 /// <summary>
 /// Determines whether the value of this instance and the specified one have the same value.
 /// </summary>
 /// <param name="other">The object to compare.</param>
 /// <returns>true if this instance is the value of the same as the specific one; otherwise, false.</returns>
 public bool Equals(CommandParameters other)
 {
     if (other == null)
     {
         return(false);
     }
     return(ToString() == other.ToString());
 }
示例#11
0
 protected void btnExport_Click(object sender, EventArgs e)
 {
     CommandParameters cp = new CommandParameters(_refreshCommand);
     cp.CommandArguments = new System.Collections.Generic.Dictionary<string, string>();
     cp.AddCommandArgument("Type", _type);
     cp.AddCommandArgument("Variant", rbList.SelectedValue);
     Mediachase.Ibn.Web.UI.WebControls.CommandHandler.RegisterCloseOpenedFrameScript(this.Page, cp.ToString());
 }
示例#12
0
        /// <summary>
        /// Handles the ServerClick event of the btnSaveAndClose control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        void btnSaveAndClose_ServerClick(object sender, EventArgs e)
        {
            ViewControl.SaveChanges(null);

            CommandParameters cp = new CommandParameters("cmdCoreLayoutAddControl");

            CommandHandler.RegisterCloseOpenedFrameScript(this.Page, cp.ToString());
        }
示例#13
0
        void btnCancel_Click(object sender, EventArgs e)
        {
            CommandParameters cp = new CommandParameters(Request["CommandName"]);

            cp.CommandArguments = new Dictionary <string, string>();
            cp.AddCommandArgument("Uid", "null");
            CommandHandler.RegisterCloseOpenedFrameScript(this.Page, cp.ToString());
        }
示例#14
0
        void lbGoToEdit_Click(object sender, EventArgs e)
        {
            CommandParameters cp = new CommandParameters(Request["CommandName"]);

            cp.CommandArguments = new Dictionary <string, string>();
            cp.AddCommandArgument("action", "edit");
            cp.AddCommandArgument("Uid", Request["ObjectId"]);
            CommandHandler.RegisterCloseOpenedFrameScript(this.Page, cp.ToString());
        }
        void btnSave_ServerClick(object sender, EventArgs e)
        {
            Mediachase.IBN.Business.PortalConfig.MdsDeliveryTimeout = int.Parse(txtDeliveryTimeout.Text) * 24 * 60;
            Mediachase.IBN.Business.PortalConfig.MdsMaxDeliveryAttempts = int.Parse(txtAttempts.Text);
            Mediachase.IBN.Business.PortalConfig.MdsDeleteOlderMoreThan = int.Parse(txtLogPeriod.Text) * 24 * 60;

            CommandParameters cp = new CommandParameters("MC_MUI_ChangeSettings");
            CommandHandler.RegisterCloseOpenedFrameScript(this.Page, cp.ToString());
        }
示例#16
0
        protected void Add_Click(object sender, System.EventArgs e)
        {
            int RelProjectId = int.Parse(hdnProjectId.Value);
            if (ProjectId > 0 && ProjectId != RelProjectId)
                Project2.AddRelation(ProjectId, RelProjectId);

            CommandParameters cp = new CommandParameters("MC_PM_Redirect");
            Mediachase.Ibn.Web.UI.WebControls.CommandHandler.RegisterCloseOpenedFrameScript(this.Page, cp.ToString());
        }
示例#17
0
        void btnOnlyThis_Click(object sender, EventArgs e)
        {
            PrimaryKeyId      pKey = PrimaryKeyId.Parse(Request["ObjectId"]);
            CommandParameters cp   = new CommandParameters(Request["CommandName"]);

            cp.CommandArguments = new Dictionary <string, string>();
            cp.AddCommandArgument("Uid", pKey.ToString());
            CommandHandler.RegisterCloseOpenedFrameScript(this.Page, cp.ToString());
        }
示例#18
0
        /// <summary>
        /// Handles the Click event of the btnOK control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        void btnOK_Click(object sender, EventArgs e)
        {
            // close dialog
            CommandParameters           cp  = new CommandParameters("MoveFolderDialogCommand");
            Dictionary <string, string> dic = new Dictionary <string, string>();

            dic["folder"]       = ddlFolders.SelectedValue;
            cp.CommandArguments = dic;
            CommandHandler.RegisterCloseOpenedFrameScript(this.Page, cp.ToString());
        }
        void btnSave_ServerClick(object sender, EventArgs e)
        {
            Mediachase.IBN.Business.PortalConfig.MdsDeliveryTimeout     = int.Parse(txtDeliveryTimeout.Text) * 24 * 60;
            Mediachase.IBN.Business.PortalConfig.MdsMaxDeliveryAttempts = int.Parse(txtAttempts.Text);
            Mediachase.IBN.Business.PortalConfig.MdsDeleteOlderMoreThan = int.Parse(txtLogPeriod.Text) * 24 * 60;

            CommandParameters cp = new CommandParameters("MC_MUI_ChangeSettings");

            CommandHandler.RegisterCloseOpenedFrameScript(this.Page, cp.ToString());
        }
示例#20
0
        protected void btnSave_ServerClick(object sender, System.EventArgs e)
        {
            if (ddGroups.SelectedItem != null)
            {
                int PTodoID = int.Parse(ddGroups.SelectedValue);

                Mediachase.IBN.Business.ToDo.CreateToDoLink(ToDoID, PTodoID);
            }
            CommandParameters cp = new CommandParameters("MC_PM_ToDoRedirect");
            Mediachase.Ibn.Web.UI.WebControls.CommandHandler.RegisterCloseOpenedFrameScript(this.Page, cp.ToString());
        }
示例#21
0
        /// <summary>
        /// Handles the ServerClick event of the btnDefault control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        void btnDefault_ServerClick(object sender, EventArgs e)
        {
            IDictionary dic = new ListDictionary();

            dic.Add(_SaveOptionKey, _SaveDefaultKey);
            ViewControl.SaveChanges(dic);

            CommandParameters cp = new CommandParameters("cmdCoreLayoutAddControl");

            CommandHandler.RegisterCloseOpenedFrameScript(this.Page, cp.ToString());
        }
示例#22
0
        void lbEditSeries_Click(object sender, EventArgs e)
        {
            CommandParameters cp = new CommandParameters(Request["CommandName"]);

            cp.CommandArguments = new Dictionary <string, string>();
            cp.AddCommandArgument("action", "edit");
            PrimaryKeyId pKey = PrimaryKeyId.Parse(Request["ObjectId"]);

            pKey = ((VirtualEventId)pKey).RealEventId;
            cp.AddCommandArgument("Uid", pKey.ToString());
            CommandHandler.RegisterCloseOpenedFrameScript(this.Page, cp.ToString());
        }
示例#23
0
        void btnExport_Click(object sender, EventArgs e)
        {
            // close dialog
            CommandParameters cp = new CommandParameters("cmdLogExport");

            cp.CommandArguments = new System.Collections.Generic.Dictionary <string, string>();
            cp.CommandArguments.Add("Variant", this.rbList.SelectedValue);
            cp.CommandArguments.Add("LogType", LogType);
            cp.CommandArguments.Add("DataSourceId", DataSourceId);
            cp.CommandArguments.Add("PageProgressDisplay", "false");
            CommandHandler.RegisterCloseOpenedFrameScript(this.Page, cp.ToString());
        }
示例#24
0
        void btnMark_Click(object sender, EventArgs e)
        {
            CommandParameters cp = new CommandParameters(Request["ReturnCommand"]);

            cp.CommandArguments = new Dictionary <string, string>();
            if (Request["GridId"] != null)
            {
                cp.AddCommandArgument("GridId", Request["GridId"]);
            }
            cp.AddCommandArgument("action", rbAction.SelectedValue);
            CommandHandler.RegisterCloseOpenedFrameScript(this.Page, cp.ToString());
        }
示例#25
0
        /// <summary>
        /// Handles the Click event of the TransitionButton control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        protected void TransitionButton_Click(object sender, EventArgs e)
        {
            if (BlockId > 0 && TransitionList.Items.Count > 0 && TransitionList.SelectedItem != null)
            {
                string selectedTransition = TransitionList.SelectedValue;
                TimeTrackingManager.MakeTransitionWithComment(BlockId, new Guid(selectedTransition), TTBlockComment.Value);

                string cmd = String.Empty;
                if (Request["cmd"] != null)
                    cmd = Request["cmd"];
                CommandParameters cp = new CommandParameters(cmd);
                Mediachase.Ibn.Web.UI.WebControls.CommandHandler.RegisterCloseOpenedFrameScript(this.Page, cp.ToString());
            }
        }
示例#26
0
        /// <summary>
        /// Handles the Click event of the btnSaveBlock control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        protected void btnSaveBlock_Click(object sender, EventArgs e)
        {
            using (TransactionScope tran = DataContext.Current.BeginTransaction())
            {
                TimeTrackingBlock ttb = MetaObjectActivator.CreateInstance<TimeTrackingBlock>(TimeTrackingBlock.GetAssignedMetaClass(), this.ObjectId);

                ProcessCollection(this.frmViewBlock.Controls, ttb);

                ttb.Save();

                tran.Commit();
            }

            CommandParameters cp = new CommandParameters("MC_TimeTracking_EditGridFrame");
            Mediachase.Ibn.Web.UI.WebControls.CommandHandler.RegisterCloseOpenedFrameScript(this.Page, cp.ToString());
        }
示例#27
0
        protected void btnSave_ServerClick(object sender, System.EventArgs e)
        {
            if (ddGroups.SelectedItem!=null)
            {
                int PTaskID = int.Parse(ddGroups.SelectedItem.Value);

                int lag;
                if (tbH.Text.Trim().StartsWith("-"))
                    lag = int.Parse(tbH.Text) * 60 - int.Parse(tbMin.Text);
                else
                    lag = int.Parse(tbH.Text) * 60 + int.Parse(tbMin.Text);
                Task.CreatePredecessor(TaskID,PTaskID,lag);
            }
            //Response.Redirect("../Tasks/TaskView.aspx?TaskID=" + TaskID);
            CommandParameters cp = new CommandParameters("MC_PM_TaskRedirect");
            Mediachase.Ibn.Web.UI.WebControls.CommandHandler.RegisterCloseOpenedFrameScript(this.Page, cp.ToString());
        }
示例#28
0
        public void btnDoImport_Click(object sender, EventArgs e)
        {
            CommandParameters           cp  = new CommandParameters("cmdDoImport");
            Dictionary <string, string> dic = new Dictionary <string, string>();

            if (rbExistingSite.Checked)
            {
                dic["SiteId"] = ddlExistingSite.SelectedValue;
            }
            else
            {
                dic["SiteId"] = Guid.Empty.ToString();
            }

            cp.CommandArguments = dic;

            CommandHandler.RegisterCloseOpenedFrameScript(this.Page, cp.ToString());
        }
示例#29
0
        protected void btnSave_Click(object sender, System.EventArgs e)
        {
            DataTable dt = (DataTable)ViewState["Participants"];
            Hashtable ht = new Hashtable();
            foreach (DataRow dr in dt.Rows)
                ht.Add((int)dr["EMailIssueExternalRecipientId"], dr["EMail"].ToString());
            EMailIssueExternalRecipient.Update(IncidentID, ht);

            if (Request["closeFramePopup"] != null)
            {
                CommandParameters cp = new CommandParameters("MC_HDM_RecipEdit");
                Mediachase.Ibn.Web.UI.WebControls.CommandHandler.RegisterCloseOpenedFrameScript(this.Page, cp.ToString());
            }
            else
                Page.ClientScript.RegisterStartupScript(this.GetType(), Guid.NewGuid().ToString(),
                      "<script language=javascript>" +
                      "try {window.opener.location.href='IncidentView.aspx?IncidentId=" + IncidentID + "';}" +
                      "catch (e){}window.close();</script>");
        }
示例#30
0
        protected void AddButton_Click(object sender, EventArgs e)
        {
            DateTime startDate = DateTime.Parse(Request["uid"], CultureInfo.InvariantCulture);
            DateTime destStartDate = CHelper.GetWeekStartByDate(DTCWeek.SelectedDate);

            if (startDate.Date != destStartDate.Date)
            {
                TimeTrackingEntry[] mas = TimeTrackingEntry.List(FilterElement.EqualElement("OwnerId", Mediachase.IBN.Business.Security.CurrentUser.UserID), FilterElement.EqualElement("StartDate", startDate));
                List<int> entryIds = new List<int>();
                foreach (TimeTrackingEntry tte in mas)
                    entryIds.Add((int)tte.PrimaryKeyId.Value);
                if (entryIds.Count > 0)
                    TimeTrackingManager.AddEntries(destStartDate, Mediachase.IBN.Business.Security.CurrentUser.UserID, entryIds);
            }

            // Refresh parent window
            CommandParameters cp = new CommandParameters("MC_TT_CloneWeek");
            Mediachase.Ibn.Web.UI.WebControls.CommandHandler.RegisterCloseOpenedFrameScript(this.Page, cp.ToString());
        }
示例#31
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            this.Page.Validate();
            if (!this.Page.IsValid)
            {
                return;
            }

            if (ObjectId != PrimaryKeyId.Empty)
            {
                _bindObject = MetaObjectActivator.CreateInstance <BusinessObject>(MetaDataWrapper.ResolveMetaClassByNameOrCardName(ClassName), ObjectId);
            }
            else
            {
                _bindObject = MetaObjectActivator.CreateInstance <BusinessObject>(MetaDataWrapper.ResolveMetaClassByNameOrCardName(ClassName));
            }

            if (_bindObject != null)
            {
                ProcessCollection(this.Page.Controls, (BusinessObject)_bindObject);

                ((BusinessObject)_bindObject).Save();

                PrimaryKeyId objectId = ((BusinessObject)_bindObject).PrimaryKeyId.Value;

                if (Mode.ToLower() == "popup")
                {
                    string param = "";
                    if (!String.IsNullOrEmpty(CommandName))
                    {
                        CommandParameters cp = new CommandParameters(CommandName);
                        param = cp.ToString();
                    }
                    Mediachase.Ibn.Web.UI.WebControls.CommandHandler.GetCloseOpenedFrameScript(this.Page, param);
                }
                else
                {
                    Response.Redirect(CHelper.GetLinkObjectView_Edit(ClassName, objectId.ToString()));
                }
            }
        }
示例#32
0
        void btnSave_ServerClick(object sender, EventArgs e)
        {
            ProcessItem(Title1.Text.Trim(), StartDate1.SelectedDate, FinishDate1.SelectedDate, int.Parse(PriorityList1.SelectedValue), int.Parse(ResourcesList1.SelectedValue));
            ProcessItem(Title2.Text.Trim(), StartDate2.SelectedDate, FinishDate2.SelectedDate, int.Parse(PriorityList2.SelectedValue), int.Parse(ResourcesList2.SelectedValue));
            ProcessItem(Title3.Text.Trim(), StartDate3.SelectedDate, FinishDate3.SelectedDate, int.Parse(PriorityList3.SelectedValue), int.Parse(ResourcesList3.SelectedValue));
            ProcessItem(Title4.Text.Trim(), StartDate4.SelectedDate, FinishDate4.SelectedDate, int.Parse(PriorityList4.SelectedValue), int.Parse(ResourcesList4.SelectedValue));
            ProcessItem(Title5.Text.Trim(), StartDate5.SelectedDate, FinishDate5.SelectedDate, int.Parse(PriorityList5.SelectedValue), int.Parse(ResourcesList5.SelectedValue));
            ProcessItem(Title6.Text.Trim(), StartDate6.SelectedDate, FinishDate6.SelectedDate, int.Parse(PriorityList6.SelectedValue), int.Parse(ResourcesList6.SelectedValue));
            ProcessItem(Title7.Text.Trim(), StartDate7.SelectedDate, FinishDate7.SelectedDate, int.Parse(PriorityList7.SelectedValue), int.Parse(ResourcesList7.SelectedValue));
            ProcessItem(Title8.Text.Trim(), StartDate8.SelectedDate, FinishDate8.SelectedDate, int.Parse(PriorityList8.SelectedValue), int.Parse(ResourcesList8.SelectedValue));

            string cmd = String.Empty;

            if (Request["CommandName"] != null)
            {
                CommandParameters cp = new CommandParameters(Request["CommandName"]);
                cmd = cp.ToString();
            }

            Mediachase.Ibn.Web.UI.WebControls.CommandHandler.RegisterCloseOpenedFrameScript(this.Page, cmd, true);
        }
示例#33
0
        void btnSave_ServerClick(object sender, EventArgs e)
        {
            txtTitle.Text       = HttpUtility.HtmlEncode(txtTitle.Text);
            txtDescription.Text = HttpUtility.HtmlEncode(txtDescription.Text);

            ArrayList resources = new ArrayList();

            foreach (ListItem li in lbSelected.Items)
            {
                resources.Add(int.Parse(li.Value));
            }
            if (resources.Count == 0)
            {
                resources.Add(Mediachase.IBN.Business.Security.CurrentUser.UserID);
            }

            PrimaryKeyId org_id     = PrimaryKeyId.Empty;
            PrimaryKeyId contact_id = PrimaryKeyId.Empty;

            Mediachase.IBN.Business.Common.GetDefaultClient(PortalConfig.ToDoDefaultValueClientField, out contact_id, out org_id);

            ToDo.Create(_projectId, Mediachase.IBN.Business.Security.CurrentUser.UserID, txtTitle.Text,
                        txtDescription.Text, DateTime.MinValue, dueDate.SelectedDate, int.Parse(ddPriority.SelectedValue),
                        int.Parse(PortalConfig.ToDoDefaultValueActivationTypeField),
                        int.Parse(PortalConfig.ToDoDefaultValueCompetionTypeField),
                        bool.Parse(PortalConfig.ToDoDefaultValueMustConfirmField),
                        int.Parse(PortalConfig.ToDoDefaultValueTaskTimeField),
                        Mediachase.IBN.Business.Common.StringToArrayList(PortalConfig.ToDoDefaultValueGeneralCategoriesField),
                        null, null, resources, contact_id, org_id);

            string cmd = String.Empty;

            if (Request["CommandName"] != null)
            {
                CommandParameters cp = new CommandParameters(Request["CommandName"]);
                cmd = cp.ToString();
            }

            Mediachase.Ibn.Web.UI.WebControls.CommandHandler.RegisterCloseOpenedFrameScript(this.Page, cmd, cbUpdateParent.Checked);
        }
示例#34
0
    // ==================================================================================
    /// <summary>
    /// This method gets a parameter value.
    /// </summary>
    /// <param name="Name">String: the name of the parameter.</param>
    /// <returns> String value of the header element</returns>
    // ---------------------------------------------------------------------------------
    public String GetParameter ( CommandParameters Name )
    {
      //
      // get the string value of the parameter list.
      //
      String name = Name.ToString ( );
      name = name.Trim ( );

      //
      // Iterate through the parameters to get the selectev value.
      //
      foreach ( Parameter parameter in this._ParameterList )
      {
        if ( parameter.Name == name )
        {
          return parameter.Value;
        }
      }

      return string.Empty;

    }//END GetParameter method
示例#35
0
    }//END AddParameter method

    // ==================================================================================
    /// <summary>
    /// This method adds a parameter to the command's parameter list..
    /// </summary>
    /// <param name="Name">String: The name of the parameter.</param>
    /// <param name="Value">String: The value of the parameter.</param>
    //  ---------------------------------------------------------------------------------
    public void AddParameter ( CommandParameters Name, object Value )
    {
      //
      // get the string value of the parameter list.
      //
      String name = Name.ToString ( );
      name = name.Trim ( );
      String value = Value.ToString ( );

      foreach ( Parameter parameter in this._ParameterList )
      {
        if ( parameter.Name == name )
        {
          parameter.Value = value;

          return;
        }
      }

      this._ParameterList.Add ( new Parameter ( name, value ) );

    }//END AddParameter method
示例#36
0
        /// <summary>
        /// Handles the Click event of the SaveButton control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        protected void SaveButton_Click(object sender, EventArgs e)
        {
            ExpressionDto dto = (ExpressionDto)HttpContext.Current.Session[_ExpressionDtoEditSessionKey];

            if (dto != null)
            {
                ExpressionFilter = ExprFilter.NodeCollection[0].ChildNodes;

                ExprFilter.Visible    = true;
                ExprFilter.DataSource = dto;
                ExprFilter.Provider.SaveFilters(_RulesPrefix, ExpressionId.ToString(), ExpressionFilter);
                ExpressionDto.ExpressionRow row = null;
                if (ExpressionId == 0) // get the last row added
                {
                    row = dto.Expression[dto.Expression.Count - 1];
                }
                else
                {
                    row = dto.Expression.FindByExpressionId(ExpressionId);
                }

                row.Name = ExpressionName.Text;
            }
            else
            {
                ExprFilter.Visible = false;
            }
            ////Serialize FilterExpression in segment table
            //if (_SegmentDto != null && _SegmentDto.Segment.Count > 0)
            //{
            //    SegmentDto.SegmentRow row = _SegmentDto.Segment[0];
            //    row.ExpressionFilter = SerializeFilterExpressions(ExpressionFilters);
            //}

            CommandParameters cp = new CommandParameters(_RuleEditCommandString);

            CommandHandler.RegisterCloseOpenedFrameScript(this.Page, cp.ToString());
        }
示例#37
0
文件: Clone.ascx.cs 项目: 0anion0/IBN
        protected void AddButton_Click(object sender, EventArgs e)
        {
            DateTime localDate = IBN45Business.User.GetLocalDate(DateTime.UtcNow);
            DateTime destStartDate = IBN45Business.TimeTracking.GetWeekStart(localDate);

            List<int> entryIdList = new List<int>();
            foreach (DataGridItem dgi in MainGrid.Items)
            {
                CheckBox cb = (CheckBox)dgi.FindControl("chkElement");
                if (cb != null && cb.Checked && dgi.Cells[1].Text != ProjectObjectType.ToString(CultureInfo.InvariantCulture))
                {
                    entryIdList.Add(int.Parse(dgi.Cells[0].Text, CultureInfo.InvariantCulture));
                }
            }
            TimeTrackingManager.AddEntries(destStartDate, Mediachase.Ibn.Data.Services.Security.CurrentUserId, entryIdList);

            // After rebind the selected items will be disappeared.
            BindGrid();

            // Refresh parent window
            CommandParameters cp = new CommandParameters("MC_TimeTracking_CopyPrevWeekFrame");
            Mediachase.Ibn.Web.UI.WebControls.CommandHandler.RegisterRefreshParentFromFrameScript(this.Page, cp.ToString());
        }
示例#38
0
        protected void btnSave_ServerClick(object sender, System.EventArgs e)
        {
            if (ddGroups.SelectedItem != null)
            {
                int PTodoID = int.Parse(ddGroups.SelectedValue);

                Mediachase.IBN.Business.ToDo.CreateToDoLink(PTodoID, ToDoID);
            }

            CommandParameters cp = new CommandParameters("MC_PM_ToDoRedirect");

            Mediachase.Ibn.Web.UI.WebControls.CommandHandler.RegisterCloseOpenedFrameScript(this.Page, cp.ToString());
        }
示例#39
0
        /// <summary>
        /// Handles the Click event of the btnSaveReal control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        void btnSaveReal_Click(object sender, EventArgs e)
        {
            //TODO:
            foreach (Control c in mainContainer.Controls)
            {
                if (c is IPropertyPageControl)
                {
                    (c as IPropertyPageControl).Save();
                }
            }

            CommandParameters cp = new CommandParameters("MC_Workspace_PropertyPage");
            Mediachase.Ibn.Web.UI.WebControls.CommandHandler.RegisterCloseOpenedFrameScript(this.Page, cp.ToString());
        }
示例#40
0
        private void btnMove_ServerClick(object sender, EventArgs e)
        {
            int iDestFolder = -1;
            try
            {
                iDestFolder = ctrlDirTree.FolderId;
            }
            catch { }
            if (iDestFolder == -1)
            {
                lblNotValid.Visible = true;
                return;
            }

            CommandParameters cp = new CommandParameters("FL_Selected_Move");
            cp.CommandArguments = new System.Collections.Generic.Dictionary<string, string>();
            cp.AddCommandArgument("DestFolderId", iDestFolder.ToString());
            cp.AddCommandArgument("ContainerKey", ContainerKey);
            cp.AddCommandArgument("ContainerName", ContainerName);

            if (Request["GridId"] != null)
            {
                cp.CommandName = "FL_Selected_MoveToFolder";
                cp.AddCommandArgument("GridId", Request["GridId"]);
            }
            Mediachase.Ibn.Web.UI.WebControls.CommandHandler.RegisterCloseOpenedFrameScript(this.Page, cp.ToString());
        }
示例#41
0
        /// <summary>
        /// Handles the ServerClick event of the SaveButton control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        protected void SaveButton_ServerClick(object sender, EventArgs e)
        {
            if (FormatList.Items.Count < 0)
            {
                throw new Exception("Format is not specified");
            }

            Page.Validate();
            if (!Page.IsValid)
            {
                return;
            }

            if (ViewState["_keyLIP"] != null)
            {
                //lip = (ListImportParameters)CHelper.GetFromContext(ViewState["_keyLIP"].ToString());
                //if (lip == null)
                lip = (ListImportParameters)Session[ViewState["_keyLIP"].ToString()];
                if (lip != null)
                {
                    Mediachase.Ibn.Data.Meta.Management.AttributeCollection attr = new Mediachase.Ibn.Data.Meta.Management.AttributeCollection();
                    string sDefaultValue = String.Empty;

                    IManageControl control = MainPlaceHolder.Controls[0] as IManageControl;

                    if (control != null)
                    {
                        sDefaultValue = control.GetDefaultValue(AllowNullsCheckBox.Checked);
                        attr          = control.FieldAttributes;
                    }

                    if (!AllowNullsCheckBox.Checked && sDefaultValue == String.Empty)
                    {
                        if (attr.ContainsKey("NewEnum") || attr.ContainsKey("NewMultiEnum"))
                        {
                            sDefaultValue = "1";
                        }

                        ErrorMessage.Text = GetGlobalResourceObject("IbnFramework.GlobalMetaInfo", "ErrorMessage_AllowNulls").ToString();
                        return;
                    }

                    if (sDefaultValue == null)
                    {
                        sDefaultValue = String.Empty;
                    }

                    string sName;
                    if (!AutogenerateSystemNames)
                    {
                        sName = NameTextBox.Text.Trim();
                    }
                    else
                    {
                        // Generate the field name as the number of seconds elapsed since 2000-01-01
                        sName = String.Format(CultureInfo.InvariantCulture, "Field{0}", CHelper.GetDateDiffInSeconds(DateTime.UtcNow, new DateTime(2000, 1, 1)));
                    }

                    string sFriendlyName = FriendlyNameTextBox.Text.Trim();
                    if (String.IsNullOrEmpty(sFriendlyName))
                    {
                        sFriendlyName = sName;
                    }

                    try
                    {
                        string typeName = FormatList.SelectedValue;
                        if (attr.ContainsKey("NewEnum"))
                        {
                            string name         = attr["EnumName"].ToString();
                            string friendlyname = attr["EnumFriendlyName"].ToString();
                            bool   isPrivate    = (bool)attr["EnumPrivate"];

                            attr.Remove("NewEnum");
                            attr.Remove("EnumName");
                            attr.Remove("EnumFriendlyName");
                            attr.Remove("EnumPrivate");

                            NewEnumInfo nei = new NewEnumInfo();
                            nei.Name           = name;
                            nei.FriendlyName   = friendlyname;
                            nei.MultipleValues = false;
                            nei.IsPrivate      = isPrivate;
                            lip.NewEnumTypes.Add(nei);

                            typeName = name;
                        }
                        //NewMultiEnum
                        if (attr.ContainsKey("NewMultiEnum"))
                        {
                            string name         = attr["EnumName"].ToString();
                            string friendlyname = attr["EnumFriendlyName"].ToString();
                            bool   isPrivate    = (bool)attr["EnumPrivate"];

                            attr.Remove("NewMultiEnum");
                            attr.Remove("EnumName");
                            attr.Remove("EnumFriendlyName");
                            attr.Remove("EnumPrivate");

                            NewEnumInfo nei = new NewEnumInfo();
                            nei.Name           = name;
                            nei.FriendlyName   = friendlyname;
                            nei.MultipleValues = true;
                            nei.IsPrivate      = isPrivate;
                            lip.NewEnumTypes.Add(nei);

                            typeName = name;
                        }

                        MetaFieldType mft = DataContext.Current.MetaModel.RegisteredTypes[FormatList.SelectedValue];
                        if (mft != null && mft.McDataType == McDataType.Enum &&
                            attr.ContainsKey("EnumFriendlyName"))
                        {
                            mft.FriendlyName = attr["EnumFriendlyName"].ToString();
                            attr.Remove("EnumFriendlyName");
                        }

                        MappingRule mr = null;
                        if (ViewState["_field"] != null)
                        {
                            mr = lip.GetRuleByMetaField(ViewState["_field"].ToString());
                            lip.RemoveNewMetaField(ViewState["_field"].ToString());
                        }

                        lip.AddNewMetaField(sName, sFriendlyName, typeName, AllowNullsCheckBox.Checked, sDefaultValue, attr);
                        if (mr != null)
                        {
                            mr.FieldName = sName;
                        }
                        Session[ViewState["_keyLIP"].ToString()] = lip;
                        CommandParameters cp = new CommandParameters(_commandName);
                        Mediachase.Ibn.Web.UI.WebControls.CommandHandler.RegisterCloseOpenedFrameScript(this.Page, cp.ToString());
                        //CHelper.AddToContext("NeedToChangeDataSource", true);
                    }
                    catch (MetaFieldAlreadyExistsException)
                    {
                    }

                    //NameTextBox.Text = String.Empty;
                    //FriendlyNameTextBox.Text = String.Empty;
                }
            }
        }
示例#42
0
        private void GetToolbarItemsFromXml(XPathNavigator node, List <McToolbarItem> itemsCollection)
        {
            foreach (XPathNavigator node1 in node.SelectChildren(string.Empty, string.Empty))
            {
                McToolbarItem mcToolbarItem1 = new McToolbarItem();
                switch (node1.Name)
                {
                case "Text":
                    mcToolbarItem1.ItemType = McToolbarItemType.Text;
                    break;

                case "Splitter":
                    mcToolbarItem1.ItemType = McToolbarItemType.Splitter;
                    break;

                case "Button":
                    mcToolbarItem1.ItemType = McToolbarItemType.Button;
                    break;

                case "Menu":
                    mcToolbarItem1.ItemType = McToolbarItemType.Menu;
                    break;

                case "SplitButton":
                    mcToolbarItem1.ItemType = McToolbarItemType.SplitButton;
                    break;

                default:
                    throw new NotSupportedException(string.Format("Unknown nodeType: {0}", (object)node.Name));
                }
                string                attribute1          = node1.GetAttribute("id", string.Empty);
                string                attribute2          = node1.GetAttribute("text", string.Empty);
                string                attribute3          = node1.GetAttribute("imageUrl", string.Empty);
                string                attribute4          = node1.GetAttribute("cssClass", string.Empty);
                string                attribute5          = node1.GetAttribute("align", string.Empty);
                string                attribute6          = node1.GetAttribute("handler", string.Empty);
                string                attribute7          = node1.GetAttribute("commandName", string.Empty);
                string                attribute8          = node1.GetAttribute("itemSplitter", string.Empty);
                string                attribute9          = node1.GetAttribute("tooltip", string.Empty);
                string                attribute10         = node1.GetAttribute("permissions", string.Empty);
                McToolbarItemAlign    toolbarItemAlign    = McToolbarItemAlign.Left;
                McToolbarItemSplitter toolbarItemSplitter = McToolbarItemSplitter.None;
                if (attribute5 != string.Empty)
                {
                    try
                    {
                        toolbarItemAlign = (McToolbarItemAlign)Enum.Parse(typeof(McToolbarItemAlign), attribute5);
                    }
                    catch
                    {
                        throw;
                    }
                }
                if (attribute8 != string.Empty)
                {
                    try
                    {
                        toolbarItemSplitter = (McToolbarItemSplitter)Enum.Parse(typeof(McToolbarItemSplitter), attribute8);
                    }
                    catch
                    {
                        throw;
                    }
                }
                mcToolbarItem1.Id   = attribute1;
                mcToolbarItem1.Text = UtilHelper.GetResFileString(attribute2);
                if (attribute3 != string.Empty && (mcToolbarItem1.ItemType == McToolbarItemType.Button || mcToolbarItem1.ItemType == McToolbarItemType.SplitButton || mcToolbarItem1.ItemType == McToolbarItemType.Menu))
                {
                    mcToolbarItem1.CssClass += "x-btn-wrap x-btn x-btn-text-icon ";
                }
                mcToolbarItem1.ImageUrl  = this.ResolveClientUrl(attribute3);
                mcToolbarItem1.CssClass += attribute4;
                mcToolbarItem1.ItemAlign = toolbarItemAlign;
                mcToolbarItem1.Handler   = attribute6;
                mcToolbarItem1.Tooltip   = UtilHelper.GetResFileString(attribute9);
                CommandParameters           cp         = new CommandParameters(attribute7);
                Dictionary <string, string> dictionary = new Dictionary <string, string>();
                dictionary.Add("GridId", this.GridId);
                dictionary.Add("GridClientId", this.GridClientId);
                dictionary.Add("permissions", attribute10);
                if (!string.IsNullOrEmpty(this.ContainerId))
                {
                    dictionary.Add("ContainerId", this.ContainerId);
                }
                cp.CommandArguments = dictionary;
                bool isEnabled = true;
                if (attribute7 != string.Empty)
                {
                    string str = CommandManager.GetCurrent(this.Page).AddCommand(this.ClassName, this.ViewName, this.PlaceName, cp, out isEnabled);
                    dictionary.Add("CommandManagerScript", str);
                    cp.CommandArguments    = dictionary;
                    mcToolbarItem1.Params  = cp.ToString();
                    mcToolbarItem1.Handler = "defaultToolbarOnClick";
                }
                if (mcToolbarItem1.ItemType == McToolbarItemType.Menu || mcToolbarItem1.ItemType == McToolbarItemType.SplitButton)
                {
                    if (node1.SelectChildren(string.Empty, string.Empty).Count > 0)
                    {
                        this.GetToolbarItemsFromXml(node1, mcToolbarItem1.Items);
                        if (mcToolbarItem1.Items.Count == 0)
                        {
                            continue;
                        }
                    }
                    else
                    {
                        continue;
                    }
                }
                if (isEnabled && (toolbarItemSplitter == McToolbarItemSplitter.Both || toolbarItemSplitter == McToolbarItemSplitter.Left))
                {
                    McToolbarItem mcToolbarItem2 = new McToolbarItem(McToolbarItemType.Splitter);
                    mcToolbarItem2.ItemAlign = toolbarItemAlign;
                    itemsCollection.Add(mcToolbarItem2);
                }
                if (isEnabled)
                {
                    itemsCollection.Add(mcToolbarItem1);
                }
                if (isEnabled && (toolbarItemSplitter == McToolbarItemSplitter.Both || toolbarItemSplitter == McToolbarItemSplitter.Right))
                {
                    McToolbarItem mcToolbarItem2 = new McToolbarItem(McToolbarItemType.Splitter);
                    mcToolbarItem2.ItemAlign = toolbarItemAlign;
                    itemsCollection.Add(mcToolbarItem2);
                }
            }
        }
示例#43
0
        void btnSave_ServerClick(object sender, EventArgs e)
        {
            ProcessItem(Title1.Text.Trim(), StartDate1.SelectedDate, FinishDate1.SelectedDate, int.Parse(PriorityList1.SelectedValue), int.Parse(ResourcesList1.SelectedValue));
            ProcessItem(Title2.Text.Trim(), StartDate2.SelectedDate, FinishDate2.SelectedDate, int.Parse(PriorityList2.SelectedValue), int.Parse(ResourcesList2.SelectedValue));
            ProcessItem(Title3.Text.Trim(), StartDate3.SelectedDate, FinishDate3.SelectedDate, int.Parse(PriorityList3.SelectedValue), int.Parse(ResourcesList3.SelectedValue));
            ProcessItem(Title4.Text.Trim(), StartDate4.SelectedDate, FinishDate4.SelectedDate, int.Parse(PriorityList4.SelectedValue), int.Parse(ResourcesList4.SelectedValue));
            ProcessItem(Title5.Text.Trim(), StartDate5.SelectedDate, FinishDate5.SelectedDate, int.Parse(PriorityList5.SelectedValue), int.Parse(ResourcesList5.SelectedValue));
            ProcessItem(Title6.Text.Trim(), StartDate6.SelectedDate, FinishDate6.SelectedDate, int.Parse(PriorityList6.SelectedValue), int.Parse(ResourcesList6.SelectedValue));
            ProcessItem(Title7.Text.Trim(), StartDate7.SelectedDate, FinishDate7.SelectedDate, int.Parse(PriorityList7.SelectedValue), int.Parse(ResourcesList7.SelectedValue));
            ProcessItem(Title8.Text.Trim(), StartDate8.SelectedDate, FinishDate8.SelectedDate, int.Parse(PriorityList8.SelectedValue), int.Parse(ResourcesList8.SelectedValue));

            string cmd = String.Empty;
            if (Request["CommandName"] != null)
            {
                CommandParameters cp = new CommandParameters(Request["CommandName"]);
                cmd = cp.ToString();
            }

            Mediachase.Ibn.Web.UI.WebControls.CommandHandler.RegisterCloseOpenedFrameScript(this.Page, cmd, true);
        }
示例#44
0
文件: Clone.ascx.cs 项目: 0anion0/IBN
 protected void CloseButton_Click(object sender, EventArgs e)
 {
     CommandParameters cp = new CommandParameters("MC_TimeTracking_CopyPrevWeekFrame");
     Mediachase.Ibn.Web.UI.WebControls.CommandHandler.RegisterCloseOpenedFrameScript(this.Page, cp.ToString());
 }
示例#45
0
        protected void btnSave_Click(object sender, System.EventArgs e)
        {
            DataTable dt = (DataTable)ViewState["Resources"];
            string sResponsible = "";
            foreach (DataRow dr in dt.Rows)
                sResponsible += dr["UserId"].ToString() + ((bool)dr["Status"] ? "*1" : "*0") + ((bool)dr["IsNew"] ? "*1_" : "*0_");

            if (Request["Command"] != null)
            {
                CommandParameters cp = new CommandParameters(Request["Command"]);
                cp.CommandArguments = new System.Collections.Generic.Dictionary<string, string>();
                cp.AddCommandArgument("Key", sResponsible);

                Mediachase.Ibn.Web.UI.WebControls.CommandHandler.RegisterCloseOpenedFrameScript(this.Page, cp.ToString());
            }
            else
                Page.ClientScript.RegisterStartupScript(this.GetType(), Guid.NewGuid().ToString(),
                      "<script language=javascript>" +
                      String.Format("try{{window.opener.{0};}} catch (e){{}} window.close();", RefreshButton.Replace("xxx", sResponsible)) +
                      "</script>");
        }
示例#46
0
        /// <summary>
        /// Handles the Click event of the btnSaveEntry control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        protected void btnSaveEntry_Click(object sender, EventArgs e)
        {
            double maxMinutes = (double)(24 * 60);
            TimeTrackingEntry tte = MetaObjectActivator.CreateInstance<TimeTrackingEntry>(TimeTrackingEntry.GetAssignedMetaClass(), this.ObjectId);
            tte.Day1 = Math.Min((new TimeSpan(Day1Time.Value.Ticks)).TotalMinutes, maxMinutes);
            tte.Day2 = Math.Min((new TimeSpan(Day2Time.Value.Ticks)).TotalMinutes, maxMinutes);
            tte.Day3 = Math.Min((new TimeSpan(Day3Time.Value.Ticks)).TotalMinutes, maxMinutes);
            tte.Day4 = Math.Min((new TimeSpan(Day4Time.Value.Ticks)).TotalMinutes, maxMinutes);
            tte.Day5 = Math.Min((new TimeSpan(Day5Time.Value.Ticks)).TotalMinutes, maxMinutes);
            tte.Day6 = Math.Min((new TimeSpan(Day6Time.Value.Ticks)).TotalMinutes, maxMinutes);
            tte.Day7 = Math.Min((new TimeSpan(Day7Time.Value.Ticks)).TotalMinutes, maxMinutes);

            ProcessCollection(this.frmView.Controls, tte);

            tte.Save();

            CommandParameters cp = new CommandParameters("MC_TimeTracking_EditGridFrame");
            Mediachase.Ibn.Web.UI.WebControls.CommandHandler.RegisterCloseOpenedFrameScript(this.Page, cp.ToString());
        }
示例#47
0
        /// <summary>
        /// Gets the toolbar items from XML.
        /// </summary>
        /// <param name="node">The node.</param>
        /// <param name="itemsCollection">The items collection.</param>
        private void GetToolbarItemsFromXml(XPathNavigator node, List<McToolbarItem> itemsCollection)
        {
            foreach (XPathNavigator toolbarItem in node.SelectChildren(string.Empty, string.Empty))
            {
                McToolbarItem item = new McToolbarItem();

                switch (toolbarItem.Name)
                {
                    case "Text":
                        {
                            item.ItemType = McToolbarItemType.Text;
                            break;
                        }
                    case "Splitter":
                        {
                            item.ItemType = McToolbarItemType.Splitter;
                            break;
                        }
                    case "Button":
                        {
                            item.ItemType = McToolbarItemType.Button;
                            break;
                        }
                    case "Menu":
                        {
                            item.ItemType = McToolbarItemType.Menu;
                            break;
                        }
                    case "SplitButton":
                        {
                            item.ItemType = McToolbarItemType.SplitButton;
                            break;
                        }
                    default:
                        {
                            throw new NotSupportedException(String.Format("Unknown nodeType: {0}", node.Name));
                        }
                }

                string Id = toolbarItem.GetAttribute("id", string.Empty);
                string Text = toolbarItem.GetAttribute("text", string.Empty);
                string ImageUrl = toolbarItem.GetAttribute("imageUrl", string.Empty);
                string CssClass = toolbarItem.GetAttribute("cssClass", string.Empty);
                string Align = toolbarItem.GetAttribute("align", string.Empty);
                string Handler = toolbarItem.GetAttribute("handler", string.Empty);
                string CommandName = toolbarItem.GetAttribute("commandName", string.Empty);
                string ItemSplitter = toolbarItem.GetAttribute("itemSplitter", string.Empty);
                string Tooltip = toolbarItem.GetAttribute("tooltip", string.Empty);

                McToolbarItemAlign itemAlign = McToolbarItemAlign.Left;
                McToolbarItemSplitter itemSplitter = McToolbarItemSplitter.None;

                #region Set enum: McToolbarItemAlign
                if (Align != string.Empty)
                {
                    try
                    {
                        itemAlign = (McToolbarItemAlign)Enum.Parse(typeof(McToolbarItemAlign), Align);
                    }
                    catch
                    {
                        throw;
                    }
                }
                #endregion

                #region Set enum: McToolbarItemSplitter
                if (ItemSplitter != string.Empty)
                {
                    try
                    {
                        itemSplitter = (McToolbarItemSplitter)Enum.Parse(typeof(McToolbarItemSplitter), ItemSplitter);
                    }
                    catch
                    {
                        throw;
                    }
                }
                #endregion

                item.Id = Id;
                item.Text = CHelper.GetResFileString(Text);

                if (ImageUrl != string.Empty && (item.ItemType == McToolbarItemType.Button || item.ItemType == McToolbarItemType.SplitButton))
                    item.CssClass += "x-btn-wrap x-btn x-btn-text-icon ";

                item.ImageUrl = this.ResolveClientUrl(ImageUrl); // this.ResolveUrl dont work here
                item.CssClass += CssClass;
                item.ItemAlign = itemAlign;
                item.Handler = Handler;
                item.Tooltip = CHelper.GetResFileString(Tooltip);

                CommandParameters param = new CommandParameters(CommandName);

                Dictionary<string, string> dic = new Dictionary<string, string>();
                dic.Add("GridId", this.GridId);
                param.CommandArguments = dic;
                bool isEnable = true;

                if (CommandName != string.Empty)
                {
                    string commandManagerScript = CommandManager.GetCurrent(this.Page).AddCommand(this.ClassName, this.ViewName, this.PlaceName, param, out isEnable);
                    dic.Add("CommandManagerScript", commandManagerScript);

                    item.Params = param.ToString();
                    item.Handler = defaultClientHandler;
                }

                if (item.ItemType == McToolbarItemType.Menu || item.ItemType == McToolbarItemType.SplitButton)
                    GetToolbarItemsFromXml(toolbarItem, item.Items);

                if (isEnable && (itemSplitter == McToolbarItemSplitter.Both || itemSplitter == McToolbarItemSplitter.Left))
                {
                    McToolbarItem splitItem = new McToolbarItem(McToolbarItemType.Splitter);
                    splitItem.ItemAlign = itemAlign;
                    itemsCollection.Add(splitItem);
                }

                if (isEnable)
                    itemsCollection.Add(item);

                if (isEnable && (itemSplitter == McToolbarItemSplitter.Both || itemSplitter == McToolbarItemSplitter.Right))
                {
                    McToolbarItem splitItem = new McToolbarItem(McToolbarItemType.Splitter);
                    splitItem.ItemAlign = itemAlign;
                    itemsCollection.Add(splitItem);
                }
            }
        }
示例#48
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            this.Page.Validate();
            if (!this.Page.IsValid)
                return;

            if (ObjectId != PrimaryKeyId.Empty)
                _bindObject = MetaObjectActivator.CreateInstance<BusinessObject>(MetaDataWrapper.ResolveMetaClassByNameOrCardName(ClassName), ObjectId);
            else
                _bindObject = MetaObjectActivator.CreateInstance<BusinessObject>(MetaDataWrapper.ResolveMetaClassByNameOrCardName(ClassName));

            if (_bindObject != null)
            {
                ProcessCollection(this.Page.Controls, (BusinessObject)_bindObject);

                ((BusinessObject)_bindObject).Save();

                PrimaryKeyId objectId = ((BusinessObject)_bindObject).PrimaryKeyId.Value;

                if (Mode.ToLower() == "popup")
                {
                    string param = "";
                    if (!String.IsNullOrEmpty(CommandName))
                    {
                        CommandParameters cp = new CommandParameters(CommandName);
                        param = cp.ToString();
                    }
                    Mediachase.Ibn.Web.UI.WebControls.CommandHandler.GetCloseOpenedFrameScript(this.Page, param);
                }
                else
                {
                    Response.Redirect(CHelper.GetLinkObjectView_Edit(ClassName, objectId.ToString()));
                }
            }
        }
示例#49
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            AccessControlList ACLr = (AccessControlList)ViewState["ACL"];
            try
            {
                AccessControlList.SetACL(fs, ACLr);

                CommandParameters cp = new CommandParameters("FL_Security");

                if (Request["PrimaryKeyId"] != null)
                {
                    cp.CommandName = "FL_Storage_SecureItem";
                    Mediachase.Ibn.Web.UI.WebControls.CommandHandler.GetCloseOpenedFrameScript(this.Page, cp.ToString());
                }
                else
                {
                    if (Request["New"] != null)
                        Mediachase.Ibn.Web.UI.WebControls.CommandHandler.GetCloseOpenedFrameScript(this.Page, cp.ToString());
                    else
                        CHelper.CloseItAndRefresh(Response);
                }
            }
            catch (AllUserAccessWillBeDeniedException)
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), Guid.NewGuid().ToString(),
                            "openMenuLostrights();", true);
            }
            catch (AdminAccessWillBeDeniedException)
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), Guid.NewGuid().ToString(),
                            "openMenuLostrights();", true);
            }
        }
示例#50
0
        protected void PriorityList_ItemCommand(object source, DataListCommandEventArgs e)
        {
            int priorityId = int.Parse(e.CommandArgument.ToString());

            if (ObjectTypeId == (int)ObjectTypes.Task)
                Task2.UpdatePriority(ObjectId, priorityId);
            else if (ObjectTypeId == (int)ObjectTypes.ToDo)
                ToDo2.UpdatePriority(ObjectId, priorityId);
            else if (ObjectTypeId == (int)ObjectTypes.Issue)
                Issue2.UpdatePriority(ObjectId, priorityId);
            else if (ObjectTypeId == (int)ObjectTypes.Document)
            {
                if (AssignmentId.HasValue)
                {
                    AssignmentEntity assignment = (AssignmentEntity)BusinessManager.Load(AssignmentEntity.ClassName, (PrimaryKeyId)AssignmentId.Value);
                    if (priorityId == (int)Priority.Low)
                        assignment.Priority = (int)AssignmentPriority.Low;
                    else if (priorityId == (int)Priority.Normal)
                        assignment.Priority = (int)AssignmentPriority.Normal;
                    else if (priorityId == (int)Priority.High)
                        assignment.Priority = (int)AssignmentPriority.High;
                    else if (priorityId == (int)Priority.VeryHigh)
                        assignment.Priority = (int)AssignmentPriority.VeryHigh;
                    else
                        assignment.Priority = (int)AssignmentPriority.Urgent;

                    BusinessManager.Update(assignment);
                }
            }

            CommandParameters cp = new CommandParameters(CommandName);
            Mediachase.Ibn.Web.UI.WebControls.CommandHandler.RegisterCloseOpenedFrameScript(this.Page, cp.ToString(), true);
        }
示例#51
0
        protected void btnSave_Click(object sender, System.EventArgs e)
        {
            SynchronizeDT();
            //Page.RegisterStartupScript("DisableButtons","DisableButtons(this);");
            DataTable dt = (DataTable)ViewState["Resources"];

            Mediachase.IBN.Business.Task2.UpdateResources(TaskID, dt);

            if (Request["FromCreate"] != null)
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), Guid.NewGuid().ToString(),
                                                        String.Format(CultureInfo.InvariantCulture, "javascript:try{{window.parent.{0}();}}catch(ex){{;}}", Request["closeFramePopup"]), true);
            }
            else if (Request["closeFramePopup"] != null)
            {
                CommandParameters cp = new CommandParameters("MC_PM_TaskResEdit");
                Mediachase.Ibn.Web.UI.WebControls.CommandHandler.RegisterCloseOpenedFrameScript(this.Page, cp.ToString());
            }
            else
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), Guid.NewGuid().ToString(),
                                                        "try {window.opener.top.frames['right'].location.href='../Tasks/TaskView.aspx?TaskId=" + TaskID + "';}" +
                                                        "catch (e){} window.close();", true);
            }
        }
示例#52
0
        /// <summary>
        /// Handles the ServerClick event of the SaveButton control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        protected void SaveButton_ServerClick(object sender, EventArgs e)
        {
            if (FormatList.Items.Count < 0)
                throw new Exception("Format is not specified");

            Page.Validate();
            if (!Page.IsValid)
                return;

            if (ViewState["_keyLIP"] != null)
            {
                //lip = (ListImportParameters)CHelper.GetFromContext(ViewState["_keyLIP"].ToString());
                //if (lip == null)
                lip = (ListImportParameters)Session[ViewState["_keyLIP"].ToString()];
                if (lip != null)
                {

                    Mediachase.Ibn.Data.Meta.Management.AttributeCollection attr = new Mediachase.Ibn.Data.Meta.Management.AttributeCollection();
                    string sDefaultValue = String.Empty;

                    IManageControl control = MainPlaceHolder.Controls[0] as IManageControl;

                    if (control != null)
                    {
                        sDefaultValue = control.GetDefaultValue(AllowNullsCheckBox.Checked);
                        attr = control.FieldAttributes;
                    }

                    if (!AllowNullsCheckBox.Checked && sDefaultValue == String.Empty)
                    {
                        if (attr.ContainsKey("NewEnum") || attr.ContainsKey("NewMultiEnum"))
                            sDefaultValue = "1";

                        ErrorMessage.Text = GetGlobalResourceObject("IbnFramework.GlobalMetaInfo", "ErrorMessage_AllowNulls").ToString();
                        return;
                    }

                    if (sDefaultValue == null)
                        sDefaultValue = String.Empty;

                    string sName;
                    if (!AutogenerateSystemNames)
                    {
                        sName = NameTextBox.Text.Trim();
                    }
                    else
                    {
                        // Generate the field name as the number of seconds elapsed since 2000-01-01
                        sName = String.Format(CultureInfo.InvariantCulture, "Field{0}", CHelper.GetDateDiffInSeconds(DateTime.UtcNow, new DateTime(2000, 1, 1)));
                    }

                    string sFriendlyName = FriendlyNameTextBox.Text.Trim();
                    if (String.IsNullOrEmpty(sFriendlyName))
                        sFriendlyName = sName;

                    try
                    {
                        string typeName = FormatList.SelectedValue;
                        if (attr.ContainsKey("NewEnum"))
                        {
                            string name = attr["EnumName"].ToString();
                            string friendlyname = attr["EnumFriendlyName"].ToString();
                            bool isPrivate = (bool)attr["EnumPrivate"];

                            attr.Remove("NewEnum");
                            attr.Remove("EnumName");
                            attr.Remove("EnumFriendlyName");
                            attr.Remove("EnumPrivate");

                            NewEnumInfo nei = new NewEnumInfo();
                            nei.Name = name;
                            nei.FriendlyName = friendlyname;
                            nei.MultipleValues = false;
                            nei.IsPrivate = isPrivate;
                            lip.NewEnumTypes.Add(nei);

                            typeName = name;
                        }
                        //NewMultiEnum
                        if (attr.ContainsKey("NewMultiEnum"))
                        {
                            string name = attr["EnumName"].ToString();
                            string friendlyname = attr["EnumFriendlyName"].ToString();
                            bool isPrivate = (bool)attr["EnumPrivate"];

                            attr.Remove("NewMultiEnum");
                            attr.Remove("EnumName");
                            attr.Remove("EnumFriendlyName");
                            attr.Remove("EnumPrivate");

                            NewEnumInfo nei = new NewEnumInfo();
                            nei.Name = name;
                            nei.FriendlyName = friendlyname;
                            nei.MultipleValues = true;
                            nei.IsPrivate = isPrivate;
                            lip.NewEnumTypes.Add(nei);

                            typeName = name;
                        }

                        MetaFieldType mft = DataContext.Current.MetaModel.RegisteredTypes[FormatList.SelectedValue];
                        if (mft != null && mft.McDataType == McDataType.Enum &&
                            attr.ContainsKey("EnumFriendlyName"))
                        {
                            mft.FriendlyName = attr["EnumFriendlyName"].ToString();
                            attr.Remove("EnumFriendlyName");
                        }

                        MappingRule mr = null;
                        if (ViewState["_field"] != null)
                        {
                            mr = lip.GetRuleByMetaField(ViewState["_field"].ToString());
                            lip.RemoveNewMetaField(ViewState["_field"].ToString());
                        }

                        lip.AddNewMetaField(sName, sFriendlyName, typeName, AllowNullsCheckBox.Checked, sDefaultValue, attr);
                        if (mr != null)
                            mr.FieldName = sName;
                        Session[ViewState["_keyLIP"].ToString()] = lip;
                        CommandParameters cp = new CommandParameters(_commandName);
                        Mediachase.Ibn.Web.UI.WebControls.CommandHandler.RegisterCloseOpenedFrameScript(this.Page, cp.ToString());
                        //CHelper.AddToContext("NeedToChangeDataSource", true);
                    }
                    catch (MetaFieldAlreadyExistsException)
                    {
                    }

                    //NameTextBox.Text = String.Empty;
                    //FriendlyNameTextBox.Text = String.Empty;
                }
            }
        }
示例#53
0
        protected void btnSave_ServerClick(object sender, System.EventArgs e)
        {
            if (ddGroups.SelectedItem != null)
            {
                int PTaskID = int.Parse(ddGroups.SelectedItem.Value);

                int lag;
                if (tbH.Text.Trim().StartsWith("-"))
                {
                    lag = int.Parse(tbH.Text) * 60 - int.Parse(tbMin.Text);
                }
                else
                {
                    lag = int.Parse(tbH.Text) * 60 + int.Parse(tbMin.Text);
                }
                Task.CreatePredecessor(PTaskID, TaskID, lag);
            }
            //Response.Redirect("../Tasks/TaskView.aspx?TaskID=" + TaskID);
            CommandParameters cp = new CommandParameters("MC_PM_TaskRedirect");

            Mediachase.Ibn.Web.UI.WebControls.CommandHandler.RegisterCloseOpenedFrameScript(this.Page, cp.ToString());
        }
示例#54
0
        protected void AddButton_Click(object sender, EventArgs e)
        {
            DateTime localDate     = IBN45Business.User.GetLocalDate(DateTime.UtcNow);
            DateTime destStartDate = IBN45Business.TimeTracking.GetWeekStart(localDate);

            List <int> entryIdList = new List <int>();

            foreach (DataGridItem dgi in MainGrid.Items)
            {
                CheckBox cb = (CheckBox)dgi.FindControl("chkElement");
                if (cb != null && cb.Checked && dgi.Cells[1].Text != ProjectObjectType.ToString(CultureInfo.InvariantCulture))
                {
                    entryIdList.Add(int.Parse(dgi.Cells[0].Text, CultureInfo.InvariantCulture));
                }
            }
            TimeTrackingManager.AddEntries(destStartDate, Mediachase.Ibn.Data.Services.Security.CurrentUserId, entryIdList);

            // After rebind the selected items will be disappeared.
            BindGrid();

            // Refresh parent window
            CommandParameters cp = new CommandParameters("MC_TimeTracking_CopyPrevWeekFrame");

            Mediachase.Ibn.Web.UI.WebControls.CommandHandler.RegisterRefreshParentFromFrameScript(this.Page, cp.ToString());
        }
示例#55
0
 private void BindFromObject(ToolBarItem[] itemCollection, List <McToolbarItem> toolbarItemsCollection)
 {
     if (itemCollection == null)
     {
         return;
     }
     foreach (ToolBarItem toolBarItem in itemCollection)
     {
         McToolbarItem mcToolbarItem1 = new McToolbarItem();
         if (toolBarItem is Menu)
         {
             mcToolbarItem1.ItemType = McToolbarItemType.Menu;
         }
         else if (toolBarItem is Button)
         {
             mcToolbarItem1.ItemType = McToolbarItemType.Button;
         }
         else if (toolBarItem is SplitButton)
         {
             mcToolbarItem1.ItemType = McToolbarItemType.SplitButton;
         }
         else if (toolBarItem is Text)
         {
             mcToolbarItem1.ItemType = McToolbarItemType.Text;
         }
         else if (toolBarItem is Splitter)
         {
             mcToolbarItem1.ItemType = McToolbarItemType.Splitter;
         }
         McToolbarItemAlign    toolbarItemAlign    = McToolbarItemAlign.Left;
         McToolbarItemSplitter toolbarItemSplitter = McToolbarItemSplitter.None;
         if (!string.IsNullOrEmpty(toolBarItem.align))
         {
             try
             {
                 toolbarItemAlign = (McToolbarItemAlign)Enum.Parse(typeof(McToolbarItemAlign), toolBarItem.align);
             }
             catch
             {
                 throw;
             }
         }
         if (!string.IsNullOrEmpty(toolBarItem.itemSplitter))
         {
             try
             {
                 toolbarItemSplitter = (McToolbarItemSplitter)Enum.Parse(typeof(McToolbarItemSplitter), toolBarItem.itemSplitter);
             }
             catch
             {
                 throw;
             }
         }
         if (toolBarItem.imageUrl != string.Empty && (mcToolbarItem1.ItemType == McToolbarItemType.Button || mcToolbarItem1.ItemType == McToolbarItemType.SplitButton || mcToolbarItem1.ItemType == McToolbarItemType.Menu))
         {
             mcToolbarItem1.CssClass += "x-btn-wrap x-btn x-btn-text-icon ";
         }
         mcToolbarItem1.Id        = toolBarItem.id;
         mcToolbarItem1.Text      = this.IsTopMenuWelcomeText(toolBarItem.text) ? this.GetTopMenuWelcomeText(toolBarItem.text) : UtilHelper.GetResFileString(toolBarItem.text);
         mcToolbarItem1.ImageUrl  = this.ResolveClientUrl(toolBarItem.imageUrl);
         mcToolbarItem1.CssClass += toolBarItem.cssClass;
         mcToolbarItem1.ItemAlign = toolbarItemAlign;
         mcToolbarItem1.Handler   = toolBarItem.handler;
         mcToolbarItem1.Tooltip   = UtilHelper.GetResFileString(toolBarItem.tooltip);
         bool isEnabled = true;
         if (!string.IsNullOrEmpty(toolBarItem.commandName))
         {
             CommandParameters           cp         = new CommandParameters(toolBarItem.commandName);
             Dictionary <string, string> dictionary = new Dictionary <string, string>();
             dictionary.Add("GridId", this.GridId);
             dictionary.Add("GridClientId", this.GridClientId);
             dictionary.Add("permissions", toolBarItem.permissions);
             if (!string.IsNullOrEmpty(this.ContainerId))
             {
                 dictionary.Add("ContainerId", this.ContainerId);
             }
             cp.CommandArguments = dictionary;
             string str = CommandManager.GetCurrent(this.Page).AddCommand(this.ClassName, this.ViewName, this.PlaceName, cp, out isEnabled);
             dictionary.Add("CommandManagerScript", str);
             cp.CommandArguments    = dictionary;
             mcToolbarItem1.Params  = cp.ToString();
             mcToolbarItem1.Handler = "defaultToolbarOnClick";
         }
         if (mcToolbarItem1.ItemType == McToolbarItemType.Menu || mcToolbarItem1.ItemType == McToolbarItemType.SplitButton)
         {
             if (toolBarItem is Menu)
             {
                 this.BindFromObject((toolBarItem as Menu).Items, mcToolbarItem1.Items);
             }
             else if (toolBarItem is SplitButton)
             {
                 this.BindFromObject((toolBarItem as SplitButton).Items, mcToolbarItem1.Items);
             }
         }
         if (isEnabled && (toolbarItemSplitter == McToolbarItemSplitter.Both || toolbarItemSplitter == McToolbarItemSplitter.Left))
         {
             McToolbarItem mcToolbarItem2 = new McToolbarItem(McToolbarItemType.Splitter);
             mcToolbarItem2.ItemAlign = toolbarItemAlign;
             toolbarItemsCollection.Add(mcToolbarItem2);
         }
         if (isEnabled)
         {
             toolbarItemsCollection.Add(mcToolbarItem1);
         }
         if (isEnabled && (toolbarItemSplitter == McToolbarItemSplitter.Both || toolbarItemSplitter == McToolbarItemSplitter.Right))
         {
             McToolbarItem mcToolbarItem2 = new McToolbarItem(McToolbarItemType.Splitter);
             mcToolbarItem2.ItemAlign = toolbarItemAlign;
             toolbarItemsCollection.Add(mcToolbarItem2);
         }
     }
 }
示例#56
0
        protected void CloseButton_Click(object sender, EventArgs e)
        {
            CommandParameters cp = new CommandParameters("MC_TimeTracking_CopyPrevWeekFrame");

            Mediachase.Ibn.Web.UI.WebControls.CommandHandler.RegisterCloseOpenedFrameScript(this.Page, cp.ToString());
        }
示例#57
0
        /// <summary>
        /// Handles the FinishButtonClick event of the ucWizard control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.Web.UI.WebControls.WizardNavigationEventArgs"/> instance containing the event data.</param>
        void ucWizard_FinishButtonClick(object sender, WizardNavigationEventArgs e)
        {
            if (ViewState["lip"] != null)
            {
                lip = (ListImportParameters)ViewState["lip"];
                FillDefaultValues(dgMapping, null);
                MappingError[] mas = ListManager.Import(lip);
                if (mas.Length == 0)
                    lblResult.Text = GetGlobalResourceObject("IbnFramework.ListInfo", "tImportWasSuccessfull").ToString();
                else
                {
                    ViewState["ErrorLog"] = ListManager.GetErrorLog(mas);
                    string sAction = String.Format("<a href=\"{1};\">{0}</a>",
                        GetGlobalResourceObject("IbnFramework.ListInfo", "tErrorList").ToString(),
                        this.Page.ClientScript.GetPostBackClientHyperlink(lbErrorLog, ""));

                    lblResult.Text = String.Format(
                        GetGlobalResourceObject("IbnFramework.ListInfo", "tImportWithErrors").ToString(),
                            sAction);
                }
                string cmd = String.Empty;
                if (Request["CommandName"] != null)
                {
                    CommandParameters cp = new CommandParameters(Request["CommandName"]);
                    cmd = cp.ToString();
                }
                Mediachase.Ibn.Web.UI.WebControls.CommandHandler.RegisterRefreshParentWindowScript(this.Page, cmd);
            }
        }
示例#58
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            ListViewProfile profile;

            if (!String.IsNullOrEmpty(_uid))
            {
                profile = ListViewProfile.Load(_className, _uid, String.Empty);
            }
            else
            {
                profile = new ListViewProfile();
            }
            profile.FieldSetName     = ddFieldSets.SelectedValue;
            profile.GroupByFieldName = (ddGroupField.SelectedValue == Project.AvailableGroupField.NotSet.ToString()) ? "" : ddGroupField.SelectedValue;
            profile.Filters          = GetFilters();
            string uid = (!String.IsNullOrEmpty(_uid)) ? _uid : Guid.NewGuid().ToString();

            profile.Id       = uid;
            profile.IsPublic = cbIsPublic.Checked;
            profile.IsSystem = false;
            profile.Name     = txtTitle.Text;
            ListViewProfile.SaveCustomProfile(_className, String.Empty, Mediachase.IBN.Business.Security.CurrentUser.UserID, profile);

            CommandParameters cp = new CommandParameters("MC_PM_NewViewCreated");

            cp.CommandArguments = new System.Collections.Generic.Dictionary <string, string>();
            cp.AddCommandArgument("ViewUid", uid);
            Mediachase.Ibn.Web.UI.WebControls.CommandHandler.RegisterCloseOpenedFrameScript(this.Page, cp.ToString());
        }
示例#59
0
 protected void btnSave_Click(object sender, System.EventArgs e)
 {
     //Page.RegisterStartupScript("onclick","DisableButtons(this);");
     DataTable dt = (DataTable)ViewState["Resources"];
     Mediachase.IBN.Business.ToDo2.UpdateResources(ToDoID, dt);
     if (Request["FromCreate"] != null)
     {
         Page.ClientScript.RegisterStartupScript(this.GetType(), Guid.NewGuid().ToString(),
             String.Format(CultureInfo.InvariantCulture, "javascript:try{{window.parent.{0}();}}catch(ex){{;}}", Request["closeFramePopup"]), true);
     }
     else if (Request["closeFramePopup"] != null)
     {
         CommandParameters cp = new CommandParameters("MC_PM_ToDoResEdit");
         Mediachase.Ibn.Web.UI.WebControls.CommandHandler.RegisterCloseOpenedFrameScript(this.Page, cp.ToString());
     }
     else
         Util.CommonHelper.ReloadTopFrame("ActiveWork.ascx", "../ToDo/ToDoView.aspx?ToDoId=" + ToDoID, Response);
 }
示例#60
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());
        }