示例#1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["mem_id"] != "")
        {
            //item_del signifies deletion of product by member.


            if (Request.QueryString["item_del"] == "1")
            {
                item_id = Int32.Parse(Request.QueryString["item_id"]);
                SqlDataAdapter da52 = new SqlDataAdapter("select * from prod_request where owner_id='" + Session["mem_id"] + "' and item_id='" + item_id + "'", cn);
                DataTable      dt52 = new DataTable();
                cn.Open();
                da52.Fill(dt52);
                cn.Close();
                req_count      = dt52.Rows.Count.ToString();
                Panel3.Visible = true;
            }

            else if (Request.QueryString["item_del"] == "0")
            {
                Panel3.Visible = false;
            }



            if (!IsPostBack)
            {
                // Session["mem_id"] = 2;

                item_id = Int32.Parse(Request.QueryString["item_id"]);



                SqlDataAdapter da = new SqlDataAdapter("select * from item_data where item_id='" + item_id + "'", cn);
                DataTable      dt = new DataTable();
                cn.Open();
                da.Fill(dt);
                cn.Close();

                pic_1             = dt.Rows[0]["pic_1"].ToString();
                pic_2             = dt.Rows[0]["pic_2"].ToString();
                pic_3             = dt.Rows[0]["pic_3"].ToString();
                pic_4             = dt.Rows[0]["pic_4"].ToString();
                condition         = dt.Rows[0]["condition"].ToString();
                area              = dt.Rows[0]["area"].ToString();
                city              = dt.Rows[0]["city"].ToString();
                country           = dt.Rows[0]["country"].ToString();
                cat               = dt.Rows[0]["cat"].ToString();
                item_name         = dt.Rows[0]["name"].ToString();
                desc.Text         = dt.Rows[0]["details"].ToString();
                owner_id          = dt.Rows[0]["owner_id"].ToString();
                req_panel.Visible = true;
                Panel7.Visible    = false;
                Panel4.Visible    = false;

                //logic to check already requested product

                if (Session["mem_id"].ToString() != "")
                {
                    SqlDataAdapter da1 = new SqlDataAdapter("select * from prod_request where item_id='" + item_id + "' and mem_id='" + Session["mem_id"] + "'", cn);
                    DataTable      dt1 = new DataTable();
                    cn.Open();
                    da1.Fill(dt1);
                    cn.Close();

                    //removing request button during item delete process

                    if (dt1.Rows.Count > 0)
                    {
                        if (Request.QueryString["item_del"] == "1")
                        {
                            Panel1.Visible = false;
                            Panel2.Visible = false;
                        }
                        else
                        {
                            Panel1.Visible = false;
                            Panel2.Visible = true;
                        }
                    }

                    else if (dt1.Rows.Count == 0)
                    {
                        if (Request.QueryString["item_del"] == "1")
                        {
                            Panel1.Visible = false;
                            Panel2.Visible = false;
                        }
                        else
                        {
                            Panel1.Visible = true;
                            Panel2.Visible = false;
                        }
                    }
                }
            }
        }

        else
        {
            if (!IsPostBack)
            {
                item_id = Int32.Parse(Request.QueryString["item_id"]);



                SqlDataAdapter da = new SqlDataAdapter("select * from item_data where item_id='" + item_id + "'", cn);
                DataTable      dt = new DataTable();
                cn.Open();
                da.Fill(dt);
                cn.Close();

                pic_1     = dt.Rows[0]["pic_1"].ToString();
                pic_2     = dt.Rows[0]["pic_2"].ToString();
                pic_3     = dt.Rows[0]["pic_3"].ToString();
                pic_4     = dt.Rows[0]["pic_4"].ToString();
                condition = dt.Rows[0]["condition"].ToString();
                area      = dt.Rows[0]["area"].ToString();
                city      = dt.Rows[0]["city"].ToString();
                country   = dt.Rows[0]["country"].ToString();
                cat       = dt.Rows[0]["cat"].ToString();
                item_name = dt.Rows[0]["name"].ToString();
                desc.Text = dt.Rows[0]["details"].ToString();
                owner_id  = dt.Rows[0]["owner_id"].ToString();

                SqlDataAdapter da_cont = new SqlDataAdapter("select DISTINCT CONT from state", cn);
                DataSet        ds_cont = new DataSet();
                cn.Open();
                da_cont.Fill(ds_cont);
                cn.Close();
                DropDownList1.DataTextField  = ds_cont.Tables[0].Columns["CONT"].ToString();
                DropDownList1.DataValueField = ds_cont.Tables[0].Columns["CONT"].ToString();
                DropDownList1.DataSource     = ds_cont.Tables[0];
                DropDownList1.DataBind();

                Panel1.Visible    = true;
                Panel2.Visible    = false;
                Panel4.Visible    = false;
                Panel7.Visible    = true;
                Panel5.Visible    = false;
                Panel6.Visible    = false;
                req_panel.Visible = false;

                //link_parser = "/website5/detail_fb.ashx?item_id="+item_id+"&item_del=0";
            }
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["FTID"] == null)
        {
            Response.Redirect("Default.aspx");
        }
        if (((String)Session["Right"]) == "S")
        {
            Response.Redirect("Home_Page_Support.aspx");
        }
        String Incident = Request.QueryString["param1"];

        try
        {
            Incident = CryptoEngine1.Decrypt(Incident, "sblw-3hn8-sqoy19");
        }
        catch (Exception ex)
        {
            //  Response.Redirect("Default.aspx");
        }
        Label1.Text = Incident;

        string        connetionString;
        SqlConnection cnn;

        connetionString = @"Data Source=10.238.110.196;Initial Catalog=Expedite;User ID=sa;Password=Orange@123$";
        cnn             = new SqlConnection(connetionString);
        // cnn.Open();

        string strSelect = "Select * From [Expedite].[dbo].[UrgencyReasons]";
        // string strSelect = "Select * From [dbo].['All_Incidents'] ;";
        //   SqlCommand cmd = new SqlCommand(strSelect, cnn);
        SqlDataAdapter adpt = new SqlDataAdapter(strSelect, cnn);

        DataTable dt = new DataTable();

        adpt.Fill(dt);
        DropDownList1.DataSource     = dt;
        DropDownList1.DataTextField  = "UrgencyReason";
        DropDownList1.DataValueField = "ID";
        DropDownList1.DataBind();
        //  Label1.Text = myReader.GetValue(0).ToString();

        if (!Page.IsPostBack)
        {
            tablerow            = 0;
            emailsarrlist       = new ArrayList();
            emailsarrlistedit   = new ArrayList();
            emailsarrlistremove = new ArrayList();
        }
        else
        {
            /*
             * foreach (TextBox  t in emailsarrlist)
             * {
             *
             *  Control myControl1 = FindControl("theoneformails");
             *  myControl1.Controls.Add(t);
             *  //Debug.WriteLine("Added " + t.ID +"with text" + t.Text);
             * }
             *
             * foreach (Button t in emailsarrlistedit)
             * {
             *
             *  Control myControl1 = FindControl("theoneformails");
             *  myControl1.Controls.Add(t);
             *  //Debug.WriteLine("Added " + t.ID + "with text" + t.Text);
             * }
             * foreach (Button t in emailsarrlistremove)
             * {
             *
             *  Control myControl1 = FindControl("theoneformails");
             *  myControl1.Controls.Add(t);
             * //  Debug.WriteLine("Added " + t.ID + "with text" + t.Text);
             * }
             */

            for (int i = 0; i < emailsarrlist.Count; i++)
            {
                Control myControl1 = FindControl("theoneformails");
                myControl1.Controls.Add((TextBox)emailsarrlist[i]);
                ((Button)emailsarrlistedit[i]).Click += new EventHandler(this.editclick);
                myControl1.Controls.Add((Button)emailsarrlistedit[i]);
                ((Button)emailsarrlistremove[i]).Click += new EventHandler(this.deleteclick);
                myControl1.Controls.Add((Button)emailsarrlistremove[i]);
            }
        }

        /*   SqlConnection conn = new SqlConnection("Data Source=10.238.110.196;Initial Catalog=Expedite;User ID=sa;Password=Orange@123$");
         * conn.Open();
         * SqlCommand command = new SqlCommand();
         * command.Connection = conn;
         * command.CommandText = "Select * From [Expedite].[dbo].[UrgencyReasons]";
         * DataTable dt = new DataTable();
         * //   SqlDataAdapter dr = new SqlDataAdapter();
         * //    DropDownList1.Items.Clear();
         *
         * using (SqlDataAdapter dr = new SqlDataAdapter())
         * {
         *     dr.SelectCommand = command;
         *     using (dt = new DataTable())
         *     {
         *
         *         dr.Fill(dt);
         *
         *     }
         *  //   DropDownList1.Items.Add(new ListItem(dr[0].ToString(), dr[0].ToString()));
         * }
         *
         * DropDownList1.DataSource = dt;
         * //   DropDownList1.DataBind();
         * DropDownList1.DataTextField = "UrgencyReason";
         * DropDownList1.DataValueField = "ID ";
         * DropDownList1.DataBind();
         *
         * conn.Close();
         * } */


        //   Label3.Text = (string)(Session["Email"]);

        /*    String Email = (string)(Session["Email"]);
         *  String FTID =  (string)(Session["FTID"]);
         *  SqlConnection conn = new SqlConnection("Data Source=10.238.110.196;Initial Catalog=Expedite;User ID=sa;Password=Orange@123$");
         *
         *  try
         *  {
         *      DataTable dt = new DataTable();
         *      conn.Open();
         *      SqlCommand command = new SqlCommand();
         *      command.Connection = conn;
         *      command.CommandText = "Select * From [dbo].[Expedite_time] where [Expedite_BY]='" + FTID + "';";
         *      //   command.CommandText = "Select * From [dbo].['All_Incidents'];";
         *      using (SqlDataAdapter sda = new SqlDataAdapter())
         *      {
         *          sda.SelectCommand = command;
         *          using (dt = new DataTable())
         *          {
         *
         *              sda.Fill(dt);
         *
         *          }
         *      }
         *
         *      GridView1.DataSource = dt;
         *      GridView1.DataBind();
         *      //  Label2.Text = "<script  LANGUAGE='JavaScript' > <asp:Button ID='Button2' runat='server' Text='Expedite' OnClick='Button2_Click' /> <asp:Button ID='Button2' runat='server' Text='Expedite' OnClick='Button2_Click' /> </script>";
         *  }
         *  catch (Exception ex)
         *  {
         *      conn.Close();
         *      Console.Write(ex.ToString());
         *  }
         *
         */
        Label2.Visible = false;
        cnn.Close();
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            ArrayList al = new ArrayList();
            for (int i = 1950; i < 2051; i++)
            {
                al.Add(i);
            }
            DropDownList5.DataSource = al;
            DropDownList5.DataBind();
            try
            {
                ListItem li = new ListItem();
                con.Open();
                SqlCommand cmd1 = new SqlCommand("select UserId,Username from Users", con);
                SqlCommand cmd  = new SqlCommand("select Company_id,Name from Company", con);



                SqlDataReader ddlValues1;
                ddlValues1 = cmd1.ExecuteReader();

                DropDownList1.DataSource     = ddlValues1;
                DropDownList1.DataValueField = "UserId";
                DropDownList1.DataTextField  = "Username";
                DropDownList1.DataBind();
                ddlValues1.Close();


                SqlDataReader ddlValues;
                ddlValues = cmd.ExecuteReader();

                DropDownList2.DataSource     = ddlValues;
                DropDownList2.DataValueField = "Company_id";
                DropDownList2.DataTextField  = "Name";
                DropDownList2.DataBind();
                ddlValues.Close();

                /*SqlDataReader dr = cmd.ExecuteReader();
                 * while (dr.Read())
                 * {
                 *  li.Value = dr[0].ToString();
                 *  li.Text = dr[1].ToString();
                 *
                 *  DropDownList1.Items.Add(li);
                 * }
                 */

                con.Close();
            }
            catch (Exception z)
            {
                Response.Write(z.Message);
            }
            finally
            {
                con.Close();
            }
        }
    }
