Beispiel #1
0
 protected void DdlUserDataBind()
 {
     DdlUser.DataSource     = DBHelper.createDDLView("select user_id value,user_id text from jp_user where admin='0'");
     DdlUser.DataTextField  = "text";
     DdlUser.DataValueField = "value";
     DdlUser.DataBind();
 }
Beispiel #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack)
            {
                var db         = new TestEntities();
                var userlist   = db.Database.SqlQuery <KeyValue>("select cast(username as varchar(100)) as [Key], cast(Id as varchar(50)) as Value from jira_team (nolock)").ToList();
                var sprintlist = db.Database.SqlQuery <KeyValue>("select cast(Sprint as varchar(100)) as [Key] , cast(Id as varchar(50)) as Value from [JIRASprint] (nolock)").ToList();

                var users = new List <ListItem>();
                foreach (var u in userlist)
                {
                    users.Add(new ListItem {
                        Text = u.Key, Value = u.Value
                    });
                }
                DdlUser.DataSource = users;
                DdlUser.DataBind();

                var sprints = new List <ListItem>();
                foreach (var s in sprintlist)
                {
                    sprints.Add(new ListItem {
                        Text = s.Key, Value = s.Value
                    });
                }
                DdlSprint.DataSource = sprints;
                DdlSprint.DataBind();
            }
        }
 private void bindGVuser()
 {
     DdlUser.DataSource     = DBHelper.createDDLView("select user_id,user_id user_text from jp_user");
     DdlUser.DataTextField  = "user_text";
     DdlUser.DataValueField = "user_id";
     DdlUser.DataBind();
 }
Beispiel #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["Uname"] != null)
            {
                Master.Li.Visible = false;
                Master.Lo.Visible = true;
                if (Session["UType"].ToString() == "Administrator")
                {
                    Master.Aut.Visible = true;
                }
                else
                {
                    Response.Redirect("~/NotAut.aspx");
                }
            }
            else
            {
                Response.Redirect("~/Master.aspx");
            }
            if (!IsPostBack)
            {
                string str = ConfigurationManager.ConnectionStrings["DBCS"].ConnectionString;
                using (SqlConnection con = new SqlConnection(str))
                {
                    SqlCommand cmd = new SqlCommand();
                    cmd.CommandText = "select * from tbluser";
                    cmd.Connection  = con;
                    con.Open();
                    DdlUser.DataSource    = cmd.ExecuteReader();
                    DdlUser.DataTextField = "UName";
                    //DdlUser.DataValueField = "UName";
                    DdlUser.DataBind();
                    con.Close();

                    DdlUser.Items.Insert(0, "Select One");
                    DdlUser.SelectedIndex = 0;

                    cmd.CommandText = "select * from tblUType";
                    cmd.Connection  = con;
                    con.Open();
                    DdlType.DataSource     = cmd.ExecuteReader();
                    DdlType.DataTextField  = "UType";
                    DdlType.DataValueField = "UTypeId";
                    DdlType.DataBind();
                    con.Close();

                    DdlType.Items.Insert(0, "Select One");
                    DdlType.SelectedIndex = 0;
                }
                DdlType.Enabled = false;
                BtnSave.Enabled = false;
            }
        }
Beispiel #5
0
 public void FillUser()
 {
     try
     {
         DataTable dt = USER_MASLogicLayer.GetAllUSER_MASDetials_ForDDl();
         DdlUser.DataSource     = dt;
         DdlUser.DataValueField = "USERCODE";
         DdlUser.DataTextField  = "USERNAME";
         DdlUser.DataBind();
     }
     catch (Exception)
     {
         throw;
     }
 }
Beispiel #6
0
 public void FillDdlUser()
 {
     try
     {
         string    COMP_CODE = DdlCompany.SelectedValue;
         DataTable dt        = USER_MASLogicLayer.GetAllUserWiseCompanyRights(COMP_CODE);
         DdlUser.DataSource     = dt;
         DdlUser.DataValueField = "USERCODE";
         DdlUser.DataTextField  = "USERNAME";
         DdlUser.DataBind();
     }
     catch (Exception)
     {
         throw;
     }
 }