public PopUpWindow(BaseUserControl control, string title, int width = 300, int height = 300)
 {
     InitializeComponent();
     this.Width = width;
     this.Height = height;
     WinTitle = title;
     control.ActualParent = this;
     PopUpContainer.Content = control;
 }
Example #2
0
        public static async Task SlideAndFadeInFromTop(this BaseUserControl view, float seconds)
        {
            var    sb    = new Storyboard();
            double width = view.Width > 0 ? view.Height : Height; // Height can be NaN

            sb.AddSlideInFromTop(seconds, width);
            sb.AddFadeIn(seconds);
            sb.Begin(view);
            view.Visibility = Visibility.Visible;

            await Task.Delay((int)(seconds * 1000));
        }
 protected void EgvDeliverItem_RowCommand(object sender, CommandEventArgs e)
 {
     if ((e.CommandName == "Received") && (this.OrderId != "0"))
     {
         int orderId = DataConverter.CLng(this.OrderId);
         DeliverItem.UpdateReceive(orderId);
         Order.Recieve(orderId);
         if (this.ShowOptions == 1)
         {
             BaseUserControl.ResponseRedirect("ShowOrder.aspx?OrderId=" + this.OrderId);
         }
     }
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            CallOnObjectLookUpCalling();

            BaseUserControl ctl = GetCurrentPopUpControl();

            if (ctl is CostCenterLookUp)
            {
                ctl.OnPopUpReturn += new PopUpReturnEventHandler(ctlCostCenterLookup_OnNotifyPopup);
            }
            ctlAutoCostCenter.OnObjectLookUpCalling += new BaseUserControl.ObjectLookUpCallingEventHandler(ctlAutoCostCenter_OnObjectLookUpCalling);
            ctlAutoCostCenter.DataBind();
        }
        protected void ELnkProductHtml_Click(object sender, EventArgs e)
        {
            int num = BaseUserControl.RequestInt32("NodeID");

            if (num > 0)
            {
                BaseUserControl.ResponseRedirect("ProductHtml.aspx?NodeID=" + num.ToString());
            }
            else
            {
                BaseUserControl.ResponseRedirect("ProductHtml.aspx");
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            BaseUserControl ctl = GetCurrentPopUpControl();

            if (ctl is LocationUserLookup)
            {
                ctl.OnPopUpReturn += new PopUpReturnEventHandler(ctlLlocationLookup_OnNotifyPopup);;
            }

            ctlLocationTextBoxAutoComplete.OnObjectLookUpCalling += new BaseUserControl.ObjectLookUpCallingEventHandler(ctlLocationTextBox_OnObjectLookUpCalling);

            ctlLocationTextBoxAutoComplete.DataBind();
        }
Example #7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string userName = BaseUserControl.RequestString("UserName");

            if (string.IsNullOrEmpty(userName))
            {
                userName = PEContext.Current.User.UserName;
            }
            if (!this.Page.IsPostBack)
            {
                this.EgvAddress.DataSource = Address.GetAddressListByUserName(userName);
                this.EgvAddress.DataBind();
            }
        }
 protected void GdvMessageList_RowCommand(object sender, CommandEventArgs e)
 {
     if (e.CommandName == "Del")
     {
         if (Message.Delete(MessageDelType.Id, e.CommandArgument.ToString()))
         {
             this.GdvMessageList.DataBind();
         }
         else
         {
             BaseUserControl.WriteErrMsg("<li>删除失败!!</li>");
         }
     }
 }
