Пример #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Session["name"] == null)
                {
                    Response.Redirect("~/loginPage.aspx");
                }
                else
                {
                    string username = Session["name"].ToString();
                    this.Label8.Text = string.Format("Hi {0}", Session["name"].ToString() + "!");
                    //Label8.Visible = false;
                    //Label8.Text = username;

                    string        connString = ConfigurationManager.ConnectionStrings["tomms_prodConnectionString"].ConnectionString;
                    SqlConnection con        = null;

                    try
                    {
                        con = new SqlConnection(connString);

                        /*For State Dropdown Load*/
                        string com = "Select RowID, ast_lvl_ast_lvl  from ast_lvl (nolock)";

                        SqlDataAdapter adpt = new SqlDataAdapter(com, con);
                        DataTable      dt   = new DataTable();
                        adpt.Fill(dt);
                        DropDownState.DataSource = dt;
                        DropDownState.DataBind();
                        DropDownState.DataTextField  = "ast_lvl_ast_lvl";
                        DropDownState.DataValueField = "RowID";
                        DropDownState.DataBind();
                        DropDownState.Items.Insert(0, new ListItem("ALL", "0"));

                        /*For District Dropdown Load*/

                        DropDownDistrict.Items.Insert(0, new ListItem("ALL", "0"));

                        /*For Clinic Cate Dropdown Load*/
                        DropDownCliniccat.Items.Insert(0, new ListItem("Dental Delivery Units", "1"));
                        DropDownCliniccat.Items.Insert(0, new ListItem("CHAIRS, EXAMINATION/TREATMENT, DENTISTRY, SPECIALIST", "2"));
                        DropDownCliniccat.Items.Insert(0, new ListItem("Chairs, Examination/Treatment, Dentistry", "3"));
                        DropDownCliniccat.Items.Insert(0, new ListItem("ALL", "0"));
                    }
                    catch (Exception ex)
                    {
                        //log error
                        //display friendly error to user
                        string msg = "Insert Error:";
                        msg += ex.Message;
                        throw new Exception(msg);
                    }
                    finally
                    {
                        con.Close();
                    }
                }
            }
        }
Пример #2
0
 private void fillddl()
 {
     DropDownState.DataSource     = db.manage_state(0, "", 4);
     DropDownState.DataTextField  = "StateName";
     DropDownState.DataValueField = "StateId";
     DropDownState.DataBind();
     DropDownState.Items.Insert(0, "--Select State--");
 }
Пример #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Session["name"] == null)
                {
                    Session["prevUrl"] = Request.Url;
                    Response.Redirect("~/loginPage.aspx");
                }
                else
                {
                    string username = Session["name"].ToString();
                    this.Label8.Text = string.Format("Hi {0}", Session["name"].ToString() + "!");

                    string        connString = ConfigurationManager.ConnectionStrings["tomms_prodConnectionString"].ConnectionString;
                    SqlConnection con        = null;

                    try
                    {
                        con = new SqlConnection(connString);
                        /*For State Dropdown Load*/
                        string com = "Select RowID, ast_lvl_ast_lvl  from ast_lvl (nolock)";

                        SqlDataAdapter adpt = new SqlDataAdapter(com, con);
                        DataTable      dt   = new DataTable();
                        adpt.Fill(dt);
                        DropDownState.DataSource = dt;
                        DropDownState.DataBind();
                        DropDownState.DataTextField  = "ast_lvl_ast_lvl";
                        DropDownState.DataValueField = "RowID";
                        DropDownState.DataBind();
                        DropDownState.Items.Insert(0, new ListItem("--Select--", "0"));

                        DropDownClinicCategory.Items.Insert(0, new ListItem("KESIHATAN", "1"));
                        DropDownClinicCategory.Items.Insert(0, new ListItem("PERGIGIAN", "2"));
                        DropDownClinicCategory.Items.Insert(0, new ListItem("ALL", "0"));

                        // MyReportViewer.ServerReport.ReportServerUrl = new Uri("http://chs015-2-3/ReportServer");
                        MyReportViewer.ServerReport.ReportServerUrl = new Uri("http://Localhost/ReportServer");
                        MyReportViewer.ServerReport.ReportPath      = "/AdditionalEB EquipmentList FORMVAR2/MEET";
                        MyReportViewer.ServerReport.Refresh();
                    }
                    catch (Exception ex)
                    {
                        //log error
                        //display friendly error to user
                        string msg = "Insert Error:";
                        msg += ex.Message;
                        throw new Exception(msg);
                    }
                    finally
                    {
                        con.Close();
                    }
                }
            }
        }
