Beispiel #1
0
        protected void Page_Init(object sender, EventArgs e)
        {
            var _mp = new DlMainpagepopulator();

            //get salaries
            CheckBoxList6.DataSource     = _mp.GetSalary();
            CheckBoxList6.DataTextField  = "sTerm";
            CheckBoxList6.DataValueField = "Termid";
            CheckBoxList6.DataBind();

            //get locations
            CheckBoxList2.DataSource     = _mp.GetLocations();
            CheckBoxList2.DataTextField  = "sTerm";
            CheckBoxList2.DataValueField = "Termid";
            CheckBoxList2.DataBind();

            //get industry
            CheckBoxList1.DataSource     = _mp.GetIndustries();
            CheckBoxList1.DataTextField  = "sTerm";
            CheckBoxList1.DataValueField = "Termid";
            CheckBoxList1.DataBind();

            if (Request.QueryString["q"] != null & Request.QueryString["q"] != "all")
            {
                TextBox2.Text = Request.QueryString["q"];
            }
        }
Beispiel #2
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        CheckBoxList3.Focus();
        CheckBoxList2.Items.Clear();
        CheckBoxList3.Items.Clear();

        // show Question Button

        for (int i = 0; i < CheckBoxList1.Items.Count; i++)
        {
            if (CheckBoxList1.Items[i].Selected == true)
            {  // fetch question with dropdwn condition
                SqlCommand Ques_cmd = new SqlCommand();
                Ques_cmd.CommandText = "SELECT Question_Id, Question_Details FROM question_bank WHERE Subject_Id =" + DropDownList2.SelectedValue + " AND Chapter_Id =" + CheckBoxList1.Items[i].Value + " AND Minimum_Marks=" + DropDownList3.SelectedValue;
                Ques_cmd.Connection  = cn;
                SqlDataReader dr = Ques_cmd.ExecuteReader();
                // here we assign checkbox2 to question and checkbox3 assign id of question
                while (dr.Read())
                {
                    CheckBoxList2.Items.Add(Convert.ToString(dr.GetValue(1)));
                    CheckBoxList3.Items.Add(Convert.ToString(dr.GetValue(0)));
                }
                dr.Close();
            }
        }

        CheckBoxList2.Focus();
    }
 private void cargarGrid2()
 {
     CheckBoxList2.DataSource     = CInstEduc.ctrlNivelEducativo.TraerTodos();
     CheckBoxList2.DataTextField  = "Descripcion";
     CheckBoxList2.DataValueField = "Id";
     CheckBoxList2.DataBind();
 }
Beispiel #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if ((Session[MasterPage.User] as Users)?.Rigths != 2)
            {
                Response.Redirect("login.aspx");
            }

            if (IsPostBack)
            {
                return;
            }

            using (var context = new MainEntities())
            {
                CheckBoxList1.DataSourceID = "";
                CheckBoxList2.DataSourceID = "";

                var source1 = context.Актеры.ToList();
                var source2 = context.Персонажи.ToList();

                CheckBoxList1.DataSource = source1.Select(o => $"{o.Имя} {o.Фамилия}").ToList();
                CheckBoxList2.DataSource = source2.Select(o => $"{o.Имя} {o.Фамилия}").ToList();

                CheckBoxList1.DataBind();
                CheckBoxList2.DataBind();
            }
        }
 // Reset filters
 protected void Button6_Click(object sender, EventArgs e)
 {
     CheckBoxList1.ClearSelection();
     CheckBox1.Checked = false;
     CheckBoxList2.ClearSelection();
     ExecuteSearchAndSorting();
 }
Beispiel #6
0
    private void CheckBoxListItems2()
    {
        rootCfg    = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration("/petroneeds");
        connection = rootCfg.ConnectionStrings.ConnectionStrings["petroneedsConnectionString2"].ConnectionString.ToString();

        con = new SqlConnection(connection);
        con.ConnectionString = connection;
        con.Open();

        dataset = new DataSet();
        comm    = new SqlCommand("SELECT MenuName, MenuID, ParentID FROM tbl_WebMenu", con);
        adapter = new SqlDataAdapter(comm);
        adapter.Fill(dataset);

        CheckBoxList2.DataSource     = dataset;
        CheckBoxList2.DataTextField  = "MenuName";
        CheckBoxList2.DataValueField = "MenuID";
        //CheckBoxList1.Items[].FindByValue(0) = "ParentID";
        ////CheckBoxList1.SelectedIndex.CompareTo("ParentID");
        CheckBoxList2.DataBind();

        if (CheckBoxList2.DataValueField.Length == 1)
        {
            for (int i = 0; i < CheckBoxList2.Items.Count; i++)
            {
                CheckBoxList2.Items[i].Selected = true;
            }
        }
    }
    protected void Year_TextChanged(object sender, EventArgs e)
    {
        using (SqlConnection sq = new SqlConnection(ConfigurationManager.ConnectionStrings["DBC"].ConnectionString))
        {
            sq.Open();

            string         q  = "select username from auth where status='Unverified' and utype='Student' and dept ='" + (Session["user"].ToString()).Substring(0, 2) + "'";
            string         q1 = "select Std_id,name as [Name],dob as [DOB],fname as [Father Name],mname as [mother's Name] ,aadhar,address,mob as [Mobile],mail,interper as[12th %],passedclg as [Passed School],passedyer as [Year of passing] from " + (Session["user"].ToString()).Substring(0, 2) + Year.SelectedValue + " where status='Unverified'";
            DataTable      dt = new DataTable();
            SqlDataAdapter da = new SqlDataAdapter(q, sq);
            da.Fill(dt);
            if (dt.Rows.Count > 0)
            {
                CheckBoxList2.DataSource    = dt;
                CheckBoxList2.DataTextField = "username";
                CheckBoxList2.DataBind();
                dt.Clear();
                SqlDataAdapter d1 = new SqlDataAdapter(q1, sq);
                dt = new DataTable();
                d1.Fill(dt);
                if (dt.Rows.Count > 0)
                {
                    GridView1.DataSource = dt;
                    GridView1.DataBind();
                    da.Dispose();
                    dt.Clear();
                }
            }
            sq.Close();
        }
    }