示例#4
0
        private void ShowData()
        {
            MySqlConnection con = new MySqlConnection(constr);

            try
            {
                con.Open();
                MySqlCommand cmd;
                if (DropDownList1.SelectedValue == "0")
                {
                    showalert("Please Select Followups Status");
                    DropDownList1.Focus();
                }
                else if (DropDownList1.SelectedValue == "4a_Done")
                {
                    cmd = new MySqlCommand("select c.study_code,a.woman_nm,a.husband_nm,a.dssid,a.arm, (select 	concat(ROUND(((sum(z.lw_crf5a_31)/sum(		if((z.lw_crf5a_29 is NULL || z.lw_crf5a_29 =''), (SELECT (DATEDIFF(str_to_date(z.lw_crf5a_02, '%d-%m-%Y'), str_to_date(y.lw_crf3c_2, '%d-%m-%Y')))*2 from form_crf_3c as y where y.study_id=z.study_id), z.lw_crf5a_29)				))*100),1),'%')  from form_crf_5a as z where z.study_id=c.study_id) as Cumulative, (SELECT z.date_of_attempt FROM form_crf_4a AS z WHERE z.followup_num='47' AND z.study_id=c.study_id) AS last_DOV			from view_followups4a as a  left join studies as c on c.study_code=a.study_code left join form_crf_3a as d on d.assis_id=a.id where a.followups='47' and a.status=1  order by c.study_code;", con);
                    // cmd = new MySqlCommand("select c.study_code,a.woman_nm,a.husband_nm,a.dssid,a.arm, (select   concat(ROUND(((sum(z.lw_crf5a_31)/sum(		if((z.lw_crf5a_29 is NULL || z.lw_crf5a_29 =''), (SELECT (DATEDIFF(str_to_date(z.lw_crf5a_02, '%d-%m-%Y'), str_to_date(y.lw_crf3c_2, '%d-%m-%Y')))*2 from form_crf_3c as y where y.study_id=z.study_id), z.lw_crf5a_29)				))*100),1),'%')  from form_crf_5a as z where z.study_id=c.study_id) as Cumulative			from view_followups4a as a  left join studies as c on c.study_code=a.study_code left join form_crf_3a as d on d.assis_id=a.id where a.followups='47' and a.status=1  order by c.study_code;", con);


                    MySqlDataAdapter sda = new MySqlDataAdapter();
                    {
                        cmd.Connection    = con;
                        sda.SelectCommand = cmd;
                        DataTable dt = new DataTable();
                        {
                            sda.Fill(dt);
                            GridView1.DataSource = dt;
                            GridView1.DataBind();
                            con.Close();
                        }
                    }
                }
                else if (DropDownList1.SelectedValue == "4a_Pending")
                {
                    cmd = new MySqlCommand("SELECT 	a.study_code,a.woman_nm,a.husband_nm,a.dssid,a.arm,'Cumulative',	(SELECT CONCAT(   MAX(STR_TO_DATE(z.date_of_attempt,'%d-%m-%Y')) ,', F/ups: ', MAX(z.followup_num)) AS last_dov FROM form_crf_4a AS z WHERE z.study_id=c.study_id  GROUP BY z.study_id) AS last_DOV 	FROM view_followups4a AS a LEFT JOIN studies AS c ON c.study_code=a.study_code WHERE a.followups='47' AND a.status=3 ORDER BY a.site,a.study_code;", con);

                    // cmd = new MySqlCommand("select   a.study_code,a.woman_nm,a.husband_nm,a.dssid,a.arm,'Cumulative' from view_followups4a as a where a.followups='47' and a.status=3 order by a.site,a.study_code;", con);

                    MySqlDataAdapter sda = new MySqlDataAdapter();
                    {
                        cmd.Connection    = con;
                        sda.SelectCommand = cmd;
                        DataTable dt = new DataTable();
                        {
                            sda.Fill(dt);
                            GridView1.DataSource = dt;
                            GridView1.DataBind();
                            int temp = GridView1.Columns.Count;
                            con.Close();
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Response.Write("<script type=\"text/javascript\">alert('" + ex.Message + "')</script>");
            }
            finally
            {
                con.Close();
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     string[] gender = { "male", "female" };
     DropDownList1.DataSource = gender;
     DropDownList1.DataBind();
 }
示例#6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            #region Area

            arlist_temp1 = func.FileToArray(Server.MapPath(".") + "\\config\\dep.txt");

            DropDownList1.DataSource = arlist_temp1;
            DropDownList1.DataBind();



            #endregion



            #region start_time

            arlist_temp1 = func.FileToArray(Server.MapPath(".") + "\\config\\hour.txt");

            //DropDownList5.DataSource = arlist_temp1;
            //DropDownList5.DataBind();

            //DropDownList5.Text = DateTime.Now.ToString("HH");


            arlist_temp1 = func.FileToArray(Server.MapPath(".") + "\\config\\min.txt");

            //DropDownList8.DataSource = arlist_temp1;
            //DropDownList8.DataBind();

            //DropDownList8.Text = DateTime.Now.ToString("mm");

            txtEstimateStartDate.SelectedDate = Convert.ToDateTime(DateTime.Now.AddDays(+0).ToString("yyyy/MM/dd"));

            #endregion



            #region end_time

            arlist_temp1 = func.FileToArray(Server.MapPath(".") + "\\config\\hour.txt");

            //DropDownList15.DataSource = arlist_temp1;
            //DropDownList15.DataBind();

            //DropDownList15.Text = DateTime.Now.ToString("HH");


            arlist_temp1 = func.FileToArray(Server.MapPath(".") + "\\config\\min.txt");

            //DropDownList18.DataSource = arlist_temp1;
            //DropDownList18.DataBind();

            //DropDownList18.Text = DateTime.Now.ToString("mm");

            txtEstimateEndDate.SelectedDate = Convert.ToDateTime(DateTime.Now.AddDays(+30).ToString("yyyy/MM/dd"));
            #endregion
        }
    }
示例#7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            info_label.Visible = false;

            if (!Page.IsPostBack)
            {
                // If querystring value is missing, send the user to ManageUsers.aspx
                string userName = Request.QueryString["user"];
                if (string.IsNullOrEmpty(userName))
                {
                    Response.Redirect("manageusers.aspx");
                }


                // Get information about this user
                MembershipUser usr = Membership.GetUser(userName);

                if (usr == null)
                {
                    Response.Redirect("manageusers.aspx");
                }



                user_name_label.InnerText = "Manage User: "******"emploee"))
                {
                    Pracownik.Checked = true;
                }
                if (Roles.IsUserInRole(usr.UserName, "hr_emploee"))
                {
                    PracownikHR.Checked = true;
                }
                if (Roles.IsUserInRole(usr.UserName, "Administrators"))
                {
                    PracownikAdmin.Checked = true;
                }
                if (Roles.IsUserInRole(usr.UserName, "menager"))
                {
                    PracownikMenager.Checked = true;
                }

                if (usr.IsLockedOut)
                {
                    CheckBoxZablokowany.Checked = true;
                    ButtonResetPassword.Visible = false;
                }
                else
                {
                    CheckBoxZablokowany.Checked = false;
                    ButtonResetPassword.Visible = true;
                }

                SqlConnection conn = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["ApplicationServices"].ConnectionString);

                string sqlquery = "SELECT UserName, Imie, Nazwisko, pesel, data_urodz, data_zatrudnienia, team, dniurlopowe, kiedy26, dni_p_rok , dni_o_rok , dni_n_rok , dni_nz, dni_ekstra, dni_wyk FROM aspnet_Users Where UserName = @user";
                conn.Open();
                SqlCommand command = new SqlCommand(sqlquery, conn);
                command.Parameters.Add("@user", SqlDbType.VarChar, 50).Value = usr.UserName;
                SqlDataReader sdr = command.ExecuteReader();

                SqlTeams.DataBind();

                DropDownList1.DataBind();


                while (sdr.Read())
                {
                    ImieTextBox.Text     = sdr["Imie"].ToString();
                    NazwiskoTextBox.Text = sdr["Nazwisko"].ToString();
                    PeselTextBox.Text    = sdr["pesel"].ToString();
                    string data_urodz        = sdr["data_urodz"].ToString();
                    string data_zatrudnienia = sdr["data_zatrudnienia"].ToString();
                    string kiedy26           = sdr["kiedy26"].ToString();

                    string[] days_of_holidays = holidays.PolaczenieSQL.find_holiday_days_byuser(usr.UserName);
                    Labelpr.Text  = days_of_holidays[0];
                    Labelor.Text  = days_of_holidays[8];
                    Labelnr.Text  = days_of_holidays[9];
                    Labeldd.Text  = days_of_holidays[5];
                    Labelnz.Text  = days_of_holidays[6];
                    Labelsum.Text = days_of_holidays[10];
                    Labelwyk.Text = days_of_holidays[3];

                    if (Convert.ToInt16(Labelsum.Text) > 0)
                    {
                        suncell.BackColor = Color.LightGreen;
                    }
                    if (Convert.ToInt16(Labelsum.Text) <= 0)
                    {
                        suncell.BackColor = Color.LightPink;
                    }

                    DateTime myTime;

                    if (data_urodz != string.Empty)
                    {
                        myTime             = DateTime.Parse(data_urodz);
                        Dataurodzenia.Text = myTime.ToString("dd-MM-yyyy");
                    }


                    if (data_zatrudnienia != string.Empty)
                    {
                        myTime = DateTime.Parse(data_zatrudnienia);
                        DataZatrudnienia.Text = myTime.ToString("dd-MM-yyyy");
                    }
                    else
                    {
                        SaveUserButton.Text = "Dodaj nowego pracownika";
                    }


                    if (sdr["team"].ToString() != string.Empty)
                    {
                        string item_i = sdr["team"].ToString();
                        for (int i = 0; i <= DropDownList1.Items.Count; i++)
                        {
                            if (DropDownList1.Items[i].Value == item_i)
                            {
                                DropDownList1.Items[i].Selected = true;
                                HiddenFieldTeam.Value           = item_i;
                                HiddenTeamName.Value            = DropDownList1.Items[i].Text;
                                break;
                            }
                        }
                    }
                    switch (sdr["dniurlopowe"].ToString())
                    {
                    case "1":
                        DropDownList2.Items[1].Selected = true;
                        HiddenField20t26.Value          = "1";
                        break;

                    case "2":
                        DropDownList2.Items[2].Selected = true;
                        HiddenField20t26.Value          = "2";
                        break;

                    default:
                        DropDownList2.Items[0].Selected = true;
                        break;
                    }
                    if (sdr["dniurlopowe"].ToString() == "1")
                    {
                        uzyska26label.Visible   = true;
                        uzyska26TextBox.Visible = true;
                        if (kiedy26 != string.Empty)
                        {
                            myTime = DateTime.Parse(kiedy26);
                            uzyska26TextBox.Text = myTime.ToString("dd-MM-yyyy");
                        }
                    }
                }
                conn.Close();

                if (Request.QueryString["deleteMenager"] != null)
                {
                    string nomenagerdelete = Request.QueryString["deleteMenager"];
                    info_label.Text    = "Użytkownik <b> " + nomenagerdelete + "</b> nie może stracić funkcji menagera. Jest on wciąż menagerem jednego z teamów.";
                    info_label.Visible = true;
                }
            }
            else
            {
                info_label.Visible = false;
                string date1 = Request.Form[DataZatrudnienia.UniqueID];
                DataZatrudnienia.Text = date1;
                string date2 = Request.Form[Dataurodzenia.UniqueID];
                Dataurodzenia.Text = date2;
                string date3 = Request.Form[uzyska26TextBox.UniqueID];
                uzyska26TextBox.Text = date3;
            }
        }
示例#8
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        string date = System.DateTime.Now.ToString();
        int    ID   = 0;
        int    DID  = 0;

        SqlCommand cmdid = thisConnection.CreateCommand();

        cmdid.CommandText = "select MAX(id) from event;";
        thisConnection.Open();

        SqlDataReader reader = cmdid.ExecuteReader();

        while (reader.Read())
        {
            if (reader.IsDBNull(0) || reader.GetInt32(0).ToString() == "")
            {
                ID = 1;
            }
            else
            {
                int rid = reader.GetInt32(0);
                ID = rid + 1;
            }
        }

        thisConnection.Close();
        SqlCommand cmd = thisConnection.CreateCommand();

        cmd.Parameters.Add("@name", SqlDbType.Text);
        cmd.Parameters["@name"].Value = TextBox1.Text;

        cmd.Parameters.Add("@address", SqlDbType.Text);
        cmd.Parameters["@address"].Value = TextBox2.Text;

        cmd.Parameters.Add("@location", SqlDbType.Text);
        cmd.Parameters["@location"].Value = DropDownList1.Text;

        cmd.Parameters.Add("@date_from", SqlDbType.DateTime);
        cmd.Parameters["@date_from"].Value = TextBox3.Text;

        cmd.Parameters.Add("@date_to", SqlDbType.DateTime);
        cmd.Parameters["@date_to"].Value = TextBox4.Text;

        cmd.Parameters.Add("@time", SqlDbType.Text);
        cmd.Parameters["@time"].Value = TextBox5.Text + TextBox6.Text;

        cmd.Parameters.Add("@username", SqlDbType.Text);
        cmd.Parameters["@username"].Value = TextBox7.Text;

        cmd.Parameters.Add("@password", SqlDbType.Text);
        cmd.Parameters["@password"].Value = TextBox8.Text;



        cmd.CommandText = "insert into event (id,event_name,address,location,date_from,date_to,timing,status,date_added,username,password) values (" + ID + ",@name,@address,@location,@date_from,@date_to,@time,'Active','" + date + "',@username,@password);";

        thisConnection.Open();

        int result = cmd.ExecuteNonQuery();

        Label1.Text = "Event Created Successfully...";



        thisConnection.Close();
        TextBox1.Text = "";
        TextBox2.Text = "";
        TextBox3.Text = "";
        TextBox4.Text = "";
        TextBox5.Text = "";
        TextBox6.Text = "";
        TextBox7.Text = "";
        TextBox8.Text = "";
        DropDownList1.ClearSelection();
    }