Example #9
0
        public void SwitchScene(Scene scene, Object param)
        {
            BaseUserControl ctrl = null;

            switch (scene)
            {
            case Scene.PlayerScene:
            {
                ctrl = new PlayerControl();
                break;
            }

            case Scene.PlayerEditScene:
            {
                ctrl = new PlayerEditControl(param);
                break;
            }

            case Scene.CombatLogScene:
            {
                ctrl = new CombatLogUserControl(param);
                break;
            }

            case Scene.HitLogScene:
            {
                ctrl = new HitLogUserControl(param);
                break;
            }

            default:
            {
                break;
            }
            }


            if (ctrl != null)
            {
                this.MinimumSize = new Size(ctrl.Width + 15, ctrl.Height + 20);
                this.MaximumSize = new Size(ctrl.Width + 15, ctrl.Height + 20);
                mainPanel.Height = ctrl.Height + 20;
                mainPanel.Width  = ctrl.Width + 15;
                this.Text        = ctrl.Name.ToString();
                this.Location    = new Point(Screen.PrimaryScreen.WorkingArea.Width / 2 - this.Width / 2, Screen.PrimaryScreen.WorkingArea.Height / 2 - this.Height / 2);
                ctrl.Dock        = DockStyle.Fill;
                mainPanel.Controls.Clear();
                mainPanel.Controls.Add(ctrl);
            }
        }
Example #10
0
 protected void GdvMessageList_RowCommand(object sender, CommandEventArgs e)
 {
     if (e.CommandName == "Del")
     {
         if (Message.Clear(this.ManageType, PEContext.Current.User.UserName, e.CommandArgument.ToString()))
         {
             this.GdvMessageList.DataBind();
         }
         else
         {
             BaseUserControl.WriteErrMsg("<li>删除失败!!</li>");
         }
     }
 }
Example #11
0
 protected void Page_Load(object sender, EventArgs e)
 {
     this.m_GeneralId      = BaseUserControl.RequestInt32("GeneralID");
     this.contentDataTable = ContentManage.GetContentDataById(this.m_GeneralId);
     if (this.contentDataTable.Rows.Count > 0)
     {
         ModelInfo modelInfoById = ModelManager.GetModelInfoById(DataConverter.CLng(this.contentDataTable.Rows[0]["ModelID"].ToString()));
         this.InitSigin(this.m_GeneralId, modelInfoById.EnableSignIn);
     }
     else
     {
         BaseUserControl.WriteErrMsg("对不起,错误的参数!", SiteConfig.SiteInfo.VirtualPath + "Default.aspx");
     }
 }
Example #12
0
 public void Save()
 {
     for (int i = 0; i < tcMain.Items.Count; i++)
     {
         BaseUserControl baseUserControl = ((TabItem)tcMain.Items[i]).Content as BaseUserControl;
         if (baseUserControl != null)
         {
             if (baseUserControl.isChange)
             {
                 baseUserControl.SaveFile();
             }
         }
     }
 }