Beispiel #8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var makes = new List <string> {
                "Ação", "Animação", "Comédia", "Corridas", "Erótico", "Aventura", "Documentário", "Drama"
                , "Fantasia", "Ficção", "Guerra", "Musical", "Policial", "Religioso", "Romance", "Terror"
            };


            var ator = new List <string> {
                "Al Pacino ", "Jack Nicholson", "Chiwetel Ejiofor", "Amanda Peet", "Woody Harrelson", "Morgan Freeman",
                "Brad Pitt", "Angelina Jolie", "Benedict Cumberbatch", "Salvador Dalí", "Al Dalí", "Miranda Cosgrove", "Rik Mayall", "Jimmy Fallon"
            };

            var escritor = new List <string> {
                "Roland Emmerich", "Harald Kloser", "Chiwetel Ejiofor", "Amanda Peet", "Arthur C. Clarke ", " Peter Hyams", "Benedict Cumberbatch", "Salvador Dalí",
            };

            var song = new List <string> {
                "The impact ", "Ashes in D.C", "Singin' in the Rain", "Skyfall", "Born to Be Wild"
            };


            var directores = new List <string> {
                "Ingmar Bergman", "Benedict Cumberbatch", "Chiwetel Ejiofor", "Amanda Peet", "Salvador Dalí", "Federico Fellini", "Francis Ford Coppola", "Charles Chaplin", "Tim Burton", "Roman Polanski", "Roland Emmerich "
            };



            makes.Sort();
            ator.Sort();
            escritor.Sort();
            song.Sort();
            directores.Sort();

            CheckBoxList2.DataSource = escritor;
            CheckBoxList2.DataBind();
            cblEmployees.DataSource = ator;
            cblEmployees.DataBind();
            cblEmployees.DataSource = directores;

            DropDownList1.DataBind();

            for (int i = 1889; i < 2016; i++)
            {
                DropDownList3.Items.Add(i.ToString());
            }



            CheckBoxList3.DataSource = song;
            CheckBoxList3.DataBind();



            DropDownList2.DataSource = makes;
            DropDownList2.DataBind();
        }
Beispiel #9
0
 private void Reset()
 {
     Text_Name.Text = "";
     ceil_new.Text  = "";
     ceil_old.Text  = "";
     //TextBox2.Text = "";
     CheckBoxList1.ClearSelection();
     CheckBoxList2.ClearSelection();
     DropDownList1.ClearSelection();
     resetSelect();
 }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["UserId"] == null)
        {
            Response.Redirect("Welcome.aspx");
        }
        Session.Timeout        = 120;
        SectionPanel.Visible   = false;
        DistrictPanel.CssClass = "col-lg-12";
        SqlDataReader re = DataConnection.selectQuery("select * from member where memeberid = " + Convert.ToInt32(Session["RCV"]) + " and admin = 'A'");

        if (re.HasRows)
        {
            SectionPanel.Visible   = true;
            DistrictPanel.CssClass = "col-lg-6";
        }
        int           count  = CheckBoxList2.Items.Count;
        SqlDataReader reader = DataConnection.selectQuery("select location,memeberid from member where Department='section'");

        if (reader.HasRows)
        {
            //List<String> lst = new List<string>();
            while (reader.Read())
            {
                ListItem item = new ListItem();
                item.Text     = reader.GetString(0);
                item.Value    = reader.GetInt32(1).ToString();
                item.Selected = false;
                CheckBoxList2.Items.Add(item);
            }
        }
        reader.Close();
        DataConnection.closeConnection();

        //count = CheckBoxList3.Items.Count;
        reader = DataConnection.selectQuery("select location,memeberid from member where Department='dist'");
        if (reader.HasRows)
        {
            //List<String> lst = new List<string>();
            while (reader.Read())
            {
                ListItem item = new ListItem();
                item.Text     = reader.GetString(0);
                item.Value    = reader.GetInt32(1).ToString();
                item.Selected = false;
                CheckBoxList3.Items.Add(item);
            }
        }
        reader.Close();
        DataConnection.closeConnection();

        CheckBoxList2.DataBind();
        CheckBoxList3.DataBind();
    }
    private void BindList()
    {
        DataSet        ds     = new DataSet();
        string         cmdstr = "select skill from skillstaught";
        SqlDataAdapter adp    = new SqlDataAdapter(cmdstr, con);

        adp.Fill(ds);
        CheckBoxList2.DataSource     = ds;
        CheckBoxList2.DataTextField  = "skill";
        CheckBoxList2.DataValueField = "skill";
        CheckBoxList2.DataBind();
    }
        public void filldrop_a()
        {
            DataSet        ds = new DataSet();
            SqlDataAdapter dp = new SqlDataAdapter("select * from tbl_person where (categoryname=@n)", conn);

            dp.SelectCommand.Parameters.AddWithValue("@n", "Advisor");
            dp.Fill(ds);
            CheckBoxList2.DataSource     = ds;
            CheckBoxList2.DataTextField  = "Name";
            CheckBoxList2.DataValueField = "supervisorId";
            CheckBoxList2.DataBind();
        }