示例#9
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        if (DropDownList1.SelectedIndex == 0)
        {
            ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('Please select book for LUNCH or DINNER');", true);
            DropDownList1.Focus();
        }
        else if (CheckBox1.Checked == false)
        {
            ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('Please agree to Terms & Condition');", true);
        }
        else if (DropDownList1.SelectedIndex == 1)
        {
            int in_lunch_time = DateTime.Compare(current_time, lunch_time);

            if (in_lunch_time < 0)
            {
                DataSet ds3 = new DataSet();
                string  l   = "select p_id from simple_tiffin where t_id='" + Session["stid"].ToString() + "'";
                ds3 = dc.getdata(l);

                DataSet ds4 = new DataSet();
                string  z   = "select st_image from simple_tiffin where t_id='" + Session["stid"].ToString() + "'";
                ds4 = dc.getdata(z);

                string p = "insert into simple_tiffin_daily_order values('" + Label1.Text + "','" + DropDownList1.Text + "','" + Session["stid"].ToString() + "','" + ds3.Tables[0].Rows[0][0].ToString() + "','" + Session["uid"].ToString() + "','" + Label2.Text + "','" + Label10.Text + "','" + Label4.Text + "','" + Label3.Text + "','" + TextBox1.Text + "','" + Session["delivery_area"].ToString() + "','" + TextBox2.Text + "','" + Label5.Text + "','" + Label6.Text + "','" + Label7.Text + "','" + Label8.Text + "','" + Other_lbl.Text + "','" + Label9.Text + "','" + ds4.Tables[0].Rows[0][0].ToString() + "','Not Delivered')";
                dc.setdata(p);

                Thread email = new Thread(delegate()
                {
                    sendmail_user_lunch();
                    sendmail_provider_lunch();
                    sendmail_admin_lunch();
                });
                email.IsBackground = true;
                email.Start();

                ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('Your Order Is Booked You Can Check From Simple Tiffin Order Page');window.location='View_simple_tiffin_order.aspx';", true);
            }
            else if (in_lunch_time == 0)
            {
                DataSet ds3 = new DataSet();
                string  l   = "select p_id from simple_tiffin where t_id='" + Session["stid"].ToString() + "'";
                ds3 = dc.getdata(l);

                DataSet ds4 = new DataSet();
                string  z   = "select st_image from simple_tiffin where t_id='" + Session["stid"].ToString() + "'";
                ds4 = dc.getdata(z);

                string p = "insert into simple_tiffin_daily_order values('" + Label1.Text + "','" + DropDownList1.Text + "','" + Session["stid"].ToString() + "','" + ds3.Tables[0].Rows[0][0].ToString() + "','" + Session["uid"].ToString() + "','" + Label2.Text + "','" + Label10.Text + "','" + Label4.Text + "','" + Label3.Text + "','" + TextBox1.Text + "','" + Session["delivery_area"].ToString() + "','" + TextBox2.Text + "','" + Label5.Text + "','" + Label6.Text + "','" + Label7.Text + "','" + Label8.Text + "','" + Other_lbl.Text + "','" + Label9.Text + "','" + ds4.Tables[0].Rows[0][0].ToString() + "','Not Delivered')";
                dc.setdata(p);

                Thread email = new Thread(delegate()
                {
                    sendmail_user_lunch();
                    sendmail_provider_lunch();
                    sendmail_admin_lunch();
                });

                email.IsBackground = true;
                email.Start();

                ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('Your Order Is Booked You Can Check From Simple Tiffin Order Page');window.location='View_simple_tiffin_order.aspx';", true);
            }
            else if (in_lunch_time > 0)
            {
                Label11.Text  = "You can't book tiffin for LUNCH after " + ds10.Tables[0].Rows[0][1].ToString() + ".";
                TextBox1.Text = "";
                TextBox2.Text = "";
                DropDownList1.SelectedIndex = 0;
                CheckBox1.Checked           = false;
                //ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('You can't book tiffin for LUNCH after 10:30 AM');", true);
            }
        }
        else if (DropDownList1.SelectedIndex == 2)
        {
            int in_dinner_time = DateTime.Compare(current_time, dinner_time);

            if (in_dinner_time < 0)
            {
                DataSet ds3 = new DataSet();
                string  l   = "select p_id from simple_tiffin where t_id='" + Session["stid"].ToString() + "'";
                ds3 = dc.getdata(l);

                DataSet ds4 = new DataSet();
                string  z   = "select st_image from simple_tiffin where t_id='" + Session["stid"].ToString() + "'";
                ds4 = dc.getdata(z);

                string p = "insert into simple_tiffin_daily_order values('" + Label1.Text + "','" + DropDownList1.Text + "','" + Session["stid"].ToString() + "','" + ds3.Tables[0].Rows[0][0].ToString() + "','" + Session["uid"].ToString() + "','" + Label2.Text + "','" + Label10.Text + "','" + Label4.Text + "','" + Label3.Text + "','" + TextBox1.Text + "','" + Session["delivery_area"].ToString() + "','" + TextBox2.Text + "','" + Label5.Text + "','" + Label6.Text + "','" + Label7.Text + "','" + Label8.Text + "','" + Other_lbl.Text + "','" + Label9.Text + "','" + ds4.Tables[0].Rows[0][0].ToString() + "','Not Delivered')";
                dc.setdata(p);

                Thread email = new Thread(delegate()
                {
                    sendmail_user_dinner();
                    sendmail_provider_dinner();
                    sendmail_admin_dinner();
                });
                email.IsBackground = true;
                email.Start();

                ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('Your Order Is Booked You Can Check From Simple Tiffin Order Page');window.location='View_simple_tiffin_order.aspx';", true);
            }
            else if (in_dinner_time == 0)
            {
                DataSet ds3 = new DataSet();
                string  l   = "select p_id from simple_tiffin where t_id='" + Session["stid"].ToString() + "'";
                ds3 = dc.getdata(l);

                DataSet ds4 = new DataSet();
                string  z   = "select st_image from simple_tiffin where t_id='" + Session["stid"].ToString() + "'";
                ds4 = dc.getdata(z);

                string p = "insert into simple_tiffin_daily_order values('" + Label1.Text + "','" + DropDownList1.Text + "','" + Session["stid"].ToString() + "','" + ds3.Tables[0].Rows[0][0].ToString() + "','" + Session["uid"].ToString() + "','" + Label2.Text + "','" + Label10.Text + "','" + Label4.Text + "','" + Label3.Text + "','" + TextBox1.Text + "','" + Session["delivery_area"].ToString() + "','" + TextBox2.Text + "','" + Label5.Text + "','" + Label6.Text + "','" + Label7.Text + "','" + Label8.Text + "','" + Other_lbl.Text + "','" + Label9.Text + "','" + ds4.Tables[0].Rows[0][0].ToString() + "','Not Delivered')";
                dc.setdata(p);

                Thread email = new Thread(delegate()
                {
                    sendmail_user_dinner();
                    sendmail_provider_dinner();
                    sendmail_admin_dinner();
                });

                email.IsBackground = true;
                email.Start();
                ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('Your Order Is Booked You Can Check From Simple Tiffin Order Page');window.location='View_simple_tiffin_order.aspx';", true);
            }
            else if (in_dinner_time > 0)
            {
                Label11.Text  = "You can't book tiffin for DINNER after " + ds10.Tables[0].Rows[1][1].ToString() + ".";
                TextBox1.Text = "";
                TextBox2.Text = "";
                DropDownList1.SelectedIndex = 0;
                CheckBox1.Checked           = false;
                //ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('You can't book tiffin for DINNER after 04:30 PM');", true);
            }
        }
    }
示例#10
0
        private void Press(object sender, EventArgs e)

        {
            LinkButton butt = (LinkButton)sender;

            LInfo.Text = butt.Attributes["nazwa"];
            PanelProductOne.Visible = true;
            PanelMain.Visible       = false;

            Session["nameProduct"] = butt.Attributes["nazwa"].ToString();
            Session["idProduct"]   = butt.Attributes["idProduct"].ToString();

            //GENEROWANIE SZCZEGÓŁÓW PRRODUKTU
            var containerOne = new HtmlGenericControl("div");

            containerOne.Attributes["class"] = "productOneContainer";

            var containerText = new HtmlGenericControl("div");

            containerText.Attributes["class"] = "containerText";

            var img = new HtmlGenericControl("div");

            img.Attributes["style"] = "background-image: url(./product/" + butt.Attributes["zdjecie"].ToString() + ")";
            img.Attributes["class"] = "productImgBig";


            var nazwa = new HtmlGenericControl("p")
            {
                InnerText = "Nazwa: " + butt.Attributes["nazwa"].ToString()
            };

            nazwa.Attributes["class"] = "productDescription";

            string[]           rozmiaryArray = butt.Attributes["rozmiary"].ToString().Split(',');
            HtmlGenericControl selectPage    = new HtmlGenericControl("select");

            selectPage.Attributes.Add("id", "selectPage");

            switch (rozmiaryArray.Length)
            {
            case 1:
                var list = new List <string> {
                    rozmiaryArray[0]
                };
                list.Sort();
                DropDownList1.DataSource = list;
                DropDownList1.DataBind();
                break;

            case 2:
                list = new List <string> {
                    rozmiaryArray[0], rozmiaryArray[1]
                };
                list.Sort();
                DropDownList1.DataSource = list;
                DropDownList1.DataBind();
                break;

            case 3:
                list = new List <string> {
                    rozmiaryArray[0], rozmiaryArray[1], rozmiaryArray[2]
                };
                list.Sort();
                DropDownList1.DataSource = list;
                DropDownList1.DataBind();
                break;

            case 4:
                list = new List <string> {
                    rozmiaryArray[0], rozmiaryArray[1], rozmiaryArray[2], rozmiaryArray[3]
                };
                list.Sort();
                DropDownList1.DataSource = list;
                DropDownList1.DataBind();
                break;

            case 5:
                list = new List <string> {
                    rozmiaryArray[0], rozmiaryArray[1], rozmiaryArray[2], rozmiaryArray[3], rozmiaryArray[4]
                };
                list.Sort();
                DropDownList1.DataSource = list;
                DropDownList1.DataBind();
                break;

            case 6:
                list = new List <string> {
                    rozmiaryArray[0], rozmiaryArray[1], rozmiaryArray[2], rozmiaryArray[3], rozmiaryArray[4], rozmiaryArray[5]
                };
                list.Sort();
                DropDownList1.DataSource = list;
                DropDownList1.DataBind();
                break;

            case 7:
                list = new List <string> {
                    rozmiaryArray[0], rozmiaryArray[1], rozmiaryArray[2], rozmiaryArray[3], rozmiaryArray[4], rozmiaryArray[5], rozmiaryArray[6]
                };
                list.Sort();
                DropDownList1.DataSource = list;
                DropDownList1.DataBind();
                break;
            }


            var rodzaj = new HtmlGenericControl("p")
            {
                InnerText = "Rodzaj: " + butt.Attributes["rodzaj"].ToString()
            };

            rodzaj.Attributes["class"] = "productDescription";

            var cena = new HtmlGenericControl("p")
            {
                InnerText = "Cena: " + butt.Attributes["cena"].ToString() + " zł"
            };

            cena.Attributes["class"] = "productDescription";

            var rozmairy = new HtmlGenericControl("p")
            {
                InnerText = "Rozmiary: "
            };

            rozmairy.Attributes["class"] = "productDescription";

            var kolory = new HtmlGenericControl("p")
            {
                InnerText = "Kolor: " + butt.Attributes["kolory"].ToString()
            };

            kolory.Attributes["class"] = "productDescription";

            var obcas = new HtmlGenericControl("p")
            {
                InnerText = "Obcas: " + butt.Attributes["obcas"].ToString()
            };

            obcas.Attributes["class"] = "productDescription";

            var material = new HtmlGenericControl("p")
            {
                InnerText = "Materiał: " + butt.Attributes["material"].ToString()
            };

            material.Attributes["class"] = "productDescription";

            var komentarz = new HtmlGenericControl("p")
            {
                InnerText = "Komentarz: " + butt.Attributes["komentarz"].ToString()
            };

            komentarz.Attributes["class"] = "productDescription";

            containerOne.Controls.Add(img);

            containerText.Controls.Add(nazwa);
            containerText.Controls.Add(rodzaj);
            containerText.Controls.Add(cena);
            containerText.Controls.Add(rozmairy);
            containerText.Controls.Add(kolory);
            containerText.Controls.Add(obcas);
            containerText.Controls.Add(material);
            containerText.Controls.Add(komentarz);

            containerOne.Controls.Add(containerText);

            ProductDetails.Controls.Add(containerOne);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (connect.State == ConnectionState.Open)
            {
                connect.Close();
            }
            connect.Open();
            if (Session["reg"] != null)
            {
                SqlCommand     cmds = new SqlCommand("select name from stud where reg = '" + Session["reg"].ToString() + "'", connect);
                SqlDataAdapter da   = new SqlDataAdapter(cmds);
                DataSet        ds1  = new DataSet();
                da.Fill(ds1);
                int ij = ds1.Tables[0].Rows.Count;
                if (ij > 0)
                {
                    SqlCommand     cmd1 = new SqlCommand("select id from stud where reg = '" + Session["reg"].ToString() + "' and pass='******'", connect);
                    SqlDataAdapter da1  = new SqlDataAdapter(cmd1);
                    DataSet        ds2  = new DataSet();
                    da1.Fill(ds2);
                    int j = ds2.Tables[0].Rows.Count;
                    if (j > 0)
                    {
                        bt1.Text    = ds1.Tables[0].Rows[0][0].ToString();
                        bt2.Visible = true;
                    }
                    else
                    {
                        bt1.Text = "Login";
                    }
                }
                else
                {
                    bt1.Text = "Login";
                }
            }
            else
            {
                bt1.Text = "Login";
            }

            if (Session["reg"] == null)
            {
                bt2.Visible = false;
            }
            else if (Session["reg"].ToString() == "admin")
            {
                bt1.Text = "admin";
                Response.Write("Admin");
            }
            Table1.Visible = false;
            Table2.Visible = false;
            Table3.Visible = false;
            Response.Write("Successful");
            {
                Response.Clear();
                if (true)
                {
                    // Response.Write("Connected");
                    DateTime dt    = DateTime.Now;
                    var      date1 = dt.Date;
                    date1 = date1.AddDays(-5);
                    var date2 = dt.Date;
                    date2 = date2.AddDays(30);
                    SqlCommand cmd5 = new SqlCommand("select Venue, Program_Type, Mont as Month, Start_Date, End_Date, Details, Contact from news  where Start_Date <= '" + date2 + "' and Start_Date >= '" + date1 + "' order by Start_Date", connect);
                    cmd5.ExecuteNonQuery();
                    SqlDataAdapter da5 = new SqlDataAdapter(cmd5);
                    DataSet        ds5 = new DataSet();
                    da5.Fill(ds5);
                    int ii = ds5.Tables[0].Rows.Count;
                    if (ii > 0)
                    {
                        GridView4.DataSource = (ds5);
                        GridView4.DataBind();
                    }
                    else
                    {
                        Response.Clear();
                        Response.Write("<script language=\"javascript\" type=\"text/javascript\">alert('Information Not Found');</script>");
                        Response.Write("Information Not Found");
                    }
                }
            }

            if (!IsPostBack)
            {
                /* DropDownList2.Items.Clear();
                 * //  DropDownList1.DataValueField = "stf";
                 *
                 * SqlCommand cmd2 = new SqlCommand("select distinct Mont from news", connect);
                 * cmd2.ExecuteNonQuery();
                 * SqlDataAdapter da1 = new SqlDataAdapter(cmd2);
                 * DataSet ds2 = new DataSet();
                 * da1.Fill(ds2);
                 * DropDownList2.DataSource = ds2;
                 * DropDownList2.DataBind();
                 * DropDownList2.DataTextField = "Mont";
                 * DropDownList2.DataValueField = "Mont";
                 * DropDownList2.DataBind();*/
            }
            if (!IsPostBack)
            {
                DropDownList1.Items.Clear();
                //  DropDownList1.DataValueField = "stf";

                SqlCommand cmd1 = new SqlCommand("select distinct Venue from news", connect);
                cmd1.ExecuteNonQuery();
                SqlDataAdapter da1 = new SqlDataAdapter(cmd1);
                DataSet        ds1 = new DataSet();
                da1.Fill(ds1);
                DropDownList1.DataSource = ds1;
                DropDownList1.DataBind();
                DropDownList1.DataTextField  = "Venue";
                DropDownList1.DataValueField = "Venue";
                DropDownList1.DataBind();
            }
            if (!IsPostBack)
            {
                DropDownList3.Items.Clear();
                //  DropDownList1.DataValueField = "stf";

                SqlCommand cmd3 = new SqlCommand("select distinct Program_Type from news", connect);
                cmd3.ExecuteNonQuery();
                SqlDataAdapter da3 = new SqlDataAdapter(cmd3);
                DataSet        ds3 = new DataSet();
                da3.Fill(ds3);
                DropDownList3.DataSource = ds3;
                DropDownList3.DataBind();
                DropDownList3.DataTextField  = "Program_Type";
                DropDownList3.DataValueField = "Program_Type";
                DropDownList3.DataBind();
            }
        }
        private void GetList()
        {
            //查看所有客户的积分
            seeAll = SOSOshop.BLL.PowerPass.isPass("008011015");
            if (seeAll)
            {
                SelectEditer();
            }
            DropDownList1.DataSource     = SOSOshop.Model.CompanyClass.GetList();
            DropDownList1.DataTextField  = "CompanyClassName";
            DropDownList1.DataValueField = "CompanyClassName";
            DropDownList1.DataBind();
            var li = new ListItem()
            {
                Text = "请选择", Value = ""
            };

            DropDownList1.Items.Insert(0, li);

            #region where
            string where = ""; string date = "";
            string truename = Request["truename"];
            if (!string.IsNullOrEmpty(truename))
            {
                this.TextBox_truename.Text = truename;
                where += " and truename like '%" + truename.Replace("'", "''").Replace("%", "") + "%' ";
            }
            string CompanyName = Request["CompanyName"];
            if (!string.IsNullOrEmpty(CompanyName))
            {
                this.TextBox_CompanyName.Text = CompanyName;
                where += " and CompanyName like '%" + CompanyName.Replace("'", "''").Replace("%", "") + "%' ";
            }
            string phone = Request["phone"];
            if (!string.IsNullOrEmpty(phone))
            {
                this.TextBox_phone.Text = phone;
                where += " and phone like '%" + phone.Replace("'", "''").Replace("%", "") + "%' ";
            }
            string lx = Request["DropDownList1"];
            if (!string.IsNullOrEmpty(lx))
            {
                this.DropDownList1.SelectedValue = lx;
                where += " and CompanyClass = '" + lx.Replace("'", "''") + "' ";
            }
            string fromDate = Request["fromDate"];
            if (!string.IsNullOrEmpty(fromDate))
            {
                this.fromDate.Text = fromDate;
                date += " and convert(char(10),c.created,120)>='" + fromDate.Replace("'", "''") + "' ";
            }
            string toDate = Request["toDate"];
            if (!string.IsNullOrEmpty(toDate))
            {
                this.toDate.Text = toDate;
                date            += " and convert(char(10),c.created,120)<='" + toDate.Replace("'", "''") + "' ";
            }
            SOSOshop.Model.AdminInfo adminInfo = SOSOshop.BLL.AdministrorManager.Get();
            this.CheckBox1.Checked = !string.IsNullOrEmpty(Request["CheckBox1"]) && Request["CheckBox1"] == "1";
            this.CheckBox1.Visible = seeAll;
            string Editer = Request["Editer"];
            if (this.CheckBox1.Checked || !seeAll)
            {
                where += " and UID IN (SELECT UID FROM memberinfo WHERE Editer=" + adminInfo.AdminId + ") ";
            }
            else if (!string.IsNullOrEmpty(Editer) && seeAll)
            {
                this.ddlEditer.SelectedValue = Editer;
                where += " and UID IN (SELECT UID FROM memberinfo WHERE Editer=" + Editer + ") ";
            }
            #endregion

            int    pageindex = 1; int.TryParse(Request["current"], out pageindex);
            int    pagesize  = 15;
            string sort      = Request["sort"];//排序
            if (string.IsNullOrEmpty(sort) || (sort.Contains("asc") == false && sort.Contains("desc") == false))
            {
                sort = "integral DESC";
            }
            Repeater1.DataSource = date != "" ? bll.GetList(where, date, sort, pageindex, pagesize) : bll.GetList(where, sort, pageindex, pagesize);
            Repeater1.DataBind();
            int recordcount = date != "" ? bll.GetListCount(where, date) : bll.GetListCount(where);
            page(recordcount, pageindex, pagesize);//分页
        }