Пример #4
0
    protected void loadstate()
    {
        if (DropDowncountry.SelectedIndex != 0)
        {
            int conutryId = Convert.ToInt32(DropDowncountry.SelectedValue);

            DataTable dt = mpDetailsBAL.loadState(conutryId);
            DropDownState.DataSource     = dt;
            DropDownState.DataTextField  = "state";
            DropDownState.DataValueField = "stateId";
            DropDownState.DataBind();
            DropDownState.Items.Insert(0, new ListItem("Select State", "0"));
            string estate = dt1.Rows[0]["state"].ToString();
            DropDownState.Items.FindByText(estate).Selected = true;
            loadconstituency();// to load and select the relevant constituency.

            DropDownpermanentState.DataSource     = dt;
            DropDownpermanentState.DataTextField  = "state";
            DropDownpermanentState.DataValueField = "stateId";
            DropDownpermanentState.DataBind();
            DropDownpermanentState.Items.Insert(0, new ListItem("Select State", "0"));
            string pstate = dt1.Rows[0]["permanentState"].ToString();
            DropDownpermanentState.Items.FindByText(pstate).Selected = true;
            loadpermanentDistrict();

            DropDowncurrentState.DataSource     = dt;
            DropDowncurrentState.DataTextField  = "state";
            DropDowncurrentState.DataValueField = "stateId";
            DropDowncurrentState.DataBind();
            DropDowncurrentState.Items.Insert(0, new ListItem("Select State", "0"));
            string cstate = dt1.Rows[0]["currentState"].ToString();
            DropDowncurrentState.Items.FindByText(cstate).Selected = true;
            loadcurrentDistrict();

            // put party in party combo box.
            dt.Dispose();
            dt = mpDetailsBAL.loadParty(conutryId);
            DropDownparty.DataSource     = dt;
            DropDownparty.DataTextField  = "partyName";
            DropDownparty.DataValueField = "partyId";
            DropDownparty.DataBind();
            DropDownparty.Items.Insert(0, new ListItem("Select Party", "0"));
            string pparty = dt1.Rows[0]["partyName"].ToString();
            DropDownparty.Items.FindByText(pparty).Selected = true;
        }
        else
        {
            DropDownState.Items.Clear();
            DropDownState.Items.Insert(0, new ListItem("Select State", "0"));
            DropDownpermanentState.Items.Clear();
            DropDownpermanentState.Items.Insert(0, new ListItem("Select State", "0"));
            DropDowncurrentState.Items.Clear();
            DropDowncurrentState.Items.Insert(0, new ListItem("Select State", "0"));
        }
    }
Пример #5
0
        protected void DropDownZone_SelectedIndexChanged(object sender, EventArgs e)
        {
            string        connString = ConfigurationManager.ConnectionStrings["tomms_prodConnectionString"].ConnectionString;
            SqlConnection con        = null;

            try
            {
                con = new SqlConnection(connString);

                /*For Zone Dropdown Load*/
                if (DropDownZone.SelectedItem.Text == "ALL")
                {
                    /*For State Dropdown Load*/
                    string com = "Select RowID, ast_lvl_ast_lvl  from ast_lvl (nolock)";

                    SqlDataAdapter adpt = new SqlDataAdapter(com, con);
                    DataTable      dt   = new DataTable();
                    adpt.Fill(dt);
                    DropDownState.DataSource = dt;
                    DropDownState.DataBind();
                    DropDownState.DataTextField  = "ast_lvl_ast_lvl";
                    DropDownState.DataValueField = "RowID";
                    DropDownState.DataBind();
                    DropDownState.Items.Insert(0, new ListItem("ALL", "0"));
                }
                else
                {
                    /*For State Dropdown Load*/
                    string com = "Select distinct Dense_rank() Over(order by ast_loc_state) as RowID, ast_loc_state as ast_lvl_ast_lvl from ast_loc (Nolock) where ast_loc_zone = '" + DropDownZone.SelectedItem.Text + "'";

                    SqlDataAdapter adpt = new SqlDataAdapter(com, con);
                    DataTable      dt   = new DataTable();
                    adpt.Fill(dt);
                    DropDownState.DataSource = dt;
                    DropDownState.DataBind();
                    DropDownState.DataTextField  = "ast_lvl_ast_lvl";
                    DropDownState.DataValueField = "RowID";
                    DropDownState.DataBind();
                    DropDownState.Items.Insert(0, new ListItem("ALL", "0"));
                }
            }
            catch (Exception ex)
            {
                //log error
                //display friendly error to user
                string msg = "Insert Error:";
                msg += ex.Message;
            }
        }