Beispiel #13
0
        public void HastaliklariCek()
        {
            baglanti.Open();
            SqlCommand     komut   = new SqlCommand("select hastalik from HastalikTanim", baglanti);
            SqlDataAdapter adaptor = new SqlDataAdapter(komut);
            DataSet        DS      = new DataSet();

            adaptor.Fill(DS);
            baglanti.Close();
            CheckBoxList2.DataSource    = DS.Tables[0];
            CheckBoxList2.DataTextField = "hastalik";
            CheckBoxList2.DataBind();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Context.User.IsInRole("ServiceLine Manager"))
            {
                Response.Redirect("Access.aspx");
            }
            string ServiceName = Request.QueryString["ServLineName"];

            ServLineName.Text = ServiceName;
            if (!IsPostBack)
            {
                string ServLineName = Request.QueryString["ServLineName"];
                //OMCheckList.Text = ServLineName;
                string ServLineId            = Request.QueryString["ID"];
                int    ServLineId1           = Convert.ToInt32(Request.QueryString["ID"]);
                ServiceLineRepository SLrepo = new ServiceLineRepository();

                SLMServiceLine SlMRepo = new SLMServiceLine();
                SlMRepo.getServLineOMDetails(ServLineId);
                SlMRepo.getAllOMDetails();
                SlMRepo.getAllOMDetailsOfServiceLineManagers(ServLineId);

                SelectAllUsers selectAllUsers = new SelectAllUsers();

                OMCheckList.DataSource     = SlMRepo.ServLineOMTab;
                OMCheckList.DataTextField  = "UserName";
                OMCheckList.DataValueField = "Id";
                OMCheckList.DataBind();
                for (int i = 0; i < OMCheckList.Items.Count; i++)
                {
                    OMCheckList.Items[i].Selected = true;
                    string OmId = OMCheckList.Items[i].Value;
                    SLrepo.EditServiceLineOMwhileload(ServLineId1, OmId);
                }

                //OMCheckList1.DataSource = SlMRepo.ServLineOMList;
                //OMCheckList1.DataTextField = "UserName";
                //OMCheckList1.DataValueField = "Id";

                //OMCheckList1.DataBind();

                //CheckBoxList2.DataSource = SlMRepo.getAllOMDetailsOfServiceLineManagers(ServLineId);
                CheckBoxList2.DataSource     = SlMRepo.ServLineOMList;
                CheckBoxList2.DataTextField  = "UserName";
                CheckBoxList2.DataValueField = "Id";

                CheckBoxList2.DataBind();
            }
        }
Beispiel #15
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //set default inputs
            TextBox2.Focus();
            //Page.Form.DefaultButton = ImageButton2.UniqueID;

            CLMainpagepopulator cmpag = new CLMainpagepopulator();

            if (!IsPostBack)
            {
                //constructor
                CLMainpagepopulator mp = new CLMainpagepopulator();

                //get count of all jobs
                Label13.Text = mp.getcountjobs() + " Jobs Advertized from " + mp.getcountrecswadvert() + " Recruiters";

                //populate left

                //get salaries
                CheckBoxList6.DataSource     = mp.getSalary();
                CheckBoxList6.DataTextField  = "sTerm";
                CheckBoxList6.DataValueField = "Termid";
                CheckBoxList6.DataBind();


                //get locations
                CheckBoxList2.DataSource     = mp.getLocations();
                CheckBoxList2.DataTextField  = "sTerm";
                CheckBoxList2.DataValueField = "Termid";
                CheckBoxList2.DataBind();

                //get industry
                CheckBoxList1.DataSource     = mp.getIndustries();
                CheckBoxList1.DataTextField  = "sTerm";
                CheckBoxList1.DataValueField = "Termid";
                CheckBoxList1.DataBind();

                //main job binding
                CLMainpagepopulator mpgp = new CLMainpagepopulator();
                GridView1.DataSource = mpgp.getJobssingle();
                GridView1.DataBind();


                //featured Recruiters
                ClFeaturedrecruiters frec = new ClFeaturedrecruiters();
                GridView2.DataSource = frec.GetFRecs();
                GridView2.DataBind();
            }
        }