示例#13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                cd = new SqlCommand("select image_url,ename from employee where eemail=@email", con);
                cd.Parameters.AddWithValue("@email", Session["email"].ToString());
                da = new SqlDataAdapter(cd);
                dt = new DataTable();
                da.Fill(dt);

                foreach (DataRow item in dt.Rows)
                {
                    userimage.ImageUrl = item[0].ToString();
                    username.Text      = item[1].ToString();
                }
                //da = new SqlDataAdapter("select * from Project_Master", con);

                //ds = new DataSet();

                //da.Fill(ds);

                ////Chart1.DataSource = ds;

                ////Chart1.DataBind();



                cd1             = new SqlCommand("getprojectnames", con);
                cd1.CommandType = CommandType.StoredProcedure;

                da1 = new SqlDataAdapter(cd1);
                dt1 = new DataTable();
                da1.Fill(dt1);

                DropDownList1.DataSource     = dt1;
                DropDownList1.DataTextField  = "pname";
                DropDownList1.DataValueField = "pid";
                DropDownList1.DataBind();

                DropDownList3.DataSource     = dt1;
                DropDownList3.DataTextField  = "pname";
                DropDownList3.DataValueField = "pid";
                DropDownList3.DataBind();
                DataTable custom1 = new DataTable();
                custom1.Columns.Add("projectname", typeof(System.String));
                custom1.Columns.Add("projectprg", typeof(System.Double));

                foreach (DataRow item in dt1.Rows)
                {
                    DataTable custom = new DataTable();
                    custom.Columns.Add("mid", typeof(System.Int16));
                    custom.Columns.Add("prg", typeof(System.Int16));

                    cd = new SqlCommand("select ModuleID  from ProjectModule where ProjectID=@pid", con);
                    cd.Parameters.AddWithValue("@pid", Convert.ToInt16(item[0]));
                    da = new SqlDataAdapter(cd);
                    DataTable mydt = new DataTable();
                    da.Fill(mydt);

                    foreach (DataRow item1 in mydt.Rows)
                    {
                        cd = new SqlCommand("getmoduleprogress", con);
                        cd.Parameters.AddWithValue("@mid", Convert.ToInt16(item1[0]));
                        cd.CommandType = CommandType.StoredProcedure;
                        da             = new SqlDataAdapter(cd);
                        DataTable mydt1 = new DataTable();
                        da.Fill(mydt1);
                        DataRow dr = custom.NewRow();
                        dr[0] = item1[0].ToString();
                        foreach (DataRow item2 in mydt1.Rows)
                        {
                            dr[1] = Convert.ToInt16(item2[0]);
                        }

                        custom.Rows.Add(dr);
                    }

                    double sum = 0;

                    foreach (DataRow item3 in custom.Rows)
                    {
                        int newsum = Convert.ToInt16(item3[1]);
                        sum = sum + newsum;
                    }


                    DataRow dr1 = custom1.NewRow();
                    dr1[0] = item[1].ToString();
                    dr1[1] = (sum / custom.Rows.Count);
                    custom1.Rows.Add(dr1);
                }


                Chart3.DataSource = custom1;
                Chart3.DataBind();



                ListItem li = new ListItem();
                li.Text  = "Select Project";
                li.Value = 0.ToString();
                DropDownList1.Items.Insert(0, li);



                ListItem li1 = new ListItem();
                li1.Text  = "Select Modul";
                li1.Value = 0.ToString();
                DropDownList2.Items.Insert(0, li1);


                ListItem li2 = new ListItem();
                li2.Text  = "Select Project";
                li2.Value = 0.ToString();
                DropDownList3.Items.Insert(0, li2);
            }
        }
 public void actualizar()
 {
     DropDownList1.Items.Clear();
     DropDownList1.DataBind();
 }
示例#15
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["name"] != null)
            {
            }
            else
            {
                Response.Redirect("webform1.aspx");
            }


            string DBHost     = "127.0.0.1";
            string DBName     = "base";
            string DBUserName = "******";
            string DBPassword = "******";

            string Conn_String = "server=" + DBHost + ";uid=" + DBUserName + ";password="******";database=" + DBName + ";";


            MySqlConnection Conn = new MySqlConnection(Conn_String);

            Conn.Open();

            MySqlCommand cmd;

            cmd             = new MySqlCommand("select bookname from library", Conn);
            cmd.CommandType = CommandType.Text;

            MySqlDataReader ddlValues;

            ddlValues = cmd.ExecuteReader();

            DropDownList1.DataSource    = ddlValues;
            DropDownList1.DataTextField = "bookname";
            //  DropDownList1.DataValueField = "id";
            DropDownList1.DataBind();
            Conn.Close();
            Conn.Open();

            cmd             = new MySqlCommand("select name from users", Conn);
            cmd.CommandType = CommandType.Text;

            ddlValues = cmd.ExecuteReader();

            DropDownList3.DataSource    = ddlValues;
            DropDownList3.DataTextField = "name";
            //  DropDownList1.DataValueField = "id";
            DropDownList3.DataBind();
            Conn.Close();
            Conn.Open();

            cmd             = new MySqlCommand("select bookid from library", Conn);
            cmd.CommandType = CommandType.Text;

            ddlValues = cmd.ExecuteReader();

            DropDownList4.DataSource    = ddlValues;
            DropDownList4.DataTextField = "bookid";
            //  DropDownList1.DataValueField = "id";
            DropDownList4.DataBind();
            Conn.Close();

            checkdata();
        }
示例#16
0
        protected void Page_Load(object sender, EventArgs e)
        {
            connect connect;

            try
            {
                if (Request.QueryString["id_kho_hang"] != null && Request.QueryString["id_kho_hang"] != "")
                {
                    id_kho_hang = int.Parse(Request.QueryString["id_kho_hang"]);
                }
            }
            catch (Exception qqe) { }
            if (id_kho_hang == 0)
            {
                Response.Redirect("./danhSach.aspx");
            }
            WebApplication2.QuanTri.maHoa mH = new WebApplication2.QuanTri.maHoa();
            connect = new connect();
            System.Data.SqlClient.SqlConnection ketnoi = new System.Data.SqlClient.SqlConnection(connect.getconnect());
            string sql = "select id_kho_hang, id_khu_vuc, ten_kho_hang, dia_chi_kho_hang_chi_tiet, dien_tich_kho, cast(FORMAT(ngay_tao_kho, 'yyyy-MM-dd') as varchar) as ngay_tao_kho, ghi_chu_kho " +
                         "from kho_hang " +
                         "where id_kho_hang=" + id_kho_hang;

            DataTable ds = new DataTable();

            new System.Data.SqlClient.SqlDataAdapter(new System.Data.SqlClient.SqlCommand(sql, ketnoi)).Fill(ds);
            if (ds == null || ds.Rows.Count == 0)
            {
                Response.Redirect("./danhSach.aspx");
            }

            //1. danh sách tỉnh
            sql     = "select id_khu_vuc, ten_khu_vuc from khu_vuc where id_khu_vuc_cha=0";
            connect = new connect();
            DataTable tmp = new DataTable();

            new System.Data.SqlClient.SqlDataAdapter(new System.Data.SqlClient.SqlCommand(sql, ketnoi)).Fill(tmp);
            if (!IsPostBack)
            {
                DropDownList2.DataSource     = tmp;
                DropDownList2.DataTextField  = "ten_khu_vuc";
                DropDownList2.DataValueField = "id_khu_vuc";
                DropDownList2.DataBind();
            }
            //2. set mã tỉnh
            sql = "select id_khu_vuc_cha from khu_vuc where id_khu_vuc=" + ds.Rows[0][1].ToString();
            tmp = new DataTable();
            new System.Data.SqlClient.SqlDataAdapter(new System.Data.SqlClient.SqlCommand(sql, ketnoi)).Fill(tmp);
            string id_tinh = tmp.Rows[0][0].ToString();

            //3. huyện
            sql = "select id_khu_vuc, ten_khu_vuc from khu_vuc where id_khu_vuc_cha=" + tmp.Rows[0][0].ToString();
            tmp = new DataTable();
            new System.Data.SqlClient.SqlDataAdapter(new System.Data.SqlClient.SqlCommand(sql, ketnoi)).Fill(tmp);
            if (!IsPostBack)
            {
                DropDownList1.DataSource     = tmp;
                DropDownList1.DataTextField  = "ten_khu_vuc";
                DropDownList1.DataValueField = "id_khu_vuc";
                DropDownList1.DataBind();
            }

            if (!IsPostBack)
            {
                TextBox6.Text  = ds.Rows[0][0].ToString();
                TextBox7.Text  = ds.Rows[0][2].ToString();
                TextBox3.Text  = ds.Rows[0][3].ToString();
                TextBox8.Text  = ds.Rows[0][4].ToString();
                TextBox9.Text  = ds.Rows[0][5].ToString();
                TextBox10.Text = ds.Rows[0][6].ToString();
                DropDownList2.SelectedValue = id_tinh;
                DropDownList1.SelectedValue = ds.Rows[0][1].ToString();
            }
        }
