예제 #1
0
파일: Stuff.aspx.cs 프로젝트: ahmgeek/crm
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.QueryString.ToString() != string.Empty)
        {
            // getting the Id of the user
            stuffId   = (Guid)u.GetUser(Request.QueryString["name"].ToString()).ProviderUserKey;
            stuffName = Request.QueryString["name"].ToString();
        }
        else
        {
            Response.Redirect("/Default.aspx");
        }

        if (!IsPostBack)
        {
            if (stuffId != Guid.Empty)
            {
                try
                {
                    Data();
                    btnSave.Visible   = true;
                    btnInsert.Visible = false;
                }
                catch (Exception ex)
                {
                    string message = ex.Message;
                    ClientScript.RegisterStartupScript(this.GetType(), "Info", HelperNotify.HelperMessage("Warning", message, HelperNotify.NotificationType.info));
                    btnInsert.Visible = true;
                    btnSave.Visible   = false;
                }
            }
        }
    }
예제 #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            BindGrid();
            btnDeleteUser.Enabled = false;

            if (Request.QueryString["suc"] == "true")
            {
                string script = HelperNotify.HelperMessage("Succeded", "Role Inserted ! ", HelperNotify.NotificationType.success);
                ClientScript.RegisterStartupScript(this.GetType(), "pnotify", script);
            }
            else if (Request.QueryString["suc"] == "false")
            {
                string script = HelperNotify.HelperMessage("Error", "Role Exist ! ", HelperNotify.NotificationType.error);
                ClientScript.RegisterStartupScript(this.GetType(), "pnotify", script);
            }
        }
    }