Пример #6
0
        public void fillData()
        {
            DropDownState.DataTextField = objBusinessLayer.BusinessFillState().Columns[0].ToString();
            objDataTableOne             = objBusinessLayer.BusinessFillState();
            DropDownState.DataSource    = objDataTableOne;
            DropDownState.DataBind();

            DropDownPlan.DataTextField = objBusinessLayer.BusinessFillPlan().Columns[0].ToString();
            objDataTableTwo            = objBusinessLayer.BusinessFillPlan();
            DropDownPlan.DataSource    = objDataTableTwo;
            DropDownPlan.DataBind();

            Random rnd = new Random();

            lblPatientID.Text = Convert.ToString(rnd.Next(10000, 99999));
        }
Пример #7
0
 public void State()
 {
     cn.Open();
     //Response.Write(DropDownCountry.SelectedValue);
     using (SqlCommand cmd = new SqlCommand("select StateName,stateid from Statetable where CountryId='" + DropDownCountry.SelectedValue + "'", cn))
     {
         using (SqlDataReader dr = cmd.ExecuteReader(CommandBehavior.CloseConnection))
         {
             DropDownState.DataSource = dr;
             DropDownState.Items.Clear();
             DropDownState.Items.Add("Please Select State");
             DropDownState.DataTextField  = "StateName";
             DropDownState.DataValueField = "StateId";
             DropDownState.DataBind();
         }
     }
 }
Пример #8
0
    protected void DropDowncountry_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (DropDowncountry.SelectedIndex != 0)
        {
            int conutryId = Convert.ToInt32(DropDowncountry.SelectedValue);

            DataTable dt = mpDetailsBAL.loadState(conutryId);
            DropDownState.DataSource     = dt;
            DropDownState.DataTextField  = "state";
            DropDownState.DataValueField = "stateId";
            DropDownState.DataBind();
            DropDownState.Items.Insert(0, new ListItem("Select State", "0"));

            DropDownpermanentState.DataSource     = dt;
            DropDownpermanentState.DataTextField  = "state";
            DropDownpermanentState.DataValueField = "stateId";
            DropDownpermanentState.DataBind();
            DropDownpermanentState.Items.Insert(0, new ListItem("Select State", "0"));

            DropDowncurrentState.DataSource     = dt;
            DropDowncurrentState.DataTextField  = "state";
            DropDowncurrentState.DataValueField = "stateId";
            DropDowncurrentState.DataBind();
            DropDowncurrentState.Items.Insert(0, new ListItem("Select State", "0"));

            // put party in party combo box.
            dt.Dispose();
            dt = mpDetailsBAL.loadParty(conutryId);
            DropDownparty.DataSource     = dt;
            DropDownparty.DataTextField  = "partyName";
            DropDownparty.DataValueField = "partyId";
            DropDownparty.DataBind();
            DropDownparty.Items.Insert(0, new ListItem("Select Party", "0"));
        }
        else
        {
            DropDownState.Items.Clear();
            DropDownState.Items.Insert(0, new ListItem("Select State", "0"));
            DropDownpermanentState.Items.Clear();
            DropDownpermanentState.Items.Insert(0, new ListItem("Select State", "0"));
            DropDowncurrentState.Items.Clear();
            DropDowncurrentState.Items.Insert(0, new ListItem("Select State", "0"));
        }
    }