示例#17
0
        protected void Page_Load(object sender, EventArgs e)
        {
            B_ARoleAuth.CheckEx(ZLEnum.Auth.model, "NodeEdit");
            if (function.isAjax())
            {
                #region AJAX
                M_Node nodeMod = nodeBll.SelReturnModel(NodeID);
                if (NodeID < 1)
                {
                    nodeMod.ParentID = ParentID;
                }
                string action = Request.Form["action"];
                string value  = Request.Form["value"];
                int    result = M_APIResult.Success;
                switch (action)
                {
                case "nodename":
                {
                    nodeMod.NodeName = value;
                    result           = nodeBll.CheckNodeName(nodeMod) ? M_APIResult.Success : M_APIResult.Failed;
                }
                break;

                case "nodedir":
                {
                    nodeMod.NodeDir = value;
                    result          = nodeBll.CheckNodeDir(nodeMod) ? M_APIResult.Success : M_APIResult.Failed;
                }
                break;
                }
                Response.Write(result); Response.Flush(); Response.End();
                #endregion
            }
            if (!IsPostBack)
            {
                M_AdminInfo adminMod  = B_Admin.GetLogin();
                M_Node      nodeMod   = nodeBll.SelReturnModel(NodeID);
                M_Node      parentMod = nodeBll.SelReturnModel(ParentID > 0 ? ParentID : nodeMod.ParentID);
                LblNodeName.Text = parentMod.NodeName;
                if (NodeID < 1)
                {
                    Title_T.Text = "添加节点";
                    CDate_T.Text = DateTime.Now.ToString();
                    CUser_T.Text = adminMod.AdminName;
                    ModelArr    += parentMod.ContentModel;
                    function.Script(this, "BindPY();");
                }
                else
                {
                    Title_T.Text        = "修改节点";
                    Release_Btn.Visible = true;
                    #region 节点信息填充
                    if (nodeMod.IsNull)
                    {
                        function.WriteErrMsg("指定要编辑的节点不存在");
                    }
                    TxtNodeName.Text        = nodeMod.NodeName;
                    TxtNodeDir.Text         = nodeMod.NodeDir;
                    TxtNodePicUrl.Text      = nodeMod.NodePic;
                    TxtTips.Text            = nodeMod.Tips;
                    TxtMetaKeywords.Text    = nodeMod.Meta_Keywords;
                    TxtMetaDescription.Text = nodeMod.Meta_Description;
                    TxtDescription.Text     = nodeMod.Description;
                    //RBLOpenType.SelectedValue = DataConverter.CLng(node.OpenNew).ToString();
                    RBLPurviewType.SelectedValue       = nodeMod.PurviewType ? "1" : "0";
                    SiteContentAudit_Rad.SelectedValue = nodeMod.SiteContentAudit.ToString();
                    RBLCommentType.SelectedValue       = nodeMod.CommentType;
                    TxtHitsOfHot.Text = nodeMod.HitsOfHot.ToString();

                    TxtTemplate_hid.Value      = nodeMod.ListTemplateFile;
                    IndexTemplate_hid.Value    = nodeMod.IndexTemplate;
                    LastinfoTemplate_hid.Value = nodeMod.LastinfoTemplate;
                    ProposeTemplate_hid.Value  = nodeMod.ProposeTemplate;
                    HotinfoTemplate_hid.Value  = nodeMod.HotinfoTemplate;

                    ListPageHtmlEx_Rad.SelectedValue = nodeMod.ListPageHtmlEx.ToString();
                    ContentFileEx_Rad.SelectedValue  = nodeMod.ContentFileEx.ToString();
                    ListPageEx_Rad.SelectedValue     = nodeMod.ListPageEx.ToString();
                    LastinfoPageEx_Rad.SelectedValue = nodeMod.LastinfoPageEx.ToString();
                    HotinfoPageEx.SelectedValue      = nodeMod.HotinfoPageEx.ToString();
                    ProposePageEx.SelectedValue      = nodeMod.ProposePageEx.ToString();
                    DDLContentRule.SelectedValue     = nodeMod.ContentPageHtmlRule.ToString();
                    RBLPosition.SelectedValue        = nodeMod.HtmlPosition.ToString();
                    RBLItemOpenType.SelectedValue    = nodeMod.ItemOpenType.ToString();
                    function.Script(this, "SetRadVal('UrlFormat_Rad','" + nodeMod.ItemOpenTypeTrue + "');");
                    RBLOpenType.SelectedValue  = nodeMod.OpenTypeTrue.ToString();
                    TxtAddMoney.Text           = nodeMod.AddMoney.ToString();
                    TxtAddPoint.Text           = nodeMod.AddPoint.ToString();
                    ClickTimeout.SelectedValue = nodeMod.ClickTimeout.ToString();
                    txtAddExp.Text             = nodeMod.AddUserExp.ToString();
                    txtDeducExp.Text           = nodeMod.DeducUserExp.ToString();
                    ConsumeType_Hid.Value      = nodeMod.ConsumeType.ToString();
                    CDate_T.Text = nodeMod.CDate.ToString();
                    CUser_T.Text = nodeMod.CUName;
                    DataTable auitDt = nodeBll.GetNodeAuitDT(nodeMod.Purview);
                    //组权限绑定
                    GroupAuthDT = psll.SelByNid(NodeID);
                    DataTable tinfo = bGll.GetGroupList();
                    GroupAuth_EGV.DataSource = tinfo;
                    GroupAuth_EGV.DataBind();
                    for (int i = 0; i < tinfo.Rows.Count; i++)
                    {
                        ViewGroup_Chk.Items.Add(new ListItem(tinfo.Rows[i]["GroupName"].ToString(), tinfo.Rows[i]["GroupID"].ToString()));
                        ViewGroup2_Chk.Items.Add(new ListItem(tinfo.Rows[i]["GroupName"].ToString(), tinfo.Rows[i]["GroupID"].ToString()));
                        input_Chk.Items.Add(new ListItem(tinfo.Rows[i]["GroupName"].ToString(), tinfo.Rows[i]["GroupID"].ToString()));
                    }
                    //节点权限
                    if (auitDt != null && auitDt.Rows.Count > 0)
                    {
                        DataRow auitdr = auitDt.Rows[0];
                        SelCheck_RadioList.SelectedValue = auitdr["View"].ToString();
                        string ViewGroup    = auitdr["ViewGroup"].ToString();
                        string ViewSunGroup = auitdr["ViewSunGroup"].ToString();
                        string input        = auitdr["input"].ToString();
                        string forum        = auitdr["forum"].ToString();
                        foreach (ListItem item in ViewGroup_Chk.Items)
                        {
                            if (("," + ViewGroup + ",").Contains("," + item.Value + ","))
                            {
                                item.Selected = true;
                            }
                        }
                        foreach (ListItem item in ViewGroup2_Chk.Items)
                        {
                            if (("," + ViewSunGroup + ",").Contains("," + item.Value + ","))
                            {
                                item.Selected = true;
                            }
                        }
                        foreach (ListItem item in input_Chk.Items)
                        {
                            if (("," + input + ",").Contains("," + item.Value + ","))
                            {
                                item.Selected = true;
                            }
                        }
                        foreach (ListItem item in forum_Chk.Items)
                        {
                            if (("," + forum + ",").Contains("," + item.Value + ","))
                            {
                                item.Selected = true;
                            }
                        }
                    }
                    TxtConsumeCount.Text = nodeMod.ConsumeCount.ToString();
                    TxtConsumePoint.Text = nodeMod.ConsumePoint.ToString();
                    TxtConsumeTime.Text  = nodeMod.ConsumeTime.ToString();
                    TxtShares.Text       = nodeMod.Shares.ToString();
                    SetCustom(nodeMod.Custom);
                    ModelArr            = nodeMod.ContentModel;
                    isSimple_CH.Checked = nodeMod.Contribute == 1;
                    SafeGuard.Checked   = nodeMod.SafeGuard == 1 ? true : false;
                    #endregion
                }
                //添加工作流
                ddlState.DataSource     = bf.GetFlowAll();
                ddlState.DataTextField  = "flowName";
                ddlState.DataValueField = "id";
                ddlState.DataBind();
                ddlState.Items.Insert(0, new ListItem("不指定", "0"));
                droMod = droBll.SelByNodeID(NodeID);
                ddlState.SelectedValue = droMod == null ? "0" : droMod.FID.ToString();
                BGroup.DataSource      = bGll.GetGroupList();
                BGroup.DataBind();
                //内容模型列表
                DataTable dt = bllmodel.GetList();
                Model_RPT.DataSource = dt;
                Model_RPT.DataBind();
                //角色列表
                DataTable Rt = B_Role.SelectNodeRoleNode(NodeID);
                AdminRole_EGV.DataSource = Rt;
                AdminRole_EGV.DataBind();

                #region 互动
                DataTable dp = pll.GetPubModelPublic();
                DropDownList1.DataSource     = dp;
                DropDownList1.DataTextField  = "PubName";
                DropDownList1.DataValueField = "Pubid";
                DropDownList1.DataBind();
                DropDownList1.Items.Insert(0, new ListItem("选择绑定", "0"));
                M_Pub pp = pll.GetSelectNode(NodeID.ToString());
                if (pp.Pubid > 0)
                {
                    DropDownList1.SelectedValue = pp.Pubid.ToString();
                }
                #endregion
                string bread = "<li><a href='" + customPath2 + "Config/SiteInfo.aspx'>系统设置</a></li><li>" + (ViewMode.Equals("design") || ViewMode.Equals("child") ? "<a href='DesignNodeManage.aspx'>动力节点</a>" : "<a href='NodeManage.aspx'>节点管理</a>") + "</li>";
                bread += "<li class='active'><a href='" + Request.RawUrl + "'>" + Title_T.Text + "</a></li>";
                bread += Call.GetHelp(103);
                bread += "<div class='pull-right' style='margin-right:10px;'><a href='" + Request.RawUrl + "' title='刷新'><i class='fa fa-refresh'></i></a></div>";
                Call.SetBreadCrumb(Master, bread);
            }
        }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            txtEstimateSTARTTIME.SelectedDate = Convert.ToDateTime(DateTime.Now.AddDays(-1).ToString("yyyy/MM/dd"));
            txtEstimateEndTime.SelectedDate   = Convert.ToDateTime(DateTime.Now.AddDays(+1).ToString("yyyy/MM/dd"));

            string[] dl_status = { "OPEN", "PROC", "ACK" };
            DropDownList1.DataSource = dl_status;

            DropDownList1.DataBind();
            DropDownList1.Items.Insert(0, "請選擇");


            #region hour
            arlist_temp1 = func.FileToArray(Server.MapPath("..\\") + "\\config\\hour.txt");



            DropDownList3.DataSource = arlist_temp1;
            DropDownList3.DataBind();
            DropDownList3.Items.Insert(0, today_hour);



            DropDownList5.DataSource = arlist_temp1;
            DropDownList5.DataBind();
            DropDownList5.Items.Insert(0, today_hour);

            #endregion


            #region min
            arlist_temp1 = func.FileToArray(Server.MapPath("..\\") + "\\config\\min.txt");

            DropDownList4.DataSource = arlist_temp1;
            DropDownList4.DataBind();
            DropDownList4.Items.Insert(0, today_hour);


            DropDownList6.DataSource = arlist_temp1;
            DropDownList6.DataBind();
            DropDownList6.Items.Insert(0, today_min);


            #endregion

            sql_temp = @"select * from (

select * from (

SELECT t1.logid,t1.event_id, t1.fab_id, t1.subsystem_id, t1.alarm_level,t1.eq_id,t2.alarm_id, t1.user_id, t1.status, t1.lasttrans_date, t1.start_date, t1.user_e_mail, t1.user_sms_num, t1.user_mobil_tel,t2.alarm_text,t2.alarm_comment,round((to_date(substr(t1.lasttrans_date,0,16),'yyyy/MM/dd HH24:MI')-to_date(substr(t1.start_date,0,16),'yyyy/MM/dd HH24:MI'))*24*60,0) as delay_Time
FROM sum_alarm t1 ,Txn_Alarm t2 WHERE 1=1  and t1.logid=t2.logid(+)
and t1.logid>'{0}'  
and t1.logid<'{1}'
and t1.user_mobil_tel ='64170'
--and t1.user_sms_num='60515'
--and t1.user_e_mail like '%OSCAR%'
ORDER BY START_DATE DESC 


)ot1
where 1=1


union 

select * from (


SELECT t1.logid,t1.event_id, t1.fab_id, t1.subsystem_id, t1.alarm_level,t1.eq_id,t2.alarm_id, t1.user_id, t1.status, t1.lasttrans_date, t1.start_date, t1.user_e_mail, t1.user_sms_num, t1.user_mobil_tel,t2.alarm_text,t2.alarm_comment,round((to_date(substr(t1.lasttrans_date,0,16),'yyyy/MM/dd HH24:MI')-to_date(substr(t1.start_date,0,16),'yyyy/MM/dd HH24:MI'))*24*60,0) as delay_Time
FROM sum_alarm@alm2hub t1 ,Txn_Alarm@alm2hub t2 WHERE 1=1  and t1.logid=t2.logid(+)
and t1.logid>'{0}'  
and t1.logid<'{1}'
and t1.user_mobil_tel ='55021456'
--and t1.user_sms_num='60515'
--and t1.user_e_mail like '%OSCAR%'

union


SELECT t1.logid,t1.event_id, t1.fab_id, t1.subsystem_id, t1.alarm_level,t1.eq_id,t2.alarm_id, t1.user_id, t1.status, t1.lasttrans_date, t1.start_date, t1.user_e_mail, t1.user_sms_num, t1.user_mobil_tel,t2.alarm_text,t2.alarm_comment,round((to_date(substr(t1.lasttrans_date,0,16),'yyyy/MM/dd HH24:MI')-to_date(substr(t1.start_date,0,16),'yyyy/MM/dd HH24:MI'))*24*60,0) as delay_Time
FROM HIS_ALARMSUMMARY@alm2hub t1 ,HIS_ALARMTRANSACTION@alm2hub t2 WHERE 1=1  and t1.logid=t2.logid(+)
and t1.logid>'{0}'  
and t1.logid<'{1}'
and t1.user_mobil_tel ='55021456'
--and t1.user_sms_num='60515'
--and t1.user_e_mail like '%OSCAR%'




)ot1


)ot3

order by logid,lasttrans_date desc 









";



            sql_temp = string.Format(sql_temp, txtEstimateSTARTTIME.SelectedDate.Value.ToString("yyyyMMdd") + DropDownList3.SelectedValue.ToString() + DropDownList4.SelectedValue.ToString(), txtEstimateEndTime.SelectedDate.Value.ToString("yyyyMMdd") + DropDownList5.SelectedValue.ToString() + DropDownList6.SelectedValue.ToString());


            Bind_data(sql_temp, conn1);
        }
    }
 protected void TextBox5_TextChanged(object sender, EventArgs e)
 {
     DropDownList1.DataBind();
 }
 protected void EmployeeIDDropDownList_SelectedIndexChanged(object sender, EventArgs e)
 {
     DropDownList1.DataBind();
 }