Beispiel #16
0
        private void BindCheckBoxList()
        {
            List <TestClass> myList = new List <TestClass>();

            myList.Add(new TestClass("1", "数据绑定值 1"));
            myList.Add(new TestClass("2", "数据绑定值 2"));
            myList.Add(new TestClass("3", "数据绑定值 3"));
            myList.Add(new TestClass("4", "数据绑定值 4"));

            CheckBoxList2.DataTextField  = "Name";
            CheckBoxList2.DataValueField = "Id";
            CheckBoxList2.DataSource     = myList;
            CheckBoxList2.DataBind();

            CheckBoxList2.SelectedValueArray = new string[] { "1", "3" };
        }
    private void LoadPlantName()
    {
        try
        {
            Datechanged();
            String        dbConnStr = ConfigurationManager.ConnectionStrings["AMPSConnectionString"].ConnectionString;
            SqlConnection conn      = null;
            using (conn = new SqlConnection(dbConnStr))
            {
                SqlCommand sqlCmd = new SqlCommand("dbo.[Get_PlantwiseSingleBilldateOverAllDataReport]");
                conn.Open();
                sqlCmd.Connection  = conn;
                sqlCmd.CommandType = CommandType.StoredProcedure;
                sqlCmd.Parameters.AddWithValue("@spccode", Company_code);
                sqlCmd.Parameters.AddWithValue("@spfrmdate", d1.ToString());
                sqlCmd.Parameters.AddWithValue("@sptodate", d2.ToString());
                SqlDataAdapter da = new SqlDataAdapter(sqlCmd);
                da.Fill(ds);

                if (ds != null)
                {
                    CheckBoxList1.DataSource     = ds;
                    CheckBoxList1.DataTextField  = "PlantName";
                    CheckBoxList1.DataValueField = "pcode";
                    CheckBoxList1.DataBind();

                    CheckBoxList2.DataSource     = ds;
                    CheckBoxList2.DataTextField  = "Frmtodate2";
                    CheckBoxList2.DataValueField = "Frmtodate3";
                    CheckBoxList2.DataBind();

                    CheckBoxList3.DataSource     = ds;
                    CheckBoxList3.DataTextField  = "Frmtodate1";
                    CheckBoxList3.DataValueField = "Frmtodate4";
                    CheckBoxList3.DataBind();
                }
                else
                {
                }
            }
        }
        catch (Exception ex)
        {
            Lbl_Errormsg.Visible = true;
            Lbl_Errormsg.Text    = ex.ToString();
        }
    }
Beispiel #18
0
        protected void DropDownList2_Changed(object sender, EventArgs e)
        {
            //绑定还未下载的作业
            if (DropDownList2.SelectedIndex != 0 && DropDownList1.SelectedIndex != 0)
            {
                classid = Convert.ToInt32(DropDownList1.SelectedValue);
                times   = Convert.ToInt32(DropDownList2.SelectedValue);
                DataTable dt = BLL.Homework.BLLGetHomeworkToDownload(classid, times);
                CheckBoxList1.DataSource     = dt;
                CheckBoxList1.DataTextField  = dt.Columns[2].ColumnName;
                CheckBoxList1.DataValueField = dt.Columns[1].ColumnName;
                CheckBoxList1.DataBind();
            }
            else if (DropDownList2.SelectedIndex == 1 && DropDownList1.SelectedIndex != 0)
            {
                classid = Convert.ToInt32(DropDownList1.SelectedValue);
                times   = 0;
                DataTable dt = BLL.Homework.BLLGetHomeworkToDownload(classid, times);
                CheckBoxList1.DataSource     = dt;
                CheckBoxList1.DataTextField  = dt.Columns[2].ColumnName;
                CheckBoxList1.DataValueField = dt.Columns[1].ColumnName;
                CheckBoxList1.DataBind();
            }

            //绑定已下载的作业
            if (DropDownList2.SelectedIndex != 0 && DropDownList2.SelectedIndex != 1 && DropDownList1.SelectedIndex != 0)
            {
                classid = Convert.ToInt32(DropDownList1.SelectedValue);
                times   = Convert.ToInt32(DropDownList2.SelectedValue);
                DataTable dt = BLL.Homework.BLLGetDownloadedHomework(classid, times);
                CheckBoxList2.DataSource     = dt;
                CheckBoxList2.DataTextField  = dt.Columns[2].ColumnName;
                CheckBoxList2.DataValueField = dt.Columns[1].ColumnName;
                CheckBoxList2.DataBind();
            }
            else if (DropDownList2.SelectedIndex == 1 && DropDownList1.SelectedIndex != 0)
            {
                classid = Convert.ToInt32(DropDownList1.SelectedValue);
                times   = 0;
                DataTable dt = BLL.Homework.BLLGetDownloadedHomework(classid, times);
                CheckBoxList2.DataSource     = dt;
                CheckBoxList2.DataTextField  = dt.Columns[2].ColumnName;
                CheckBoxList2.DataValueField = dt.Columns[1].ColumnName;
                CheckBoxList2.DataBind();
            }
        }
Beispiel #19
0
    public void sizefilter()
    {
        MessageBox msg = new MessageBox();
        DataTable  ds  = filter.fillfilterbytype("size");

        if (ds.Rows.Count == 0)
        {
        }
        else
        {
            CheckBoxList2.DataSource = ds;

            CheckBoxList2.DataTextField  = ds.Columns["filtervalue"].ToString();
            CheckBoxList2.DataValueField = ds.Columns["id"].ToString();
            CheckBoxList2.DataBind();
        }
    }