Example #13
0
        public bool GotoFile(String fileName)
        {
            BaseUserControl baseUserControl = GetNeedControlBaseUserControl(fileName);
            String          _filePath       = baseUserControl.GetFileDirectory() + fileName;

            ProcessStartInfo psi;

            psi = new ProcessStartInfo("Explorer.exe")
            {
                Arguments = "/e,/select," + _filePath
            };
            Process.Start(psi);
            return(true);
        }
        private void LoadFileList()
        {
            lbMain.Items.Clear();
            BaseUserControl baseUserControl = gMain.Children[0] as BaseUserControl;
            List <String>   fileNames       = FileBusiness.CreateInstance().GetFilesName(baseUserControl.GetFileDirectory(), new List <string>()
            {
                baseUserControl._fileExtension
            });

            for (int i = 0; i < fileNames.Count; i++)
            {
                lbMain.Items.Add(fileNames[i]);
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            string searchType = BaseUserControl.RequestString("SearchType");
            string keyword    = base.Request.Form["Author"];
            int    listType   = BaseUserControl.RequestInt32("ListType", 0);

            if (listType == 0)
            {
                listType = DataConverter.CLng(base.Request.Form["HdnListType"]);
            }
            this.RptAuthorType.DataSource = Choiceset.GetDictionaryFieldValueByName("PE_Author", "Type");
            this.RptAuthorType.DataBind();
            this.AuthorsBindData(listType, searchType, keyword);
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     this.m_IsModify = BaseUserControl.RequestStringToLower("Action") == "modify";
     this.InitializeDropPanel();
     if (!this.Page.IsPostBack && this.m_IsModify)
     {
         List <string> list = new List <string>(this.FieldValue.Split(new string[] { "|" }, StringSplitOptions.RemoveEmptyEntries));
         this.ViewState["ReadOnlyCount"]       = list.Count;
         this.RptSelectPropertyItem.DataSource = list;
         this.RptSelectPropertyItem.DataBind();
         this.ViewState["PropertyItemList" + base.FieldName] = list;
         this.Properties = this.FieldValue;
     }
 }
Example #17
0
        public void IntoUserControl(String fileName, bool checkFileName)
        {
            if (fileName.EndsWith(".mid"))
            {
                TabItem item = new TabItem
                {
                    Header  = fileName,
                    Content = userControls[0]
                };
                tcMain.Items.Add(item);
            }
            else
            {
                for (int i = 0; i < userControls.Count; i++)
                {
                    if (fileName.EndsWith(userControls[i]._fileExtension))
                    {
                        TabItem item = new TabItem
                        {
                            Header  = fileName,
                            Content = userControls[i]
                        };
                        tcMain.Items.Add(item);
                        break;
                    }
                }
            }
            BaseUserControl baseUserControl = tcMain.Items[0] as BaseUserControl;

            if (!fileName.EndsWith(".lightScript"))
            {
            }
            else
            {
                //关闭文件选择器
                //CloseFileControl();
                //baseUserControl = mw.gCenter.Children[0] as BaseUserControl;
                if (baseUserControl.filePath.Equals(mw.LastProjectPath + baseUserControl._fileType + @"\" + fileName) && checkFileName)
                {
                    return;
                }
                if (baseUserControl is ScriptUserControl)
                {
                    (baseUserControl as ScriptUserControl)._bIsEdit = false;
                }
            }
            baseUserControl.filePath = mw.LastProjectPath + baseUserControl._fileType + @"\" + fileName;
            baseUserControl.LoadFile(fileName);
        }
Example #18
0
 private void DropCountryDataBind(string country)
 {
     this.DropCountry.DataSource = Region.GetCountryList();
     this.DropCountry.DataBind();
     if (string.IsNullOrEmpty(country))
     {
         ListItem item = new ListItem("请选择", "");
         this.DropCountry.Items.Insert(0, item);
         this.DropCountry.SelectedIndex = this.DropCountry.Items.IndexOf(item);
     }
     else
     {
         BaseUserControl.SetSelectedIndexByValue(this.DropCountry, country);
     }
 }
Example #19
0
        /// <summary>
        /// Initializes a new instance of the <see cref="App" /> class.
        /// </summary>
        public App()
        {
            BaseUserControl = new BaseUserControl();

            if (CheckForInternetConnection())
            {
                BaseUserControl.InitializeComponent(true);

                IsValidToProcess = true;
            }
            else
            {
                IsValidToProcess = false;
            }
        }
Example #20
0
        private void GoToFile(object sender, RoutedEventArgs e)
        {
            GetNeedControl(sender);
            BaseUserControl baseUserControl = null;

            if (!needControlFileName.EndsWith(".lightScript"))
            {
                if (needControlFileName.EndsWith(".mid"))
                {
                    baseUserControl = userControls[0];
                }
                else
                {
                    for (int i = 0; i < userControls.Count; i++)
                    {
                        if (needControlFileName.EndsWith(userControls[i]._fileExtension))
                        {
                            baseUserControl = userControls[i];
                            break;
                        }
                    }
                }
            }
            else
            {
                baseUserControl = userControls[3] as BaseUserControl;
            }

            if (baseUserControl == null)
            {
                return;
            }
            needControlBaseUserControl = baseUserControl;

            baseUserControl.filePath = needControlFileName;

            String _filePath = baseUserControl.GetFileDirectory() + baseUserControl.filePath;

            Console.WriteLine(_filePath);

            ProcessStartInfo psi;

            psi = new ProcessStartInfo("Explorer.exe")
            {
                Arguments = "/e,/select," + _filePath
            };
            Process.Start(psi);
        }
 protected void DlstAgent_ItemDataBound(object sender, DataListItemEventArgs e)
 {
     if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem))
     {
         LinkButton button = (LinkButton)e.Item.FindControl("LbtnAgentName");
         string     str    = BaseUserControl.RequestString("OpenerText");
         if (string.IsNullOrEmpty(str))
         {
             button.OnClientClick = string.Format("Javascript:opener.__doPostBack(\"AgentList_PostBack\",\"{0}\");window.close();", e.Item.DataItem.ToString());
         }
         else
         {
             button.OnClientClick = "window.opener.document.getElementById('" + str + "').value='" + e.Item.DataItem.ToString() + "';window.close();";
         }
     }
 }
Example #22
0
 private void InitSigin(int generalId, bool enableSignin)
 {
     if (enableSignin)
     {
         SignInContentInfo signInContentByGeneralId = SignInContent.GetSignInContentByGeneralId(generalId);
         if (!signInContentByGeneralId.IsNull)
         {
             this.LblSigninType.Text = BaseUserControl.EnumToHtml <SignInType>(signInContentByGeneralId.SignInType);
             this.LblEndTime.Text    = signInContentByGeneralId.EndTime.ToString();
             this.LblPriority.Text   = signInContentByGeneralId.Priority.ToString();
             this.LblStatus.Text     = BaseUserControl.EnumToHtml <SignInStatus>(signInContentByGeneralId.Status);
         }
         this.RptSigninLog.DataSource = SignInLog.GetList(generalId);
         this.RptSigninLog.DataBind();
     }
 }
Example #23
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                ctlTADocumentEditor.Initialize(FlagEnum.NewFlag, null);

                ctlDivReadWriteButton.Visible = true;
                ctlUpdatePanelReadWriteButton.Update();
            }
            BaseUserControl ctl = GetCurrentPopUpControl();

            if (ctl is ConfirmSubmit)
            {
                ctl.OnPopUpReturn += new BaseUserControl.PopUpReturnEventHandler(ctlConfirmPopup_OnNotifyPopup);
            }
        }
