Esempio n. 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["UserType"] == null || (Convert.ToInt32(Session["UserType"]) != Global.ManagerUserType && Convert.ToInt32(Session["UserType"]) != Global.AdminUserType)) //manager & admin
     {
         Global.Application_AccessDenied(sender, e);
     }
     else if (!IsPostBack)
     {
         if (Request.QueryString["ProjectID"] != null)
         {
             LoadGrid("[Name]", "ASC");
         }
         else
         {
             fieldsActive(false);
         }
         fillProjectsDropDown();
     }
     else if (Request.QueryString["ProjectID"] != null)
     {
         origProjectID     = ViewState["origProjectID"].ToString();
         origManagerID     = ViewState["origManagerID"].ToString();
         origProjectName   = ViewState["origProjectName"].ToString();
         origCustomerID    = ViewState["origCustomerID"].ToString();
         origIndustryID    = ViewState["origIndustryID"].ToString();
         origStartDate     = ViewState["origStartDate"].ToString();
         origEndDate       = ViewState["origEndDate"].ToString();
         origStartDateFlex = ViewState["origStartDateFlex"].ToString();
         origEndDateFlex   = ViewState["origEndDateFlex"].ToString();
         origProjectStage  = ViewState["origProjectStage"].ToString();
         origStageOverride = Convert.ToBoolean(ViewState["origStageOverride"]);
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["UserType"] == null || (Convert.ToInt32(Session["UserType"]) != Global.ManagerUserType && Convert.ToInt32(Session["UserType"]) != Global.AdminUserType)) //manager & admin
     {
         Global.Application_AccessDenied(sender, e);
     }
 }
Esempio n. 3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["Authenticated"] == null || Convert.ToBoolean(Session["Authenticated"]) == false)
     {
         Global.Application_AccessDenied(sender, e);
     }
 }
Esempio n. 4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["UserType"] == null || Convert.ToInt32(Session["UserType"]) != Global.AdminUserType) //admin
     {
         Global.Application_AccessDenied(sender, e);
     }
     else
     {
         SqlDataSource1.ConnectionString = Global.getConnectionString();
     }
     Text1.Focus();
 }
Esempio n. 5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["UserType"] == null || Convert.ToInt32(Session["UserType"]) != Global.AdminUserType) //admin
     {
         Global.Application_AccessDenied(sender, e);
     }
     if (!IsPostBack)
     {
         GridView1.DataBind();
     }
     ;
 }
Esempio n. 6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["UserType"] == null || (Convert.ToInt32(Session["UserType"]) != Global.ManagerUserType && Convert.ToInt32(Session["UserType"]) != Global.AdminUserType)) //manager & admin
     {
         Global.Application_AccessDenied(sender, e);
     }
     else
     {
         SqlDataSourceInd.ConnectionString  = Global.getConnectionString();
         SqlDataSourceCust.ConnectionString = Global.getConnectionString();
     }
 }
Esempio n. 7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["UserType"] == null || (Convert.ToInt32(Session["UserType"]) != Global.ManagerUserType && Convert.ToInt32(Session["UserType"]) != Global.AdminUserType)) //manager & admin
     {
         Global.Application_AccessDenied(sender, e);
     }
     else if (Request.QueryString["ProjectID"] != null)
     {
         if (!IsPostBack)
         {
             LoadGrid("[Name]", "ASC");
         }
     }
     else
     {
         Response.Redirect("~/Manager/MyProjects.aspx");
     }
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["UserType"] == null || (Convert.ToInt32(Session["UserType"]) != Global.ManagerUserType && Convert.ToInt32(Session["UserType"]) != Global.AdminUserType)) //manager & admin
            {
                Global.Application_AccessDenied(sender, e);
            }
            else if (!IsPostBack)
            {
                SqlConnection  con = new SqlConnection(Global.getConnectionString());
                DataTable      roles = new DataTable(), industries = new DataTable();
                SqlDataAdapter adptrole = new SqlDataAdapter("SELECT name FROM pms_resource_role;", con);
                adptrole.Fill(roles);
                SqlDataAdapter adptindustry = new SqlDataAdapter("SELECT name FROM pms_industry;", con);
                adptindustry.Fill(industries);

                if (Request.QueryString["ProjectID"] == null)
                {
                    GridView1.Columns[8].Visible = false;
                }
                else
                {
                    GridView1.Columns[9].Visible = false;
                }
                //String temp;
                //foreach (DataRow row in roles.Rows) {
                //    temp = row["name"].ToString();
                //    row["name"] = char.ToUpper(temp[0]) + temp.Substring(1).ToLower();
                //}
                //foreach (DataRow row in industries.Rows) {
                //    temp = row["name"].ToString();
                //    row["name"] = char.ToUpper(temp[0]) + temp.Substring(1).ToLower();
                //}

                try {
                    con.Open();
                    DropDownList1.DataSource     = roles;
                    DropDownList1.DataTextField  = "name";
                    DropDownList1.DataValueField = "name"; // "id" if SELECT *
                    DropDownList1.DataBind();
                    DropDownList2.DataSource     = industries;
                    DropDownList2.DataTextField  = "name";
                    DropDownList2.DataValueField = "name";
                    DropDownList2.DataBind();
                } catch (Exception ex) {
                    throw (ex);
                }
                finally
                {
                    adptrole.Dispose();
                    adptindustry.Dispose();
                    roles.Dispose();
                    con.Dispose();
                    con.Close();
                }
                DropDownList1.Items.Insert(0, new ListItem("Any", "Any"));
                DropDownList2.Items.Insert(0, new ListItem("Any", "Any"));
                DropDownList4.SelectedIndex = 2;
                DropDownList5.SelectedIndex = 4;
                Text5.Value = 40.ToString();
            }
            else
            {
            }
            Text1.Focus();
        }