Beispiel #20
0
        private void InitCheckBoxList2()
        {
            List <TestClass> myList = new List <TestClass>();

            myList.Add(new TestClass("value1", "可选项 1"));
            myList.Add(new TestClass("value2", "可选项 2"));
            myList.Add(new TestClass("value3", "可选项 3"));
            myList.Add(new TestClass("value4", "可选项 4"));
            myList.Add(new TestClass("value5", "可选项 5"));
            myList.Add(new TestClass("value6", "可选项 6"));

            CheckBoxList2.DataTextField  = "Name";
            CheckBoxList2.DataValueField = "Id";
            CheckBoxList2.DataSource     = myList;
            CheckBoxList2.DataBind();

            CheckBoxList2.SelectedValueArray = new string[] { "value1", "value2", "value3" };
        }
Beispiel #21
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (User.Identity.Name.ToString() == "")
        {
            Response.Redirect("/Default.aspx");
        }
        List <AspNetUser> listUsers    = new List <AspNetUser>();
        List <AspNetUser> listManagers = new List <AspNetUser>();
        AspNetUser        potochnuj    = new AspNetUser();

        StreamWriter wr = new StreamWriter(@"E:\logWebSite5.txt", true);

        wr.WriteLine("Page_Load()");

        using (var db = new Entities5())
        {
            listUsers    = db.AspNetUsers.Where(m => m.ManagerRights != true).ToList();
            listManagers = db.AspNetUsers.Where(m => m.ManagerRights == true).ToList();
            foreach (AspNetUser m in listManagers)
            {
                wr.WriteLine("m.UserName = "******" User.Identity.Name.ToString())" + User.Identity.Name.ToString());
                if (m.UserName == User.Identity.Name.ToString())
                {
                    potochnuj = m;
                }
            }
        }
        wr.Close();

        listManagers.Remove(potochnuj);

        CheckBoxList1.DataSource     = listUsers;
        CheckBoxList1.DataTextField  = "UserName";
        CheckBoxList1.DataValueField = "Id";

        CheckBoxList2.DataSource     = listManagers;
        CheckBoxList2.DataTextField  = "UserName";
        CheckBoxList2.DataValueField = "Id";
        if (!IsPostBack)
        {
            CheckBoxList1.DataBind();
            CheckBoxList2.DataBind();
        }
    }
        void advisorList()
        {
            con.Open();
            DataSet ds = new DataSet();

            SqlDataAdapter adp = new SqlDataAdapter("select * from advTable", con);

            adp.Fill(ds);

            CheckBoxList2.DataSource = ds;

            CheckBoxList2.DataTextField = "Name";

            CheckBoxList2.DataValueField = "CNIC";

            CheckBoxList2.DataBind();

            con.Close();
        }
Beispiel #23
0
 protected void Button2_Click(object sender, EventArgs e)
 {
     TextBox1.Enabled      = true;
     TextBox2.Enabled      = true;
     TextBox3.Enabled      = true;
     TextBox4.Enabled      = true;
     TextBox5.Enabled      = true;
     CheckBoxList2.Enabled = true;
     CheckBoxList3.Enabled = true;
     CheckBoxList4.Enabled = true;
     CheckBoxList1.Enabled = true;
     Label1.Text           = null;
     TextBox1.Text         = null;
     TextBox2.Text         = null;
     TextBox3.Text         = null;
     TextBox4.Text         = null;
     TextBox5.Text         = null;
     CheckBoxList2.ClearSelection();
     CheckBoxList3.ClearSelection();
     CheckBoxList4.ClearSelection();
     CheckBoxList1.ClearSelection();
 }
Beispiel #24
0
    private void LoadPlantName1()
    {
        try
        {
            DataSet       ds        = new DataSet();
            String        dbConnStr = ConfigurationManager.ConnectionStrings["AMPSConnectionString"].ConnectionString;
            SqlConnection conn      = null;
            using (conn = new SqlConnection(dbConnStr))
            {
                SqlCommand sqlCmd = new SqlCommand("dbo.[GetPaymentAllot_BalanceAmount]");
                conn.Open();
                sqlCmd.Connection  = conn;
                sqlCmd.CommandType = CommandType.StoredProcedure;
                SqlDataAdapter da = new SqlDataAdapter(sqlCmd);
                da.Fill(ds);
                if (ds != null)
                {
                    CheckBoxList1.DataSource     = ds;
                    CheckBoxList1.DataTextField  = "Plant";
                    CheckBoxList1.DataValueField = "Plant";//ROUTE_ID
                    CheckBoxList1.DataBind();

                    CheckBoxList2.DataSource     = ds;
                    CheckBoxList2.DataTextField  = "BalanceAmount";
                    CheckBoxList2.DataValueField = "BalanceAmount";//ROUTE_ID
                    CheckBoxList2.DataBind();

                    CheckBoxList3.DataSource     = ds;
                    CheckBoxList3.DataTextField  = "Billdate";
                    CheckBoxList3.DataValueField = "Billdate";//ROUTE_ID
                    CheckBoxList3.DataBind();
                }
            }
        }

        catch (Exception ex)
        {
        }
    }
Beispiel #25
0
        protected void Page_Init(object sender, EventArgs e)
        {
            var mp = new DlMainpagepopulator();

            //get locations
            CheckBoxList2.DataSource     = mp.GetLocations();
            CheckBoxList2.DataTextField  = "sTerm";
            CheckBoxList2.DataValueField = "Termid";
            CheckBoxList2.DataBind();

            //get industry
            CheckBoxList1.DataSource     = mp.GetIndustries();
            CheckBoxList1.DataTextField  = "sTerm";
            CheckBoxList1.DataValueField = "Termid";
            CheckBoxList1.DataBind();

            //get salary
            CheckBoxList6.DataSource     = mp.Getsalaries();
            CheckBoxList6.DataTextField  = "sTerm";
            CheckBoxList6.DataValueField = "Termid";
            CheckBoxList6.DataBind();
        }