Пример #9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string        connString = ConfigurationManager.ConnectionStrings["tomms_prodConnectionString"].ConnectionString;
                SqlConnection con        = null;

                try
                {
                    con = new SqlConnection(connString);
                    /*For State Dropdown Load*/
                    string com = "select Statecode , SatateDesc  from PR_location_mst (nolock)";

                    SqlDataAdapter adpt = new SqlDataAdapter(com, con);
                    DataTable      dt   = new DataTable();
                    adpt.Fill(dt);
                    DropDownState.DataSource = dt;
                    DropDownState.DataBind();
                    DropDownState.DataTextField  = "SatateDesc";
                    DropDownState.DataValueField = "Statecode";
                    DropDownState.DataBind();
                    DropDownState.Items.Insert(0, new ListItem("ALL", "0"));

                    /*For PO Status Dropdown Load*/
                    string com1 = "select ast_grp_grp_cd ,ast_grp_general_name from ast_grp (nolock) order by ast_grp_general_name";

                    SqlDataAdapter adpt1 = new SqlDataAdapter(com1, con);
                    DataTable      dt1   = new DataTable();
                    adpt1.Fill(dt1);
                    Category.DataSource = dt1;
                    Category.DataBind();
                    Category.DataTextField  = "ast_grp_general_name";
                    Category.DataValueField = "ast_grp_grp_cd";
                    Category.DataBind();
                    Category.Items.Insert(0, new ListItem("ALL", "0"));

                    /*For PO Status Dropdown Load*/
                    string com2 = "select mfg_mst_mfg_cd , mfg_mst_mfg_cd as MfgDescription from mfg_mst (nolock) order by mfg_mst_mfg_cd ";

                    SqlDataAdapter adpt2 = new SqlDataAdapter(com2, con);
                    DataTable      dt2   = new DataTable();
                    adpt2.Fill(dt2);
                    Manafacturer.DataSource = dt2;
                    Manafacturer.DataBind();
                    Manafacturer.DataTextField  = "MfgDescription";
                    Manafacturer.DataValueField = "mfg_mst_mfg_cd";
                    Manafacturer.DataBind();
                    Manafacturer.Items.Insert(0, new ListItem("ALL", "0"));
                }
                catch (Exception ex)
                {
                    //log error
                    //display friendly error to user
                    string msg = "Insert Error:";
                    msg += ex.Message;
                    throw new Exception(msg);
                }
                finally
                {
                    con.Close();
                }
            }
        }
Пример #10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Session["name"] == null)
                {
                    Session["prevUrl"] = Request.Url;
                    Response.Redirect("~/loginPage.aspx");
                }
                else
                {
                    string username = Session["name"].ToString();
                    this.Label8.Text = string.Format("Hi {0}", Session["name"].ToString() + "!");

                    string        connString = ConfigurationManager.ConnectionStrings["tomms_prodConnectionString"].ConnectionString;
                    SqlConnection con        = null;

                    try
                    {
                        con = new SqlConnection(connString);
                        /*For State Dropdown Load*/
                        string com = "Select RowID, ast_lvl_ast_lvl  from ast_lvl (nolock)";

                        SqlDataAdapter adpt = new SqlDataAdapter(com, con);
                        DataTable      dt   = new DataTable();
                        adpt.Fill(dt);
                        DropDownState.DataSource = dt;
                        DropDownState.DataBind();
                        DropDownState.DataTextField  = "ast_lvl_ast_lvl";
                        DropDownState.DataValueField = "RowID";
                        DropDownState.DataBind();
                        DropDownState.Items.Insert(0, new ListItem("--Select--", "0"));


                        DropDownDistrict.Items.Insert(0, new ListItem("--Select--", "0"));

                        DropDownDocType.Items.Insert(0, new ListItem("PPM B03 & CHECKLIST", "1"));
                        //  DropDownDocType.Items.Insert(0, new ListItem("PPM CHECKLIST", "2"));//commented by muruganantham
                        DropDownDocType.Items.Insert(0, new ListItem("--Select--", "0"));

                        freq_DropDownList1.Items.Insert(0, new ListItem("--Select--", "0"));
                        freq_DropDownList1.Items.Insert(1, new ListItem("1", "1"));
                        freq_DropDownList1.Items.Insert(2, new ListItem("2", "2"));



                        string com1 = "WITH Years(No , Year) AS  ( SELECT 1, 2013 year UNION ALL  SELECT No+1,year+1 FROM  Years AS d  where   Year < Year(getdate())) SELECT No , Year FROM Years order by year desc";

                        SqlDataAdapter adpt1 = new SqlDataAdapter(com1, con);
                        DataTable      dt1   = new DataTable();
                        adpt1.Fill(dt1);
                        DropDownYear.DataSource = dt1;
                        DropDownYear.DataBind();
                        DropDownYear.DataTextField  = "Year";
                        DropDownYear.DataValueField = "No";
                        DropDownYear.DataBind();
                        DropDownYear.Items.Insert(0, new ListItem("--Select--", "0"));
                    }
                    catch (Exception ex)
                    {
                        //log error
                        //display friendly error to user
                        string msg = "Insert Error:";
                        msg += ex.Message;
                        throw new Exception(msg);
                    }
                    finally
                    {
                        con.Close();
                    }
                }
            }
        }