Example #24
0
 protected void Page_Load(object sender, EventArgs e)
 {
     this.m_UrlReferrer = base.Request.UrlReferrer.ToString();
     this.nodeList      = this.xmlDoc.SelectNodes("CreateWork/WorkId");
     this.xmlDoc.Load(this.path);
     RolePermissions.BusinessAccessCheck(OperateCode.CreateHtmlManage);
     this.HdnWorkId.Value = BaseUserControl.RequestString("WorkId");
     if (this.nodeList.Count > 0)
     {
         this.BtnStopCreate.Visible = true;
     }
     else
     {
         this.BtnStopCreate.Visible = false;
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.Page.IsPostBack)
     {
         EasyOne.Model.UserManage.UserInfo userInfo = this.UserInfo;
         if (userInfo == null)
         {
             userInfo = Users.GetUserById(DataConverter.CLng(base.Request.QueryString["UserID"]));
             this.ViewState["UserInfo"] = userInfo;
         }
         if (userInfo.IsNull)
         {
             BaseUserControl.WriteErrMsg("<li>找不到指定的会员!</li>");
         }
         else
         {
             if (string.IsNullOrEmpty(userInfo.GroupName))
             {
                 userInfo.GroupName = UserGroups.GetUserGroupById(userInfo.GroupId).GroupName;
             }
             this.LblUserName.Text  = userInfo.UserName;
             this.LblUserGroup.Text = userInfo.GroupName;
             if (!SiteConfig.SiteOption.EnablePointMoneyExp)
             {
                 this.Balance.Style.Add("display", "none");
                 this.Point.Style.Add("display", "none");
                 this.UserExp.Style.Add("display", "none");
                 this.EndTime.Style.Add("display", "none");
             }
             else
             {
                 this.LblBalance.Text = userInfo.Balance.ToString("0.00");
                 this.LblPoint.Text   = userInfo.UserPoint.ToString();
                 if (!userInfo.EndTime.HasValue)
                 {
                     this.LblEndTime.Text = "";
                 }
                 else
                 {
                     this.LblEndTime.Text = userInfo.EndTime.Value.ToString("yyyy-MM-dd");
                 }
                 this.LblUserExp.Text   = userInfo.UserExp.ToString();
                 this.LblValidDays.Text = Users.GetValidNum(userInfo.EndTime);
             }
         }
     }
 }
        private void UpdateUserControlExampleText(BaseUserControl baseUserControl)
        {
            var dummyDataField = new DataField(null, baseUserControl.GetFieldOptions(), null, null);

            object value = "N/A";

            try
            {
                value = dummyDataField.Generate();
            }
            catch
            {
                // Just ignore exception
            }

            userControlExample.txtExample.Text = value != null?value.ToString() : "NULL";
        }
        protected void BtnDelete_Click(object sender, EventArgs e)
        {
            StringBuilder selectList = this.GdvMessageList.SelectList;

            if (selectList.Length == 0)
            {
                BaseUserControl.WriteErrMsg("<li>对不起,您还没选择要删除的短消息!</li>");
            }
            else if (Message.Delete(MessageDelType.Id, selectList.ToString()))
            {
                this.GdvMessageList.DataBind();
            }
            else
            {
                BaseUserControl.WriteErrMsg("<li>删除失败!!</li>");
            }
        }