Beispiel #26
0
 private void BindCheckBoxListMaster(int tidd)
 {
     try
     {
         ds = MBLL.GetSubMenuTitleCheckBoxMaster(tidd);
         if (tidd == 1)
         {
             CheckBoxList1.DataSource     = ds;
             CheckBoxList1.DataTextField  = "SubMenuName";
             CheckBoxList1.DataValueField = "SubMenuValue";
             CheckBoxList1.DataBind();
         }
         else if (tidd == 2)
         {
             CheckBoxList2.DataSource     = ds;
             CheckBoxList2.DataTextField  = "SubMenuName";
             CheckBoxList2.DataValueField = "SubMenuValue";
             CheckBoxList2.DataBind();
         }
         else if (tidd == 3)
         {
             CheckBoxList3.DataSource     = ds;
             CheckBoxList3.DataTextField  = "SubMenuName";
             CheckBoxList3.DataValueField = "SubMenuValue";
             CheckBoxList3.DataBind();
         }
         else if (tidd == 4)
         {
             CheckBoxList4.DataSource     = ds;
             CheckBoxList4.DataTextField  = "SubMenuName";
             CheckBoxList4.DataValueField = "SubMenuValue";
             CheckBoxList4.DataBind();
         }
     }
     catch (Exception ex)
     {
         ex.Message.ToString();
     }
 }
Beispiel #27
0
    private void loadBranch()
    {
        BusinessLogic bl         = new BusinessLogic(sDataSource);
        DataSet       ds         = new DataSet();
        string        connection = ConfigurationManager.ConnectionStrings[Request.Cookies["Company"].Value].ToString();

        lstBranch.Items.Clear();

        brncode = Request.Cookies["Branch"].Value;
        if (brncode == "All")
        {
            ds = bl.ListBranch();
            // lstBranch.Items.Add(new ListItem("All", "0"));
            CheckBoxList1.Visible = true;
            lblbranch.Text        = "Select Branch(es)";
            single.Visible        = false;
            single1.Visible       = false;
            // div1.Visible = false;
        }
        else
        {
            ds = bl.ListDefaultBranch(brncode);
            CheckBoxList1.Visible = false;
            // lblbranch.Text = "Select Branch";
            multi.Visible  = false;
            select.Visible = false;
        }
        lstBranch.DataSource     = ds;
        lstBranch.DataTextField  = "BranchName";
        lstBranch.DataValueField = "Branchcode";
        lstBranch.DataBind();

        CheckBoxList2.DataSource     = ds;
        CheckBoxList2.DataTextField  = "BranchName";
        CheckBoxList2.DataValueField = "Branchcode";
        CheckBoxList2.DataBind();
    }
    private void BindprocurementRemarksData()
    {
        try
        {
            DateTime dt1 = new DateTime();
            dt1 = DateTime.ParseExact(txt_RemmarksDate.Text, "dd/MM/yyyy", null);

            if (rd_sesAm.Checked == true)
            {
                ses = "AM";
            }
            else
            {
                ses = "PM";
            }
            string d1 = dt1.ToString("MM/dd/yyyy");
            ds = Bllproimp.LoadProocurementRemarksDatas(ccode, pcode, d1, ses, IncdecFlag);
            if (ds != null)
            {
                CheckBoxList_Sno.DataSource     = ds;
                CheckBoxList_Sno.DataTextField  = "serial_no";
                CheckBoxList_Sno.DataValueField = "serial_no";
                CheckBoxList_Sno.DataBind();

                CheckBoxList1.DataSource     = ds;
                CheckBoxList1.DataTextField  = "SampleId";
                CheckBoxList1.DataValueField = "SampleId";
                CheckBoxList1.DataBind();

                CheckBoxList2.DataSource     = ds;
                CheckBoxList2.DataTextField  = "agent_Id";
                CheckBoxList2.DataValueField = "agent_Id";
                CheckBoxList2.DataBind();

                CheckBoxList3.DataSource     = ds;
                CheckBoxList3.DataTextField  = "milk_Kg";
                CheckBoxList3.DataValueField = "milk_Kg";
                CheckBoxList3.DataBind();

                CheckBoxList4.DataSource     = ds;
                CheckBoxList4.DataTextField  = "fat";
                CheckBoxList4.DataValueField = "fat";
                CheckBoxList4.DataBind();

                CheckBoxList5.DataSource     = ds;
                CheckBoxList5.DataTextField  = "snf";
                CheckBoxList5.DataValueField = "snf";
                CheckBoxList5.DataBind();

                CheckBoxList6.DataSource     = ds;
                CheckBoxList6.DataTextField  = "magent_Id";
                CheckBoxList6.DataValueField = "magent_Id";
                CheckBoxList6.DataBind();

                CheckBoxList7.DataSource     = ds;
                CheckBoxList7.DataTextField  = "mmilk_Kg";
                CheckBoxList7.DataValueField = "mmilk_Kg";
                CheckBoxList7.DataBind();

                CheckBoxList8.DataSource     = ds;
                CheckBoxList8.DataTextField  = "mfat";
                CheckBoxList8.DataValueField = "mfat";
                CheckBoxList8.DataBind();

                CheckBoxList9.DataSource     = ds;
                CheckBoxList9.DataTextField  = "msnf";
                CheckBoxList9.DataValueField = "msnf";
                CheckBoxList9.DataBind();
            }
            //Adding color to differenciate the remarks modifications Start
            SetColorRemarksData();
            //Adding color to differenciate the remarks modifications End
        }
        catch (Exception ex)
        {
        }
        CheckBoxListClear1();
    }