Пример #11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Session["name"] == null)
                {
                    Session["prevUrl"] = Request.Url;
                    Response.Redirect("~/loginPage.aspx");
                }
                else
                {
                    string username = Session["name"].ToString();
                    this.Label8.Text = string.Format("Hi {0}", Session["name"].ToString() + "!");
                    // Label8.Visible = false;
                    //  Label8.Text = username;

                    string        connString = ConfigurationManager.ConnectionStrings["tomms_prodConnectionString"].ConnectionString;
                    SqlConnection con        = null;

                    try
                    {
                        con = new SqlConnection(connString);

                        /*For Zone Dropdown Load*/
                        string com01 = "select distinct  ast_loc_zone , ast_loc_zone from ast_loc (nolock)";

                        SqlDataAdapter adptzo = new SqlDataAdapter(com01, con);
                        DataTable      dtzo   = new DataTable();
                        adptzo.Fill(dtzo);
                        DropDownZone.DataSource = dtzo;
                        DropDownZone.DataBind();
                        DropDownZone.DataTextField  = "ast_loc_zone";
                        DropDownZone.DataValueField = "ast_loc_zone";
                        DropDownZone.DataBind();
                        DropDownZone.Items.Insert(0, new ListItem("ALL", "0"));

                        /*For State Dropdown Load*/
                        string com = "Select RowID, ast_lvl_ast_lvl  from ast_lvl (nolock)";

                        SqlDataAdapter adpt = new SqlDataAdapter(com, con);
                        DataTable      dt   = new DataTable();
                        adpt.Fill(dt);
                        DropDownState.DataSource = dt;
                        DropDownState.DataBind();
                        DropDownState.DataTextField  = "ast_lvl_ast_lvl";
                        DropDownState.DataValueField = "RowID";
                        DropDownState.DataBind();
                        DropDownState.Items.Insert(0, new ListItem("ALL", "0"));

                        /*For District Dropdown Load*/
                        DropDownDistrict.Items.Insert(0, new ListItem("ALL", "0"));

                        /*For Circle Dropdown Load*/
                        DropDowncircle.Items.Insert(0, new ListItem("ALL", "0"));

                        /*For Clinic Cate Dropdown Load*/
                        DropDownCliniccat.Items.Insert(0, new ListItem("KESIHATAN", "1"));
                        DropDownCliniccat.Items.Insert(0, new ListItem("PERGIGIAN", "2"));
                        DropDownCliniccat.Items.Insert(0, new ListItem("ALL", "0"));

                        /*For BE Category Cate Dropdown Load*/
                        string com4 = "select ast_grp_grp_cd , ast_grp_category  from ast_grp (nolock) order by ast_grp_category ";

                        SqlDataAdapter adpt4 = new SqlDataAdapter(com4, con);
                        DataTable      dt4   = new DataTable();
                        adpt4.Fill(dt4);
                        DropDownBECate.DataSource = dt4;
                        DropDownBECate.DataBind();
                        DropDownBECate.DataTextField  = "ast_grp_category";
                        DropDownBECate.DataValueField = "ast_grp_grp_cd";
                        DropDownBECate.DataBind();
                        DropDownBECate.Items.Insert(0, new ListItem("ALL", "0"));

                        /*For BE Category Cate Dropdown Load*/
                        string com5 = "select wrk_sts_status ,wrk_sts_desc from wrk_sts (nolock) where wrk_sts_disable_flag = 0";

                        SqlDataAdapter adpt5 = new SqlDataAdapter(com5, con);
                        DataTable      dt5   = new DataTable();
                        adpt5.Fill(dt5);
                        DropDownList1.DataSource = dt5;
                        DropDownList1.DataBind();
                        DropDownList1.DataTextField  = "wrk_sts_desc";
                        DropDownList1.DataValueField = "wrk_sts_status";
                        DropDownList1.DataBind();
                        DropDownList1.Items.Insert(0, new ListItem("ALL", "0"));
                    }
                    catch (Exception ex)
                    {
                        //log error
                        //display friendly error to user
                        string msg = "Insert Error:";
                        msg += ex.Message;
                        throw new Exception(msg);
                    }
                    finally
                    {
                        con.Close();
                    }
                }
            }
        }
