Ejemplo n.º 1
0
        private void GetResourceDetail()
        {
            try
            {
                if (Request["id"] != null)
                {
                    int             rsID  = int.Parse(Request["id"]);
                    ResourceManager rsMan = new ResourceManager();
                    Resource        rs    = rsMan.GetResource(rsID);

                    ApplicationManager appMan = new ApplicationManager();
                    Inside.SecurityProviders.Application app = appMan.GetApplication(rs.ApplicationID);

                    if (ViewState["ApplicationID"] != null)
                    {
                        ViewState["ApplicationID"] = rs.ApplicationID;
                    }
                    else
                    {
                        ViewState.Add("ApplicationID", rs.ApplicationID);
                    }

                    lblApplicationName.Text = app.Name;
                    lblResourceName.Text    = rs.ResourceName;
                    lblResourceType.Text    = rs.ResourceTypeCode;
                }
            }
            catch (Exception ex)
            {
                ucErrorBox.Message = "GetResourceDetail: " + ex.Message;
                CurrentFormState   = FormState.ErrorState;
            }
        }
Ejemplo n.º 2
0
        protected bool ShowDeleteButton(string resourceName, int applicationID)
        {
            string             applicationName = "";
            ApplicationManager appMan          = new ApplicationManager();

            Inside.SecurityProviders.Application app = appMan.GetApplication(applicationID);
            applicationName = app.Name;
            return(resourceName.ToLower() != applicationName.ToLower());
        }
Ejemplo n.º 3
0
        protected void lBtnDelete_Click(object sender, EventArgs e)
        {
            LinkButton btn = (LinkButton)sender;

            ApplicationManager appManager = new ApplicationManager();

            Inside.SecurityProviders.Application app =
                new Inside.SecurityProviders.Application(int.Parse(btn.CommandArgument), "", "");

            //Xoa ung dung
            appManager.Remove(app);
            LoadApplicationList(0);
        }
Ejemplo n.º 4
0
        private void LoadAppData()
        {
            if (Request.QueryString["id"] == null)
            {
                return;
            }
            ApplicationManager appManager = new ApplicationManager();

            Inside.SecurityProviders.Application app = new Inside.SecurityProviders.Application();

            app                    = appManager.GetApplication(int.Parse(Request.QueryString["id"]));
            txtAppName.Text        = app.Name;
            txtAppDescription.Text = app.Description;
            if (ViewState["app"] == null)
            {
                ViewState.Add("app", app);
            }
            else
            {
                ViewState["app"] = app;
            }
        }
Ejemplo n.º 5
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            ApplicationManager appManager = new ApplicationManager();

            Inside.SecurityProviders.Application app =
                new Inside.SecurityProviders.Application(int.Parse(Request.QueryString["id"]),
                                                         txtAppName.Text.Trim(), txtAppDescription.Text.Trim());
            try
            {
                appManager.Update(app);

                //xu ly ghi log
                Inside.SecurityProviders.Application oldApp;
                oldApp = (Inside.SecurityProviders.Application)ViewState["app"];
                this.SaveActionLog("Update", Request.QueryString["id"] + "::" + oldApp.Name + "-->" + txtAppName.Text.Trim());
                Response.Redirect("../Manage/");
            }
            catch (Exception ex)
            {
                this.SaveErrorLog(ex);
                uctErrorBox.Visible = true;
                uctErrorBox.Message = "Cập nhật ứng dụng không thành công.<br /> Có thể tên ứng dụng bị trùng ";
            }
        }