Beispiel #29
0
    /// <summary>
    /// 加载施工人员
    /// </summary>
    /// <param name="iID"></param>
    private void LoadSGRY(int iID)
    {
        if (iID > 0)
        {
            /// 施工员和安装员组用户才加载
            string strSQL = "SELECT S_USERINFO.ID,'&nbsp;'+CNAME+' '+ISNULL(SSDZ,'')+'&nbsp;&nbsp;' NAME,(Select count(id) from W_GCGD_USERS where W_GCGD_USERS.USERS=S_USERINFO.ID and GCDID=" + iID + ") Selected from S_USERINFO,S_YH_QXZ where FLAG=0  and S_USERINFO.id=S_YH_QXZ.USERID and QXZID =3 order by cname";
            if (OP_Mode.SQLRUN(strSQL))
            {
                if (OP_Mode.Dtv.Count > 0)
                {
                    this.Div1.Visible            = true;
                    CheckBoxList1.DataTextField  = "NAME";
                    CheckBoxList1.DataValueField = "ID";
                    CheckBoxList1.DataSource     = OP_Mode.Dtv;
                    CheckBoxList1.DataBind();
                    string arr1 = string.Empty;;
                    for (int i = 0; i < OP_Mode.Dtv.Count; i++)
                    {
                        if (Convert.ToInt32(OP_Mode.Dtv[i]["Selected"]) > 0)
                        {
                            arr1 += OP_Mode.Dtv[i]["ID"] + ",";
                        }
                    }

                    foreach (ListItem lst in this.CheckBoxList1.Items)
                    {
                        string[] arr = arr1.Trim().Split(',');
                        for (int i = 0; i < arr.Length; i++)
                        {
                            if (arr[i].ToString().Equals(lst.Value))
                            {
                                lst.Selected = true;
                            }
                        }
                    }
                }
                else
                {
                    this.Div1.Visible = false;
                }
            }
            else
            {
                MessageBox("", strSQL + " " + OP_Mode.strErrMsg);
            }

            /// 施工员和安装员组用户才加载
            strSQL = "SELECT S_USERINFO.ID,'&nbsp;'+CNAME+' '+ISNULL(SSDZ,'')+'&nbsp;&nbsp;' NAME,(Select count(id) from W_GCGD_USERS where W_GCGD_USERS.USERS=S_USERINFO.ID and GCDID=" + iID + ") Selected from S_USERINFO,S_YH_QXZ where FLAG=0  and S_USERINFO.id=S_YH_QXZ.USERID and QXZID =4 order by cname";
            if (OP_Mode.SQLRUN(strSQL))
            {
                if (OP_Mode.Dtv.Count > 0)
                {
                    this.Div1.Visible            = true;
                    CheckBoxList2.DataTextField  = "NAME";
                    CheckBoxList2.DataValueField = "ID";
                    CheckBoxList2.DataSource     = OP_Mode.Dtv;
                    CheckBoxList2.DataBind();
                    string arr1 = string.Empty;;
                    for (int i = 0; i < OP_Mode.Dtv.Count; i++)
                    {
                        if (Convert.ToInt32(OP_Mode.Dtv[i]["Selected"]) > 0)
                        {
                            arr1 += OP_Mode.Dtv[i]["ID"] + ",";
                        }
                    }

                    foreach (ListItem lst in this.CheckBoxList2.Items)
                    {
                        string[] arr = arr1.Trim().Split(',');
                        for (int i = 0; i < arr.Length; i++)
                        {
                            if (arr[i].ToString().Equals(lst.Value))
                            {
                                lst.Selected = true;
                            }
                        }
                    }
                }
                else
                {
                    this.Div1.Visible = false;
                }
            }
            else
            {
                MessageBox("", strSQL + " " + OP_Mode.strErrMsg);
            }
        }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        string message  = "";
        string memberno = "";

        CheckBoxList2.DataBind();
        CheckBoxList3.DataBind();
        CheckBoxList4.DataBind();
        CheckBoxList5.DataBind();
        CheckBoxList6.DataBind();

        if (Session["sgques"].ToString() == "SendData")
        {
            DataConnection.insertQuery("update message set sgsubmit='T' where QNO=N'" + Session["quesno"].ToString() + "' and Assemblys=N'" + Session["sadan"].ToString() + "' and Session=N'" + Session["session"].ToString() + "'");
            DataConnection.insertQuery("insert into miscellenous (other_posist_name,posist_no,posist_date,answer_mem_name,ans_no,ans_date,remark,session,assemblys,quesno) values('" + TextBox8.Text + "','" + TextBox9.Text + "','" + Convert.ToDateTime(TextBox10.Text) + "','" + TextBox11.Text + "','" + TextBox12.Text + "','" + Convert.ToDateTime(TextBox13.Text) + "','" + TextBox14.Text + "','" + Session["session"].ToString() + "','" + Session["sadan"] + "'," + Convert.ToInt32(Session["quesno"].ToString()) + ")");

            Response.Redirect("Dashboard.aspx");
        }
        else
        {
            if (getCheckBoxCount(CheckBoxList2) > 0)
            {
                for (int i = 0; i < CheckBoxList2.Items.Count; i++)
                {
                    if (CheckBoxList2.Items[i].Selected)
                    {
                        SqlDataReader r1 = DataConnection.selectQuery("select memeberid from member where member_name=N'" + CheckBoxList2.Items[i].Text.Trim() + "'");
                        if (r1.HasRows)
                        {
                            while (r1.Read())
                            {
                                memberno = r1.GetInt32(0).ToString();
                            }
                        }
                        r1.Close();

                        DataConnection.insertQuery("insert into message(QNO,RCV,Sender,Assemblys,Session) values(N'" + Session["quesno"].ToString() + "',N'" + memberno + "',N'" + Session["RCV"].ToString() + "',N'" + Session["assembly"].ToString() + "',N'" + Session["Session"].ToString() + "')");
                    }
                }
            }

            if (getCheckBoxCount(CheckBoxList3) > 0)
            {
                for (int i = 0; i < CheckBoxList3.Items.Count; i++)
                {
                    if (CheckBoxList3.Items[i].Selected)
                    {
                        SqlDataReader r = DataConnection.selectQuery("select memeberid from member where location=N'" + CheckBoxList3.Items[i].Text.Trim() + "'");
                        if (r.HasRows)
                        {
                            while (r.Read())
                            {
                                memberno = r.GetInt32(0).ToString();
                            }
                        }
                        r.Close();

                        DataConnection.insertQuery("insert into message(QNO,RCV,Sender,Assemblys,Session) values(N'" + Session["quesno"].ToString() + "',N'" + memberno + "',N'" + Session["RCV"].ToString() + "',N'" + Session["assembly"].ToString() + "',N'" + Session["Session"].ToString() + "')");
                    }
                }
            }

            if (getCheckBoxCount(CheckBoxList4) > 0)
            {
                for (int i = 0; i < CheckBoxList4.Items.Count; i++)
                {
                    if (CheckBoxList4.Items[i].Selected)
                    {
                        SqlDataReader re = DataConnection.selectQuery("select memeberid from member where location=N'" + CheckBoxList4.Items[i].Text.Trim() + "'");
                        if (re.HasRows)
                        {
                            while (re.Read())
                            {
                                memberno = re.GetInt32(0).ToString();
                            }
                            re.Close();
                            DataConnection.insertQuery("insert into message(QNO,RCV,Sender,Assemblys,Session) values(N'" + Session["quesno"].ToString() + "',N'" + memberno + "',N'" + Session["RCV"].ToString() + "',N'" + Session["assembly"].ToString() + "',N'" + Session["Session"].ToString() + "')");
                        }
                    }
                }
            }

            if (getCheckBoxCount(CheckBoxList5) > 0)
            {
                for (int i = 0; i < CheckBoxList5.Items.Count; i++)
                {
                    if (CheckBoxList5.Items[i].Selected)
                    {
                        SqlDataReader re2 = DataConnection.selectQuery("select memeberid from member where location=N'" + CheckBoxList5.Items[i].Text.Trim() + "'");
                        if (re2.HasRows)
                        {
                            while (re2.Read())
                            {
                                memberno = re2.GetInt32(0).ToString();
                            }
                            re2.Close();
                            DataConnection.insertQuery("insert into message(QNO,RCV,Sender,Assemblys,Session) values(N'" + Session["quesno"].ToString() + "',N'" + memberno + "',N'" + Session["RCV"].ToString() + "',N'" + Session["assembly"].ToString() + "',N'" + Session["Session"].ToString() + "')");
                        }
                    }
                }
            }


            if (getCheckBoxCount(CheckBoxList6) > 0)
            {
                for (int i = 0; i < CheckBoxList6.Items.Count; i++)
                {
                    if (CheckBoxList6.Items[i].Selected)
                    {
                        SqlDataReader re3 = DataConnection.selectQuery("select memeberid from member where location=N'" + CheckBoxList6.Items[i].Text.Trim() + "'");
                        if (re3.HasRows)
                        {
                            while (re3.Read())
                            {
                                memberno = re3.GetInt32(0).ToString();
                            }
                            re3.Close();
                            DataConnection.insertQuery("insert into message(QNO,RCV,Sender,Assemblys,Session) values(N'" + Session["quesno"].ToString() + "',N'" + memberno + "',N'" + Session["RCV"].ToString() + "',N'" + Session["assembly"].ToString() + "',N'" + Session["Session"].ToString() + "')");
                        }
                    }
                }
            }


            if (getCheckBoxCount(CheckBoxList2) < 0)
            {
                message = "Select Atleast Section ";
                ClientScript.RegisterClientScriptBlock(this.GetType(), "alert", "alert('" + message + "');", true);
                return;
            }
        }
        message = "Data has Stored Successfully";
        ClientScript.RegisterClientScriptBlock(this.GetType(), "alert", "alert('" + message + "');", true);
        Response.Redirect("Dashboard.aspx");
    }