Пример #12
0
 protected void Page_Load(object sender, EventArgs e)
 {
     DropDownState.DataSource = states;
     DropDownState.DataBind();
 }
Пример #13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Session["name"] == null)
                {
                    Session["prevUrl"] = Request.Url;
                    Response.Redirect("~/loginPage.aspx");
                }
                else
                {
                    string username = Session["name"].ToString();
                    this.Label8.Text = string.Format("Hi {0}", Session["name"].ToString() + "!");
                    //Label8.Visible = false;
                    //Label8.Text = username;


                    string        connString = ConfigurationManager.ConnectionStrings["tomms_prodConnectionString"].ConnectionString;
                    SqlConnection con        = null;

                    try
                    {
                        con = new SqlConnection(connString);
                        /*For State Dropdown Load*/
                        string com = "Select RowID, ast_lvl_ast_lvl  from ast_lvl (nolock)";

                        SqlDataAdapter adpt = new SqlDataAdapter(com, con);
                        DataTable      dt   = new DataTable();
                        adpt.Fill(dt);
                        DropDownState.DataSource = dt;
                        DropDownState.DataBind();
                        DropDownState.DataTextField  = "ast_lvl_ast_lvl";
                        DropDownState.DataValueField = "RowID";
                        DropDownState.DataBind();
                        DropDownState.Items.Insert(0, new ListItem("ALL", "0"));

                        /*For District Dropdown Load*/

                        //string com1 = "select RowID , ast_loc_ast_loc from  ast_loc (nolock) where ast_loc_state = '" + DropDownState.SelectedItem.Text + "'";
                        //
                        //SqlDataAdapter adpt1 = new SqlDataAdapter(com1, con);
                        //DataTable dt1 = new DataTable();
                        //adpt1.Fill(dt1);
                        //DropDownDistrict.DataSource = dt1;
                        //DropDownDistrict.DataBind();
                        //DropDownDistrict.DataTextField = "ast_loc_ast_loc";
                        //DropDownDistrict.DataValueField = "RowID";
                        //DropDownDistrict.DataBind();
                        DropDownDistrict.Items.Insert(0, new ListItem("ALL", "0"));

                        /*For Circle Dropdown Load*/

                        //string Com2 = "select RowID , ast_loc_circle from  ast_loc (nolock) where ast_loc_state = '" + DropDownState.SelectedItem.Text + "' and ast_loc_ast_loc = '" + DropDownDistrict.SelectedItem.Text + "'";
                        //
                        //SqlDataAdapter adpt2 = new SqlDataAdapter(Com2, con);
                        //DataTable dt2 = new DataTable();
                        //adpt2.Fill(dt2);
                        //DropDowncircle.DataSource = dt2;
                        //DropDowncircle.DataBind();
                        //DropDowncircle.DataTextField = "ast_loc_circle";
                        //DropDowncircle.DataValueField = "RowID";
                        //DropDowncircle.DataBind();
                        DropDowncircle.Items.Insert(0, new ListItem("ALL", "0"));

                        /*For Clinic Cate Dropdown Load*/
                        DropDownCliniccat.Items.Insert(0, new ListItem("KESIHATAN", "1"));
                        DropDownCliniccat.Items.Insert(0, new ListItem("PERGIGIAN", "2"));
                        DropDownCliniccat.Items.Insert(0, new ListItem("ALL", "0"));

                        /*For Ownership Dropdown Load*/
                        DropDownOwner.Items.Insert(0, new ListItem("Existing", "1"));
                        DropDownOwner.Items.Insert(0, new ListItem("New Biomedical", "2"));
                        DropDownOwner.Items.Insert(0, new ListItem("Purchase Biomedical", "3"));
                        DropDownOwner.Items.Insert(0, new ListItem("ALL", "0"));

                        /*For BE Category Cate Dropdown Load*/
                        string com4 = "select ast_grp_grp_cd , ast_grp_category  from ast_grp (nolock) order by ast_grp_category ";

                        SqlDataAdapter adpt4 = new SqlDataAdapter(com4, con);
                        DataTable      dt4   = new DataTable();
                        adpt4.Fill(dt4);
                        DropDownBECate.DataSource = dt4;
                        DropDownBECate.DataBind();
                        DropDownBECate.DataTextField  = "ast_grp_category";
                        DropDownBECate.DataValueField = "ast_grp_grp_cd";
                        DropDownBECate.DataBind();
                        DropDownBECate.Items.Insert(0, new ListItem("ALL", "0"));
                    }
                    catch (Exception ex)
                    {
                        //log error
                        //display friendly error to user
                        string msg = "Insert Error:";
                        msg += ex.Message;
                        throw new Exception(msg);
                    }
                    finally
                    {
                        con.Close();
                    }
                }
            }
        }
