Пример #1
0
        protected void AjaxManager_AjaxRequest(object sender, Telerik.Web.UI.AjaxRequestEventArgs e)
        {
            AjaxArguments args=new AjaxArguments(e);
            if(args.CommandName=="RunSearch")
            {
                string appId = args[0];
                string customerId = args[1];
                string result=null;

                using (var mgr=new ApplicationManager() )
                {
                    IApplication app = mgr.GetById(appId);
                    if(app!=null && app.CustomerID==customerId)
                    {
                        result = app.ID + "|" + app.DateApplied.GetValueOrDefault().ToString("yyyy年MM月dd日") + "|" +
                                 (app.Status == null
                                     ? JobStatus.None.ToLabel()
                                     : app.Status.Value);
                    }
                }

                AjaxManager.ResponseScripts.Add((result == null ? "ShowResult(null);" : "ShowResult('" + result + "');") +
                                                " return false;");
            }
        }
Пример #2
0
        protected void AjaxManager_AjaxRequest(object sender, AjaxRequestEventArgs e)
        {
            AjaxArguments args = new AjaxArguments(e);

            switch (args.CommandName)
            {
                case "ChangeStatus":
                    string status = args[0];
                    if (!string.IsNullOrEmpty(ItemId))
                    {
                        using (var manager = new StatusManager())
                        {
                            manager.Update(ItemId, status);
                            InitializeStatusInput(status);
                            Dialog.Info(this, "状态更新成功!");
                        }
                        //btStatus.Visible = true;
                    }
                    break;
                case "InitStatus":
                    string appid = args[0];
                    if (!string.IsNullOrEmpty(appid))
                    {
                        using (var manager = new ApplicationManager())
                        {
                            IApplication app = manager.GetById(appid);
                            if (app.Status != null)
                            {
                                InitializeStatusInput(app.Status.Value);
                            }
                        }
                        //btStatus.Visible = true;
                    }
                    break;
                default:
                    break;
            }
        }
Пример #3
0
        protected override void CreateChildControls()
        {
            base.CreateChildControls();

            AjaxManager.AjaxRequest += new RadAjaxControl.AjaxRequestDelegate(AjaxManager_AjaxRequest);

            if(string.IsNullOrEmpty(ItemId))
            {
                lbAppId.Text = GlobalConstant.None;
                btStatus.Visible = false;
            }
            else
            {
                lbAppId.Text = ItemId;
                btStatus.Visible = true;
            }

            if(!this.Current.IsLogon)return;

            //0:App details
            //1:collection
            //2:case
            //3:return
            switch (this.Current.LogonUser.Role)
            {
                case UserRole.Client:
                    RadPanelBar1.Items[1].Visible = true;
                    RadPanelBar1.Items[2].Visible = false;
                    break;
                case UserRole.Administrator:
                    RadPanelBar1.Items[1].Visible = true;
                    RadPanelBar1.Items[2].Visible = true;
                    break;
                case UserRole.Business:
                    RadPanelBar1.Items[1].Visible = false;
                    RadPanelBar1.Items[2].Visible = true;
                    break;
                default:
                    break;
            }

            if (!string.IsNullOrEmpty(ItemId))
            {
                using (var manager = new ApplicationManager())
                {
                    IApplication item = manager.GetById(ItemId);

                    string curStatus = item.Status.Value;
                    InitializeStatusInput(curStatus);
                }
            }
        }