Example #28
0
        private void tsbReport_Click(object sender, EventArgs e)
        {
            //FrmReportBrowser frm = new FrmReportBrowser();
            //frm.ShowDialog();
            this._currentUserCtr = null;

            SetEditButtonsStatus(false);

            ListReport lr = new ListReport();

            this.tlpMainPanel.Controls.Clear();
            //lr.MdiParentForm = this;
            lr.Dock = DockStyle.Fill;
            //.OnSelectedItemChanged += new EventHandler(_currentUserCtr_OnSelectedItemChanged);
            this.lblTitle.Text = "List of reports";
            this.tlpMainPanel.Controls.Add(lr);
        }
 private void RadlTaxRateDataBind()
 {
     if (this.RadlTaxRateType.Items.Count == 0)
     {
         foreach (TaxRateType type in Enum.GetValues(typeof(TaxRateType)))
         {
             ListItem item = new ListItem();
             item.Text  = BaseUserControl.EnumToHtml <TaxRateType>(type);
             item.Value = ((int)type).ToString();
             if (type == TaxRateType.BarringTaxNeedInvoiceNoTax)
             {
                 item.Selected = true;
             }
             this.RadlTaxRateType.Items.Add(item);
         }
     }
 }
        /// <summary>
        /// Switch from a view to another view when user chose another screen in the footer menu bar.
        /// </summary>
        /// <param name="newView"></param>
        /// <param name="clickedButton"></param>
        private void SwitchView(BaseUserControl newView, Button clickedButton)
        {
            if (panelMainContent.Controls.Count > 0)
            {
                // Remove the current view.
                BaseUserControl oldView = panelMainContent.Controls[0] as BaseUserControl;
                panelMainContent.Controls.Remove(oldView);
                oldView.Dispose();
            }

            // Add the view to the main panel.
            panelMainContent.Controls.Add(newView);

            // Setting the view with dock style.
            newView.Dock = DockStyle.Fill;
            SetColor(clickedButton);
        }
Example #31
0
 protected void InitJavaScript()
 {
     if (this.IsContentTab())
     {
         StringBuilder builder = new StringBuilder();
         builder.Append("<script type='text/javascript'>\n");
         builder.Append("function JumpToMainRight(leftUrl,rightUrl) {");
         builder.Append(" if (rightUrl != \"\") { parent.frames[\"main_right\"].location = rightUrl;}");
         builder.Append("}");
         if (!string.IsNullOrEmpty(BaseUserControl.RequestString("js")))
         {
             builder.Append(" window.onload=" + BaseUserControl.RequestString("js") + ";");
         }
         builder.Append("</script>");
         this.jumptomainrightjs = builder.ToString();
     }
 }
 public void OpenPopUp(BaseUserControl control, string title = "Pop Up", int width = 300, int height = 300)
 {
     PopUpWindow ne = new PopUpWindow(control, title, width, height);
     ne.ShowDialog();
 }