Пример #14
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Session["name"] == null)
                {
                    Session["prevUrl"] = Request.Url;
                    Response.Redirect("~/loginPage.aspx");
                }
                else
                {
                    string username = Session["name"].ToString();
                    this.Label8.Text = string.Format("Hi {0}", Session["name"].ToString() + "!");
                    //Label8.Visible = false;
                    //Label8.Text = username;

                    string        connString = ConfigurationManager.ConnectionStrings["tomms_prodConnectionString"].ConnectionString;
                    SqlConnection con        = null;

                    try
                    {
                        con = new SqlConnection(connString);

                        string com01 = "select distinct  ast_loc_zone , ast_loc_zone from ast_loc (nolock)";

                        SqlDataAdapter adptzo = new SqlDataAdapter(com01, con);
                        DataTable      dtzo   = new DataTable();
                        adptzo.Fill(dtzo);
                        DropDownZone.DataSource = dtzo;
                        DropDownZone.DataBind();
                        DropDownZone.DataTextField  = "ast_loc_zone";
                        DropDownZone.DataValueField = "ast_loc_zone";
                        DropDownZone.DataBind();
                        DropDownZone.Items.Insert(0, new ListItem("ALL", "0"));


                        /*For State Dropdown Load*/
                        string com = "Select RowID, ast_lvl_ast_lvl  from ast_lvl (nolock)";

                        SqlDataAdapter adpt = new SqlDataAdapter(com, con);
                        DataTable      dt   = new DataTable();
                        adpt.Fill(dt);
                        DropDownState.DataSource = dt;
                        DropDownState.DataBind();
                        DropDownState.DataTextField  = "ast_lvl_ast_lvl";
                        DropDownState.DataValueField = "RowID";
                        DropDownState.DataBind();
                        DropDownState.Items.Insert(0, new ListItem("ALL", "0"));

                        DropDownDistrict.Items.Insert(0, new ListItem("ALL", "0"));

                        DropDownCliniccat.Items.Insert(0, new ListItem("KESIHATAN", "1"));
                        DropDownCliniccat.Items.Insert(0, new ListItem("PERGIGIAN", "2"));
                        DropDownCliniccat.Items.Insert(0, new ListItem("ALL", "0"));

                        /*For State Dropdown Load*/
                        string comown = "select distinct Ownership_desc as 'Ownership' , Ownership_desc from ownership_mst (nolock)";

                        SqlDataAdapter adptown = new SqlDataAdapter(comown, con);
                        DataTable      dtown   = new DataTable();
                        adptown.Fill(dtown);
                        DropDownownership.DataSource = dtown;
                        DropDownownership.DataBind();
                        DropDownownership.DataTextField  = "Ownership_desc";
                        DropDownownership.DataValueField = "Ownership";
                        DropDownownership.DataBind();
                        DropDownownership.Items.Insert(0, new ListItem("ALL", "0"));


                        MyReportViewer.ProcessingMode = ProcessingMode.Remote;
                        MyReportViewer.ServerReport.ReportServerUrl = new Uri("http://localhost/ReportServer");
                        MyReportViewer.ServerReport.ReportPath      = "/TSD-Performance/TSD-USM-KPIPenalty";
                        MyReportViewer.ServerReport.Refresh();
                    }
                    catch (Exception ex)
                    {
                        //log error
                        //display friendly error to user
                        string msg = "Insert Error:";
                        msg += ex.Message;
                        throw new Exception(msg);
                    }
                    finally
                    {
                        con.Close();
                    }
                }
            }
        }