示例#21
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string schoolid = Convert.ToString(Session["schoolid"]);

        schoolidtxtValue = schoolid;
        DAL     obj  = new DAL();
        DAL     obj1 = new DAL();
        DataSet ds1  = obj.getStrm(schoolid);

        DropDownList1.DataSource     = ds1.Tables[0];
        DropDownList1.DataTextField  = "strm";
        DropDownList1.DataValueField = "strm";
        DropDownList1.DataBind();

        DataSet ds = new DataSet();

        ds.Clear();
        ds = obj1.getCourses(schoolid);
        StringBuilder sb = new StringBuilder();
        DataTable     dt = new DataTable();

        dt.Clear();
        dt = ds.Tables[0];
        if (dt != null)
        {
            if (dt.Rows.Count > 0)
            {
                foreach (DataRow dr in dt.Rows)
                {
                    sb.Append("<tr>");
                    sb.Append("<td>");
                    sb.Append((dr["courseid"]));
                    sb.Append("</td>");
                    sb.Append("<td>");
                    sb.Append((dr["coursename"]));
                    sb.Append("</td>");
                    sb.Append("<td>");
                    sb.Append((dr["strm"]));
                    sb.Append("</td>");
                    sb.Append("<td>");
                    sb.Append((dr["seats"]));
                    sb.Append("</td>");
                    sb.Append("<td>");
                    sb.Append((dr["enrollments"]));
                    sb.Append("</td>");
                    sb.Append("<td>");
                    sb.Append((dr["cost"]));
                    sb.Append("</td>");
                    sb.Append("<td>");
                    sb.Append((dr["status"]));
                    sb.Append("</td>");
                    sb.Append("<td>");
                    sb.Append((dr["created_at"]));
                    sb.Append("</td>");
                    sb.Append("<td align='center'>");
                    sb.Append("<a href='#' class='btn btn-warning btn-xs courseupdatecls' data-toggle='modal' data-target='#courseupdateModel' style='text-decoration:none'>Update</a>");
                    sb.Append("</td>");
                    sb.Append("<td align='center'>");
                    sb.Append("<a href='#' class='btn btn-danger btn-xs coursedeleteecls' data-toggle='modal' data-target='#coursedeleteModal' style='text-decoration:none'>Delete</a>");
                    sb.Append("</td>");
                    sb.Append("</tr>");
                }
            }
        }

        ltData.Text = sb.ToString();
    }
示例#22
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            if (Session[Session["TMLDealercode"] + "-TMLConString"].ToString() == null || Session[Session["TMLDealercode"] + "-TMLConString"].ToString() == "")
            {
                Modal.Close(this);
                // Response.Redirect("login.aspx");
            }
        }
        catch
        {
            // Response.Redirect("login.aspx");
        }
        try
        {
            if (Session["TLID"].ToString() == null)
            {
                Modal.Close(this);
                Response.Redirect("NewJobAllotment.aspx");
            }
            else
            {
                //  FillTechnicianDashboard(Convert.ToInt16(Session["TLID"].ToString()));
            }
            TextBoxVeh.Attributes.Add("readonly", "readonly");
            TextBoxName.Attributes.Add("readonly", "readonly");
            TextBoxName1.Attributes.Add("readonly", "readonly");
            TextBoxName2.Attributes.Add("readonly", "readonly");
            TextBoxStd.Attributes.Add("readonly", "readonly");
            TextBoxStd1.Attributes.Add("readonly", "readonly");
            TextBoxStd2.Attributes.Add("readonly", "readonly");

            if (TextBoxjc.Visible == true)
            {
                txtjobDesc.Attributes.Add("readonly", "readonly");
            }
            else if (TextBoxjc.Visible == false)
            {
                txtjobDesc.Attributes.Remove("readonly");
            }

            if (drpJobcode2.Visible == true)
            {
                txtjobdesc1.Attributes.Add("readonly", "readonly");
            }
            else
            {
                txtjobdesc1.Attributes.Remove("readonly");
            }

            if (drpJobcode3.Visible == true)
            {
                txtjobdesc2.Attributes.Add("readonly", "readonly");
            }
            else
            {
                txtjobdesc2.Attributes.Remove("readonly");
            }


            FillVehicleDashboard("GetRegTagList_NEW");

            if (!IsPostBack)
            {
                bool time = Request.QueryString["time"] == "yes";
                RadioButtonList1.SelectedIndex = 0;
                if (time)
                {
                    TextBoxStart1.Text = Convert.ToDateTime(Request.QueryString["start"]).ToString("M/d/yyyy HH:mm");
                }
                else
                {
                    TextBoxStart1.Text = Convert.ToDateTime(Request.QueryString["start"]).ToString("M/d/yyyy HH:mm");
                }

                using (SqlConnection con = new SqlConnection(Session[Session["TMLDealercode"] + "-TMLConString"].ToString()))
                {
                    using (SqlCommand cmd = new SqlCommand("GetBays_TLWise"))
                    {
                        cmd.CommandType = CommandType.StoredProcedure;
                        cmd.Parameters.AddWithValue("@TLID", Session["TLID"].ToString());
                        cmd.Connection = con;
                        con.Open();
                        DropDownList1.DataSource     = cmd.ExecuteReader();
                        DropDownList1.DataTextField  = "Name";
                        DropDownList1.DataValueField = "Id";
                        DropDownList1.DataBind();
                    }
                }
                DropDownList1.Items.Insert(0, new ListItem("--Select Bay--", "0"));
                DropDownList1.SelectedValue = Request.QueryString["r"];
            }
        }
        catch (Exception ex)
        {
            Response.Redirect("NewJobAllotment.aspx");
        }
    }
示例#23
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            if (!IsPostBack)
            {
                string  sqlstring = "SELECT * FROM carname";
                DBClass db        = new DBClass(sqlstring);
                DropDownList8.DataSource     = db.returndr();
                DropDownList8.DataTextField  = "车辆名称";
                DropDownList8.DataValueField = "车辆名称";
                DropDownList8.DataBind();
                db.dbClose();
            }

            if (!IsPostBack)
            {
                string  sqlstring = "SELECT * FROM cartype";
                DBClass db        = new DBClass(sqlstring);
                DropDownList1.DataSource     = db.returndr();
                DropDownList1.DataTextField  = "车辆类型";
                DropDownList1.DataValueField = "车辆类型";
                DropDownList1.DataBind();
                db.dbClose();
            }
            if (!IsPostBack)
            {
                string  sqlstring = "SELECT * FROM state";
                DBClass db        = new DBClass(sqlstring);
                DropDownList3.DataSource     = db.returndr();
                DropDownList3.DataTextField  = "车辆状态";
                DropDownList3.DataValueField = "车辆状态";
                DropDownList3.DataBind();
                db.dbClose();
            }
            if (!IsPostBack)
            {
                string  sqlstring = "SELECT * FROM carcolor";
                DBClass db        = new DBClass(sqlstring);
                DropDownList2.DataSource     = db.returndr();
                DropDownList2.DataTextField  = "车辆颜色名";
                DropDownList2.DataValueField = "车辆颜色名";
                DropDownList2.DataBind();
                db.dbClose();
            }
            if (!IsPostBack)
            {
                string  sqlstring = "SELECT * FROM subpoint";
                DBClass db        = new DBClass(sqlstring);
                DropDownList4.DataSource     = db.returndr();
                DropDownList4.DataTextField  = "业务部编号";
                DropDownList4.DataValueField = "业务部编号";
                DropDownList4.DataBind();
                db.dbClose();
            }
            if (!IsPostBack)
            {
                string  sqlstring = "SELECT * FROM insuretype";
                DBClass db        = new DBClass(sqlstring);
                DropDownList5.DataSource     = db.returndr();
                DropDownList5.DataTextField  = "保险类型";
                DropDownList5.DataValueField = "保险类型";
                DropDownList5.DataBind();
                db.dbClose();
            }
            if (!IsPostBack)
            {
                string  sqlstring = "SELECT * FROM insurecompany";
                DBClass db        = new DBClass(sqlstring);
                DropDownList6.DataSource     = db.returndr();
                DropDownList6.DataTextField  = "保险公司";
                DropDownList6.DataValueField = "保险公司";
                DropDownList6.DataBind();
                db.dbClose();
            }
            if (!IsPostBack)
            {
                string  sqlstring = "SELECT * FROM oiltype";
                DBClass db        = new DBClass(sqlstring);
                DropDownList7.DataSource     = db.returndr();
                DropDownList7.DataTextField  = "油类型";
                DropDownList7.DataValueField = "油类型";
                DropDownList7.DataBind();
                db.dbClose();
            }            // 在此处放置用户代码以初始化页面

            Button3.Attributes.Add("onclick", "javascript:return confirm('您确认要添加照片么?')");
        }
示例#24
0
        public void GetRouteDetailsbyID(int CenterID)
        {
            DataSet         DS = new DataSet();
            ProcurementData pd = new ProcurementData();

            DS = pd.GetCenterDetailsByID(CenterID);
            if (!Comman.Comman.IsDataSetEmpty(DS))
            {
                txtCenterCode.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["CenterCode"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["CenterCode"].ToString();
                txtCenterName.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["CenterName"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["CenterName"].ToString();
                //dpRoute.ClearSelection();
                //if (dpRoute.Items.FindByValue(DS.Tables[0].Rows[0]["RouteID"].ToString()) != null)
                //{
                //    dpRoute.Items.FindByValue(DS.Tables[0].Rows[0]["RouteID"].ToString()).Selected = true;
                //}
                txtAddress1.Text  = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["Address1"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["Address1"].ToString();
                txtAddress2.Text  = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["Address2"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["Address2"].ToString();
                txtAddress3.Text  = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["Address3"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["Address3"].ToString();
                txtMobile.Text    = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["MobileNo"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["MobileNo"].ToString();
                txtTelephone.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["PhoneNo"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["PhoneNo"].ToString();
                txtEmail.Text     = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["Email"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["Email"].ToString();
                dpCity.ClearSelection();
                if (dpCity.Items.FindByText(DS.Tables[0].Rows[0]["City"].ToString()) != null)
                {
                    dpCity.Items.FindByText(DS.Tables[0].Rows[0]["City"].ToString()).Selected = true;
                }
                dpDistrict.ClearSelection();
                if (dpDistrict.Items.FindByText(DS.Tables[0].Rows[0]["District"].ToString()) != null)
                {
                    dpDistrict.Items.FindByText(DS.Tables[0].Rows[0]["District"].ToString()).Selected = true;
                }
                dpState.ClearSelection();
                if (dpState.Items.FindByText(DS.Tables[0].Rows[0]["State"].ToString()) != null)
                {
                    dpState.Items.FindByText(DS.Tables[0].Rows[0]["State"].ToString()).Selected = true;
                }
                dpCountry.ClearSelection();
                if (dpCountry.Items.FindByText(DS.Tables[0].Rows[0]["Country"].ToString()) != null)
                {
                    dpCountry.Items.FindByText(DS.Tables[0].Rows[0]["Country"].ToString()).Selected = true;
                }
                //dpCity.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["City"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["City"].ToString();
                //dpDistrict.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["District"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["District"].ToString();
                //dpState.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["State"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["State"].ToString();
                //dpCountry.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["Country"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["Country"].ToString();
                dpContactPerson.ClearSelection();
                if (dpContactPerson.Items.FindByValue(DS.Tables[0].Rows[0]["ContactPerson"].ToString()) != null)
                {
                    dpContactPerson.Items.FindByValue(DS.Tables[0].Rows[0]["ContactPerson"].ToString()).Selected = true;
                }

                if (DS.Tables[0].Rows[0]["FreezerAvailable"].ToString() == "True")
                {
                    rdYes.Checked        = true;
                    rdNo.Checked         = false;
                    d1.Visible           = true;
                    txtFreezerModel.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["FreezerModel"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["FreezerModel"].ToString();
                    txtQuantity.Text     = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["Quantity"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["Quantity"].ToString();
                }
                else if (DS.Tables[0].Rows[0]["FreezerAvailable"].ToString() == "False")
                {
                    rdNo.Checked = true;
                    d1.Visible   = false;
                }
                DropDownList1.ClearSelection();
                if (DS.Tables[0].Rows[0]["IsActive"].ToString() == "True")
                {
                    DropDownList1.Items.FindByValue("1").Selected = true;
                }
                else if (DS.Tables[0].Rows[0]["IsActive"].ToString() == "False")
                {
                    DropDownList1.Items.FindByValue("2").Selected = true;
                }

                txtBMC.Text     = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["BMC"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["BMC"].ToString();
                txtMilkCan.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["MilkCan"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["MilkCan"].ToString();
                txtSilo.Text    = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["Silo"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["Silo"].ToString();

                if (DS.Tables[0].Rows[0]["IBT"].ToString() == "True")
                {
                    rdIBTYes.Checked = true;
                    rdIBTNo.Checked  = false;
                }
                else if (DS.Tables[0].Rows[0]["IBT"].ToString() == "False")
                {
                    rdIBTNo.Checked  = true;
                    rdIBTYes.Checked = false;
                }
                if (DS.Tables[0].Rows[0]["ETP"].ToString() == "True")
                {
                    rdETPYes.Checked = true;
                    rdETPNo.Checked  = false;
                }
                else if (DS.Tables[0].Rows[0]["ETP"].ToString() == "False")
                {
                    rdETPNo.Checked  = true;
                    rdETPYes.Checked = false;
                }
                if (DS.Tables[0].Rows[0]["LAB"].ToString() == "True")
                {
                    rdLABYes.Checked = true;
                    rdLABNo.Checked  = false;
                }
                else if (DS.Tables[0].Rows[0]["LAB"].ToString() == "False")
                {
                    rdLABNo.Checked  = true;
                    rdLABYes.Checked = false;
                }
                if (DS.Tables[0].Rows[0]["Store"].ToString() == "True")
                {
                    rdStoreYes.Checked = true;
                    rdStoreNo.Checked  = false;
                }
                else if (DS.Tables[0].Rows[0]["Store"].ToString() == "False")
                {
                    rdStoreNo.Checked  = true;
                    rdStoreYes.Checked = false;
                }
            }
        }
    protected void Button1_Click(object sender, EventArgs e)
    {
        string nam = TextBox1.Text;
        string eml = txtemail.Text;
        string phn = TextBox2.Text;
        string cou = DropDownList1.SelectedItem.Text.ToString();

        if (eml != "")
        {
            if (phn != "")
            {
                try{
                    using (MailMessage mm = new MailMessage("*****@*****.**", "*****@*****.**"))
                    {
                        mm.CC.Add("*****@*****.**");
                        mm.Subject    = "Demo Class Enquiry - Course : " + DropDownList1.SelectedItem.Text.ToString();
                        mm.Body       = "\nA Student Wants A Demo Class Regarding the Course of :" + DropDownList1.SelectedItem.Text.ToString() + " \n\n Details Are As Follow :\nName :" + TextBox1.Text + "\nPhone No.:" + TextBox2.Text + "\nCourse Regarding Query :" + DropDownList1.SelectedItem.Text.ToString();
                        mm.IsBodyHtml = false;
                        SmtpClient smtp = new SmtpClient();
                        smtp.Host      = "smtp.gmail.com";
                        smtp.EnableSsl = true;
                        NetworkCredential NetworkCred = new NetworkCredential("*****@*****.**", "shri2403");
                        smtp.UseDefaultCredentials = true;
                        smtp.Credentials           = NetworkCred;
                        smtp.Port = 587;
                        smtp.Send(mm);
                    }
                    using (MailMessage mm = new MailMessage("*****@*****.**", txtemail.Text))
                    {
                        mm.Subject    = "Thanks For Contacting SIIT ";
                        mm.Body       = "\nSIIT GIVING THANKS FOR DROPPING AN MESSAGE REGARDING THE COURSE OF :" + DropDownList1.SelectedItem.Text.ToString() + ".\n We Will Contact You As Soon As Possible.\n\nThanks\nFrom : SIIT\nSHRI INSTITUTE OF INFORMATION TECHNOLOGY\nFor Any Queries :\nContact : +91 9650-777-567";
                        mm.IsBodyHtml = false;
                        SmtpClient smtp = new SmtpClient();
                        smtp.Host      = "smtp.gmail.com";
                        smtp.EnableSsl = true;
                        NetworkCredential NetworkCred = new NetworkCredential("*****@*****.**", "shri2403");
                        smtp.UseDefaultCredentials = true;
                        smtp.Credentials           = NetworkCred;
                        smtp.Port = 587;
                        smtp.Send(mm);
                    }
                    SqlCommand cmd = new SqlCommand("insert into demo values('" + nam + "','" + eml + "','" + phn + "','" + cou + "')", con);
                    con.Open();
                    cmd.ExecuteNonQuery();
                    con.Close();
                    Response.Write("<script>alert('Data Has Been Submitted! We Contact You As Soonn As Possible.');</script>");
                    TextBox1.Text = "";
                    txtemail.Text = "";
                    TextBox2.Text = "";
                    DropDownList1.ClearSelection();
                }
                catch (Exception)
                {
                    Response.Write("<script>alert('Eror while submitting the data!');</script>");
                }
            }
            else
            {
                TextBox2.Focus();
            }
        }
        else
        {
            txtemail.Focus();
        }
    }
示例#26
0
        DataSet MyDataSet = new DataSet();  //for pdf

        protected void Page_Load(object sender, EventArgs e)
        {
            _role = CheckAccount();

            if (!string.IsNullOrEmpty(Request["t"]))
            {
                _type = int.Parse(Request["t"]);
            }

            if (!IsPostBack)
            {
                KOS.App_Code.ClearTemp clear = new App_Code.ClearTemp(Request);
                clear.DeleteOld();

                if (_type == 0)
                {
                    Period.Visible   = true;
                    Beg.SelectedDate = DateTime.Now.AddDays(-2);
                    End.SelectedDate = DateTime.Now;
                    phReport.Visible = false;
                }
                else
                {
                    Period.Visible   = false;
                    phReport.Visible = true;
                }

                UpdateLabel();

                List <Data> data = GetData();
                Out.DataSource = data;
                Out.DataBind();



                using (SqlConnection conn = new SqlConnection(WebConfigurationManager.ConnectionStrings["DefaultConnection"].ToString()))
                {
                    conn.Open();

                    SqlCommand cmd;
                    //    адреса ОДС
                    {
                        cmd = new SqlCommand("select tt.Ttx, tt.Id from Ttx tt " +
                                             "join LiftsTtx lt on lt.TtxId=tt.Id " +
                                             "join ODSLifts o on o.LiftId=lt.LiftId " +
                                             "join Users u on u.UserId=o.UserId " +
                                             "where tt.TtxTitleId=1 and u.UserName=@userName " +
                                             "group by tt.Ttx, tt.Id", conn);
                        if (User.Identity.Name == "Миракс_Парк")
                        {
                            cmd.Parameters.AddWithValue("userName", "ODS13");
                        }
                        else if (User.Identity.Name == "Корона_1")
                        {
                            cmd.Parameters.AddWithValue("userName", "ODS14");
                        }
                    }

                    /*      Все адреса!
                     *    {
                     *        cmd = new SqlCommand("select tt.Ttx, tt.Id from Ttx tt " +
                     *            "where tt.TtxTitleId=1 " +
                     *            "group by tt.Ttx, tt.Id", conn);
                     *    }
                     */
                }
                List <string> uslugy = new List <string>()
                {
                    "Эксплуатация зданий", "Эксплуатация лифтов", "Электроснабжение", "Отопление", "Водоснабжение", "Водоотведение", "Охрана", "Клининг"
                };
                if (!IsPostBack)
                {
                    DropDownList1.DataSource = uslugy;
                    DropDownList1.DataBind();
                    DropDownList1.SelectedIndex = 0;

                    Uslugy_TextChanged(this, EventArgs.Empty);
                }
            }
        }
示例#27
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Label1.Text = "";
            if (!Page.IsPostBack)
            {
                DropDownList3.DataValueField = "Brn_No";
                DropDownList3.DataTextField  = "Brn_NmAr";
                DropDownList3.DataSource     = db.MainBranch.ToList();
                DropDownList3.DataBind();

                DropDownList4.DataValueField = "ACC_No";
                DropDownList4.DataTextField  = "Acc_NmAr";
                DropDownList4.DataSource     = db.GLAstbank.ToList();
                DropDownList4.DataBind();

                DropDownList5.DataValueField = "Sup_No";
                DropDownList5.DataTextField  = "Sup_NmAr";
                DropDownList5.DataSource     = db.MtsSuplir.ToList();
                DropDownList5.DataBind();

                DropDownList6.DataValueField = "Cntry_No";
                DropDownList6.DataTextField  = "Cntry_NmAr";
                DropDownList6.DataSource     = db.InvAstCntry.ToList();
                DropDownList6.DataBind();


                DropDownList7.DataValueField = "Pym_No";
                DropDownList7.DataTextField  = "Pym_Nmar";
                DropDownList7.DataSource     = db.LcPymwys.ToList();
                DropDownList7.DataBind();



                DropDownList1.DataValueField = "Curncy_No";
                DropDownList1.DataTextField  = "Curncy_Nmar";
                DropDownList1.DataSource     = db.InvAstCurncy.ToList();
                DropDownList1.DataBind();


                DropDownList2.DataValueField = "Curncy_No";
                DropDownList2.DataTextField  = "Curncy_Nmar";
                DropDownList2.DataSource     = db.InvAstCurncy.ToList();
                DropDownList2.DataBind();



                var id = int.Parse(Request.QueryString["no"]);
                var cn = db.MtsLC.Find(id);
                TextBox1.Text = cn.Doc_No.ToString();
                DropDownList3.SelectedValue = cn.Bank_No.ToString();
                TextBox3.Text = cn.Doc_Dt.ToString();
                //TextBox4.Text = cn.Doc_DtAr.ToString();
                DropDownList7.SelectedValue = cn.Pym_No.ToString();
                DropDownList4.SelectedValue = cn.Doc_No.ToString();
                TextBox7.Text = cn.StoreID.ToString();
                TextBox8.Text = cn.Pym_Terms;
                DropDownList5.SelectedValue = cn.Sup_No.ToString();
                DropDownList6.SelectedValue = cn.Cntry_No.ToString();
                TextBox12.Text = cn.Acc_Db.ToString();
                DropDownList1.SelectedValue = cn.Curncy_No1.ToString();
                DropDownList2.SelectedValue = cn.Curncy_No2.ToString();
                TextBox13.Text = cn.LC_FVAL.ToString();
                TextBox14.Text = cn.ExchangeRate1.ToString();
                TextBox15.Text = cn.LC_VAL.ToString();
                TextBox16.Text = cn.ReqQut_No;
                TextBox17.Text = cn.SupQut_No;
                TextBox18.Text = cn.LCExp_FVAL.ToString();
                TextBox19.Text = cn.ExchangeRate2.ToString();
                TextBox20.Text = cn.LCExp_VAL.ToString();
                TextBox21.Text = cn.ShiVia;
                TextBox22.Text = cn.Requesdt_By;
                TextBox23.Text = cn.Dlv_PLC;
                TextBox24.Text = cn.NoofItems.ToString();
                TextBox25.Text = cn.Used_By;
            }
        }
示例#28
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            Session["seq"] = Request.QueryString["seq"];
            //Session["seq"] = "30918";

            //Session["seq"] = "30840";

            #region offday


            string[] offday = { "日A", "日B", "夜A", "夜B", "常日" };

            TextBox_ARS_LINK.Text = "";

            RadioButtonList_OFFDAY.DataSource = offday;
            RadioButtonList_OFFDAY.DataBind();

            RadioButtonList_OFFDAY.SelectedValue = GetClass(today, todayHour);
            //RadioButtonList_OFFDAY.SelectedValue = "DB";

            #endregion


            #region rejudge_flag

            string[] rejudge_flag = { "Y", "N" };

            RadioButtonList1.DataSource = rejudge_flag;
            RadioButtonList1.DataBind();
            RadioButtonList1.SelectedValue = "N";
            #endregion


            #region CLOSE_FLAG

            string[] closeFlag = { "OPEN", "CLOSE" };

            RadioButtonList_CLOSE_FLAG.DataSource = rejudge_flag;
            RadioButtonList_CLOSE_FLAG.DataBind();
            RadioButtonList_CLOSE_FLAG.SelectedValue = "OPEN";
            #endregion


            #region ALARM_FLAG

            string[] alarmFlag = { "ON", "OFF" };

            RadioButtonList_ALARM_FLAG.DataSource = rejudge_flag;
            RadioButtonList_ALARM_FLAG.DataBind();
            RadioButtonList_ALARM_FLAG.SelectedValue = "OFF";
            #endregion


            #region ARS_FLAG

            string[] arsFlag = { "ON", "OFF" };

            RadioButtonList_ARS_FLAG.DataSource = rejudge_flag;
            RadioButtonList_ARS_FLAG.DataBind();
            RadioButtonList_ARS_FLAG.SelectedValue = "OFF";
            #endregion


            #region CLOSE_FLAG
            arlistTemp1 = func.FileToArray(Server.MapPath(".") + "\\config\\onduty_CLOSE_FLAG.txt");



            RadioButtonList_CLOSE_FLAG.DataSource = arlistTemp1;
            RadioButtonList_CLOSE_FLAG.DataBind();
            #endregion

            #region ALARM_FLAG
            arlistTemp1 = func.FileToArray(Server.MapPath(".") + "\\config\\onduty_ALARM_FLAG.txt");


            RadioButtonList_ALARM_FLAG.DataSource = arlistTemp1;
            RadioButtonList_ALARM_FLAG.DataBind();
            #endregion


            #region ARS_FLAG
            arlistTemp1 = func.FileToArray(Server.MapPath(".") + "\\config\\onduty_ARS_FLAG.txt");



            RadioButtonList_ARS_FLAG.DataSource = arlistTemp1;
            RadioButtonList_ARS_FLAG.DataBind();
            #endregion

            #region ENG_DEP
            arlistTemp1 = func.FileToArray(Server.MapPath(".") + "\\config\\onduty_ENG_DEP.txt");



            DropDownList_ENG_DEP.DataSource = arlistTemp1;
            DropDownList_ENG_DEP.DataBind();
            #endregion

            #region ENGINEER


            DropDownList_ENGINEER.Items.Insert(0, "請選擇");

            #endregion

            #region date

            txtEstimateCALLTIME.SelectedDate  = Convert.ToDateTime(today);
            txtEstimateSTARTTIME.SelectedDate = Convert.ToDateTime(today);
            txtEstimateEndTime.SelectedDate   = Convert.ToDateTime(today);



            #endregion


            #region hour
            arlistTemp1 = func.FileToArray(Server.MapPath(".") + "\\config\\hour.txt");



            DropDownList1.DataSource = arlistTemp1;
            DropDownList1.DataBind();
            DropDownList1.SelectedValue = todayHour;


            DropDownList3.DataSource = arlistTemp1;
            DropDownList3.DataBind();
            DropDownList3.SelectedValue = todayHour;


            DropDownList5.DataSource = arlistTemp1;
            DropDownList5.DataBind();
            DropDownList5.SelectedValue = todayHour;

            #endregion


            #region min
            arlistTemp1 = func.FileToArray(Server.MapPath(".") + "\\config\\min.txt");



            DropDownList2.DataSource = arlistTemp1;
            DropDownList2.DataBind();
            DropDownList2.SelectedValue = todayMin;



            DropDownList4.DataSource = arlistTemp1;
            DropDownList4.DataBind();
            DropDownList4.SelectedValue = todayMin;

            DropDownList6.DataSource = arlistTemp1;
            DropDownList6.DataBind();
            DropDownList6.SelectedValue = todayMin;

            #endregion


            #region fab
            arlistTemp1 = func.FileToArray(Server.MapPath(".") + "\\config\\onduty_fab.txt");



            DropDownList1_FAB.DataSource = arlistTemp1;
            DropDownList1_FAB.DataBind();
            DropDownList1_FAB.Items.Insert(0, "請選擇");



            #endregion


            #region SYSTEM
            arlistTemp1 = func.FileToArray(Server.MapPath(".") + "\\config\\onduty_fab_System.txt");



            DropDownList_SYSTEM.DataSource = arlistTemp1;
            DropDownList_SYSTEM.DataBind();
            DropDownList_SYSTEM.Items.Insert(0, "請選擇");



            #endregion

            #region TYPE
            arlistTemp1 = func.FileToArray(Server.MapPath(".") + "\\config\\onduty_fab_TYPE.txt");



            DropDownList_TYPE.DataSource = arlistTemp1;
            DropDownList_TYPE.DataBind();
            DropDownList_TYPE.Items.Insert(0, "請選擇");



            #endregion


            #region PRODUCT_IMPACT
            arlistTemp1 = func.FileToArray(Server.MapPath(".") + "\\config\\onduty_PRODUCT_IMPACT.txt");



            DropDownList_PRODUCT_IMPACT.DataSource = arlistTemp1;
            DropDownList_PRODUCT_IMPACT.DataBind();
            DropDownList_PRODUCT_IMPACT.Items.Insert(0, "請選擇");



            #endregion


            #region ASSIGN_OWNER
            arlistTemp1 = func.FileToArray(Server.MapPath(".") + "\\config\\onduty_CIM_MEMBER.txt");



            DropDownList_ASSIGN_OWNER.DataSource = arlistTemp1;
            DropDownList_ASSIGN_OWNER.DataBind();
            DropDownList_ASSIGN_OWNER.Items.Insert(0, "請選擇");



            #endregion

            #region BY_WHOM
            arlistTemp1 = func.FileToArray(Server.MapPath(".") + "\\config\\onduty_CIM_MEMBER.txt");



            DropDownList_BY_WHOM.DataSource = arlistTemp1;
            DropDownList_BY_WHOM.DataBind();
            DropDownList_BY_WHOM.Items.Insert(0, "請選擇");



            #endregion

            #region due_time
            Label1.Text = "0";
            #endregion



            // BindData1();

            #region hyperlink

            HyperLink hp = new HyperLink();
            hp = HyperLink_ARS_LINK;
            if (TextBox_ARS_LINK.Text.Trim() != null)
            {
                hp.NavigateUrl = TextBox_ARS_LINK.Text;
                hp.Target      = "_blank";
            }

            #endregion
        }
    }
示例#29
0
 protected void LinkButton3_Click(object sender, EventArgs e)
 {
     MultiView1.ActiveViewIndex = 2;
     DropDownList1.DataBind();
 }
示例#30
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            DataTable dt = new DataTable();
            int       i  = 0;



            try
            {
                type = Request.QueryString["type"].ToString();
            }
            catch
            { }
            feidaoru.Visible = true;
            daoru.Visible    = false;
            if (type == "daoru")
            {
                feidaoru.Visible = false;
                daoru.Visible    = true;
            }
            else if (type == "0")
            {
                my_c.genxin("update " + ConfigurationSettings.AppSettings["Prefix"].ToString() + "collect set u18=1 where id=" + Request.QueryString["id"].ToString());
                Response.Redirect("err.aspx?err=为零采集项目成功!马上跳转到采集项目列表页面!&errurl=" + my_b.tihuan("collect_list.aspx", "&", "fzw123") + "");
            }
            else if (type == "edit")
            {
                dt = my_c.GetTable("select * from " + ConfigurationSettings.AppSettings["Prefix"].ToString() + "collect where id=" + Request.QueryString["id"].ToString());
                string u1  = dt.Rows[0]["u1"].ToString();
                string u2  = dt.Rows[0]["u2"].ToString();
                string u3  = dt.Rows[0]["u3"].ToString();
                string u4  = dt.Rows[0]["u4"].ToString();
                string u5  = dt.Rows[0]["u5"].ToString();
                string u6  = dt.Rows[0]["u6"].ToString();
                string u7  = dt.Rows[0]["u7"].ToString();
                string u8  = dt.Rows[0]["u8"].ToString();
                string u9  = dt.Rows[0]["u9"].ToString();
                string u10 = dt.Rows[0]["u10"].ToString();
                string u11 = dt.Rows[0]["u11"].ToString();
                string u12 = dt.Rows[0]["u12"].ToString();
                string u13 = dt.Rows[0]["u13"].ToString();
                string u14 = dt.Rows[0]["u14"].ToString();
                string u15 = dt.Rows[0]["u15"].ToString();
                string u16 = dt.Rows[0]["u16"].ToString();
                string u17 = dt.Rows[0]["u17"].ToString();
                string u19 = dt.Rows[0]["u19"].ToString();
                if (u4 == "批量指定分页URL代码")
                {
                    set_1 = "";
                }
                this.TextBox1.Text = u1;
                for (i = 0; i < RadioButtonList1.Items.Count; i++)
                {
                    if (RadioButtonList1.Items[i].Value == u2)
                    {
                        RadioButtonList1.Items[i].Selected = true;
                    }
                }
                this.TextBox2.Text  = u3;
                this.TextBox19.Text = u19;
                for (i = 0; i < RadioButtonList2.Items.Count; i++)
                {
                    if (RadioButtonList2.Items[i].Value == u4)
                    {
                        RadioButtonList2.Items[i].Selected = true;
                    }
                }
                this.TextBox3.Text = u5;
                Regex    reg = new Regex("{fzw:Field}", RegexOptions.Singleline);
                string[] aa  = reg.Split(u6);
                try
                {
                    this.TextBox4.Text = aa[0].ToString();
                    this.TextBox5.Text = aa[1].ToString();
                }
                catch
                { }
                this.TextBox6.Text = u7;
                this.TextBox7.Text = u8;
                this.TextBox8.Text = u9;
                this.TextBox9.Text = u10;

                DropDownList1.DataSource     = my_c.GetTable("select * from " + ConfigurationSettings.AppSettings["Prefix"].ToString() + "Model order by id");
                DropDownList1.DataTextField  = "u2";
                DropDownList1.DataValueField = "id";
                DropDownList1.DataBind();
                for (i = 0; i < DropDownList1.Items.Count; i++)
                {
                    if (DropDownList1.Items[i].Value == u11)
                    {
                        DropDownList1.Items[i].Selected = true;
                    }
                }

                if (DropDownList1.SelectedItem.Value == "")
                {
                    Response.Redirect("err.aspx?err=模型不可以为空!&errurl=" + my_b.tihuan("Model.aspx", "&", "fzw123") + "");
                }
                dr1("0", 0, DropDownList1.SelectedItem.Value);

                for (i = 0; i < DropDownList2.Items.Count; i++)
                {
                    if (DropDownList2.Items[i].Value == u17)
                    {
                        DropDownList2.Items[i].Selected = true;
                    }
                }
                Regex    reg1 = new Regex("{fzw:che}", RegexOptions.Singleline);
                string[] bb   = reg1.Split(u13);
                try
                {
                    Regex    reg2 = new Regex("{fzw:Field}", RegexOptions.Singleline);
                    string[] cc   = reg2.Split(bb[0].ToString());
                    this.TextBox10.Text = cc[0].ToString();
                    this.TextBox11.Text = cc[1].ToString();

                    Regex    reg3 = new Regex("{fzw:Field}", RegexOptions.Singleline);
                    string[] dd   = reg3.Split(bb[1].ToString());
                    this.TextBox12.Text = dd[0].ToString();
                    this.TextBox13.Text = dd[1].ToString();

                    Regex    reg4 = new Regex("{fzw:Field}", RegexOptions.Singleline);
                    string[] ee   = reg4.Split(bb[2].ToString());
                    this.TextBox14.Text = ee[0].ToString();
                    this.TextBox15.Text = ee[1].ToString();
                }
                catch
                { }

                Regex    reg5 = new Regex("{fzw:che}", RegexOptions.Singleline);
                string[] ff   = reg5.Split(u12);

                dt          = my_c.GetTable("select u2,id from " + ConfigurationSettings.AppSettings["Prefix"].ToString() + "Field where Model_id=" + DropDownList1.SelectedItem.Value + " order by u9 , id");
                Label3.Text = set_che(u12, dt);
                Label4.Text = set_5(u12, u11);



                dt = my_c.GetTable("select * from " + ConfigurationSettings.AppSettings["Prefix"].ToString() + "Parameter where classid=15");
                string t1 = "";
                for (i = 0; i < dt.Rows.Count; i++)
                {
                    if (u14.IndexOf(dt.Rows[i]["id"].ToString()) > -1)
                    {
                        t1 = t1 + "<input type=\"checkbox\" name=\"che_html\" value=\"" + dt.Rows[i]["id"].ToString() + "\"  checked=\"checked\"/><span>" + dt.Rows[i]["u1"].ToString() + "</span><br>";
                    }
                    else
                    {
                        t1 = t1 + "<input type=\"checkbox\" name=\"che_html\" value=\"" + dt.Rows[i]["id"].ToString() + "\" /><span>" + dt.Rows[i]["u1"].ToString() + "</span><br>";
                    }
                }
                Label7.Text = t1;


                for (i = 0; i < CheckBoxList2.Items.Count; i++)
                {
                    if (u15.IndexOf(CheckBoxList2.Items[i].Value) > -1)
                    {
                        CheckBoxList2.Items[i].Selected = true;
                    }
                    else
                    {
                        CheckBoxList2.Items[i].Selected = false;
                    }
                }
                for (i = 0; i < RadioButtonList3.Items.Count; i++)
                {
                    if (RadioButtonList3.Items[i].Value == u16)
                    {
                        RadioButtonList3.Items[i].Selected = true;
                    }
                }
            }
            else if (type == "del")
            {
                my_c.genxin("delete from " + ConfigurationSettings.AppSettings["Prefix"].ToString() + "collect where id in(" + Request.QueryString["id"].ToString() + ")");
                Response.Redirect("err.aspx?err=删除采集项目成功!马上跳转到采集项目列表页面!&errurl=" + my_b.tihuan("collect_list.aspx", "&", "fzw123") + "");
            }
            else if (type == "copy")
            {
                dt = my_c.GetTable("select * from " + ConfigurationSettings.AppSettings["Prefix"].ToString() + "collect where id=" + Request.QueryString["id"].ToString());
                my_c.genxin("insert into " + ConfigurationSettings.AppSettings["Prefix"].ToString() + "collect (u1,u2,u3,u4,u5,u6,u7,u8,u9,u10,u11,u12,u13,u14,u15,u16,u17,u18,u19) values('重命名_" + my_b.c_string(dt.Rows[0]["u1"].ToString()) + "','" + my_b.c_string(dt.Rows[0]["u2"].ToString()) + "','" + my_b.c_string(dt.Rows[0]["u3"].ToString()) + "','" + my_b.c_string(dt.Rows[0]["u4"].ToString()) + "','" + my_b.c_string(dt.Rows[0]["u5"].ToString()) + "','" + my_b.c_string(dt.Rows[0]["u6"].ToString()) + "','" + my_b.c_string(dt.Rows[0]["u7"].ToString()) + "','" + my_b.c_string(dt.Rows[0]["u8"].ToString()) + "','" + my_b.c_string(dt.Rows[0]["u9"].ToString()) + "','" + my_b.c_string(dt.Rows[0]["u10"].ToString()) + "','" + my_b.c_string(dt.Rows[0]["u11"].ToString()) + "','" + my_b.c_string(dt.Rows[0]["u12"].ToString()) + "','" + my_b.c_string(dt.Rows[0]["u13"].ToString()) + "','" + my_b.c_string(dt.Rows[0]["u14"].ToString()) + "','" + my_b.c_string(dt.Rows[0]["u15"].ToString()) + "','" + my_b.c_string(dt.Rows[0]["u16"].ToString()) + "','" + my_b.c_string(dt.Rows[0]["u17"].ToString()) + "'," + my_b.c_string(dt.Rows[0]["u18"].ToString()) + ",'" + my_b.c_string(dt.Rows[0]["u19"].ToString()) + "')");
                Response.Redirect("err.aspx?err=复制采集项目成功!马上跳转到采集项目列表页面!&errurl=" + my_b.tihuan("collect_list.aspx", "&", "fzw123") + "");
            }
            else
            {
                DropDownList1.DataSource     = my_c.GetTable("select * from " + ConfigurationSettings.AppSettings["Prefix"].ToString() + "Model where u3 like '文章模型' order by id");
                DropDownList1.DataTextField  = "u2";
                DropDownList1.DataValueField = "id";
                DropDownList1.DataBind();

                if (DropDownList1.SelectedItem.Value == "")
                {
                    Response.Redirect("err.aspx?err=模型不可以为空!&errurl=" + my_b.tihuan("Model.aspx", "&", "fzw123") + "");
                }
                dr1("0", 0, DropDownList1.SelectedItem.Value);

                dt = my_c.GetTable("select u2,id from " + ConfigurationSettings.AppSettings["Prefix"].ToString() + "Field where Model_id=" + DropDownList1.SelectedItem.Value + " order by u9 , id");
                string t1 = "";
                for (i = 0; i < dt.Rows.Count; i++)
                {
                    if (i > 0)
                    {
                        if (i % 6 == 0)
                        {
                            t1 = t1 + "<br>";
                        }
                    }

                    t1 = t1 + "<input type=\"checkbox\" name=\"che_Fields\" value=\"" + dt.Rows[i]["u2"].ToString() + "\" /><span>" + dt.Rows[i]["u2"].ToString() + "</span><span style='display:none' id='div_Fields" + i.ToString() + "'>" + dt.Rows[i]["id"].ToString() + "</span>&nbsp;&nbsp;";
                }
                Label3.Text = t1;

                dt = my_c.GetTable("select * from " + ConfigurationSettings.AppSettings["Prefix"].ToString() + "Parameter where classid=15");
                t1 = "";
                for (i = 0; i < dt.Rows.Count; i++)
                {
                    t1 = t1 + "<input type=\"checkbox\" name=\"che_html\" value=\"" + dt.Rows[i]["id"].ToString() + "\" /><span>" + dt.Rows[i]["u1"].ToString() + "</span><br>";
                }
                Label7.Text = t1;
            }
        }
    }