protected void Button3_Click(object sender, EventArgs e)
        {
            SqlConnection myconnection = new SqlConnection();

            myconnection.ConnectionString = "data source=MYCOMPUTER\\DBSERVER;" + "initial catalog=광운대서점;" + "user id=LSR;" + "password=thtlf!";
            myconnection.Open();
            SqlCommand cmd = new SqlCommand();

            cmd.Connection = myconnection;

            cmd.CommandText = "select 마일리지 from 멤버 where 회원아이디 ='" + this.Label1.Text + "'";
            cmd.CommandType = CommandType.Text;
            int num = Convert.ToInt32(cmd.ExecuteScalar().ToString());

            if (Convert.ToInt32(TextBox6.Text) > num)
            {
                MessageBox.Show("마일리지 초과!");
                TextBox6.Text = "";
                TextBox6.Focus();
                return;
            }
            else
            {
                MessageBox.Show("마일리지 사용 가능합니다");
                Label2.Text = TextBox6.Text;
            }
        }
Пример #2
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     //sql = "Select * From receipt where name = '" + TextBox2.Text + "' and number = '" + TextBox3.Text + "'";
     Label4.Visible   = Label5.Visible = Label6.Visible = Label7.Visible = Label8.Visible = Label9.Visible = true;
     TextBox5.Visible = TextBox6.Visible = TextBox7.Visible = TextBox8.Visible = TextBox9.Visible = true;
     RequiredFieldValidator5.Visible = RequiredFieldValidator6.Visible = RequiredFieldValidator7.Visible = RequiredFieldValidator8.Visible = RequiredFieldValidator9.Visible = true;
     RequiredFieldValidator5.Visible = true;
     Button2.Visible = true;
     Label4.Text     = " Enter new  receipt";
     Label5.Text     = " Name: ";
     TextBox5.Focus();
     RequiredFieldValidator5.ControlToValidate = "TextBox5";
     RequiredFieldValidator5.ErrorMessage      = "* fill Name";
     Label6.Text = " Company: ";
     TextBox6.Focus();
     RequiredFieldValidator6.ControlToValidate = "TextBox6";
     RequiredFieldValidator6.ErrorMessage      = "* fill Company";
     Label7.Text = " Number: ";
     TextBox7.Focus();
     RequiredFieldValidator7.ControlToValidate = "TextBox7";
     RequiredFieldValidator7.ErrorMessage      = "* fill Number";
     Label8.Text = " Arrears: ";
     TextBox8.Focus();
     RequiredFieldValidator8.ControlToValidate = "TextBox8";
     RequiredFieldValidator8.ErrorMessage      = "* fill Arrears";
     Label9.Text = " Suma: ";
     TextBox9.Focus();
     RequiredFieldValidator9.ControlToValidate = "TextBox9";
     RequiredFieldValidator9.ErrorMessage      = "* fill Suma";
     Button2.Text = "Ready ";
 }
Пример #3
0
        public MainWindow()
        {
            InitializeComponent();
            TextBox1.SetBinding(TextBox.TextProperty, new Binding("[0]")
            {
                Source = mode.NamesList, Mode = BindingMode.OneWay
            });
            TextBox2.SetBinding(TextBox.TextProperty, new Binding("[2]")
            {
                Source = mode.NamesList, Mode = BindingMode.OneWay
            });
            TextBox3.SetBinding(TextBox.TextProperty, new Binding("[2].Length")
            {
                Source = mode.NamesList, Mode = BindingMode.OneWay
            });

            TextBox4.SetBinding(TextBox.TextProperty, new Binding("[0]")
            {
                Source = mode.Ctry.Province[0].City[0].Person[0].name, Mode = BindingMode.OneWay
            });
            TextBox5.SetBinding(TextBox.TextProperty, new Binding("[1]")
            {
                Source = mode.Ctry.Province[0].City[0].Person[0].name, Mode = BindingMode.OneWay
            });
            TextBox6.SetBinding(TextBox.TextProperty, new Binding("[2]")
            {
                Source = mode.Ctry.Province[0].City[0].Person[0].name, Mode = BindingMode.OneWay
            });
        }
Пример #4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     Page.Title       = "Insert";
     Page.Form.Method = "post";
     Label1.Text      = "Add a receipt ";
     Label2.Text      = "Name"; Label3.Text = "Company";
     Label4.Text      = "Number"; Label5.Text = "Arrears";
     Label6.Text      = "Suma";
     TextBox2.Focus();
     TextBox3.Focus();
     TextBox4.Focus();
     TextBox5.Focus();
     TextBox6.Focus();
     Button1.Text   = "Ready";
     Button1.Width  = 125;
     TextBox2.Width = 140;
     RequiredFieldValidator2.ControlToValidate = "TextBox2";
     RequiredFieldValidator2.ErrorMessage      = "* fill Name";
     RequiredFieldValidator3.ControlToValidate = "TextBox3";
     RequiredFieldValidator3.ErrorMessage      = "* fill Company ";
     RequiredFieldValidator4.ControlToValidate = "TextBox4";
     RequiredFieldValidator4.ErrorMessage      = "* fill  Number";
     RequiredFieldValidator5.ControlToValidate = "TextBox5";
     RequiredFieldValidator5.ErrorMessage      = "* fill Arrears";
     RequiredFieldValidator6.ControlToValidate = "TextBox6";
     RequiredFieldValidator6.ErrorMessage      = "* fill Suma";
 }
 private void limpar()
 {
     txtdescricao.Clear(); txtprecouni.Clear(); txtquant.Clear(); txttotal.Clear(); buscprods.Clear();
     comboBox2.SelectedIndex = -1; txtcli.Clear(); cbmfmpg.SelectedIndex = -1; textBox3.Clear();
     TextBox6.Clear(); TextBox7.Clear(); txtvalortotal.Clear();
     datalistado.Rows.Clear();
 }
Пример #6
0
 private void klient_furnitor_Load(object sender, EventArgs e)
 {
     textBox7.Focus();
     rifreskoDG();
     TextBox6.Focus();
     rifreskoDG_klient();
 }
Пример #7
0
 void get_totamt()
 {
     if (TextBox4.Text != "" && TextBox5.Text != "")
     {
         decimal pel_amt = decimal.Parse(TextBox4.Text) - (decimal.Parse(TextBox1.Text.Replace("(", "-").Replace(")", "")));
         TextBox6.Text = double.Parse(Convert.ToString(pel_amt)).ToString("C").Replace("RM", "").Replace("$", "");
         TextBox6.Focus();
     }
 }
Пример #8
0
 private void limpiar()
 {
     TextBox1.Clear();
     TextBox4.Clear();
     textBox5.Clear();
     TextBox6.Clear();
     TextBox7.Clear();
     TextBox3.Clear();
 }
 protected void ontext1(object sender, EventArgs e)
 {
     for (int i = 0; i < GridView1.Rows.Count; i++)
     {
         System.Web.UI.WebControls.CompareValidator cv = (System.Web.UI.WebControls.CompareValidator)GridView1.Rows[i].FindControl("CompareValidator9");
         cv.ValueToCompare = TextBox5.Text;
         // MessageBox.Show(cv.ValueToCompare);
     }
     TextBox6.Focus();
 }
Пример #10
0
 public void ClearTextBoxes()
 {
     TextBox1.Clear();
     TextBox2.Clear();
     TextBox3.Clear();
     TextBox4.Clear();
     TextBox5.Clear();
     TextBox6.Clear();
     TextBox7.Clear();
     TextBox8.Clear();
     TextBoxID.Clear();
 }
Пример #11
0
 private void TextBox6_Leave(object sender, EventArgs e)
 {
     if (TextBox6.Text == "")
     {
         EP.SetError(TextBox6, "Fill the Blank Text first");
         TextBox6.Focus();
     }
     else
     {
         EP.Clear();
     }
 }
Пример #12
0
        protected void ImageButton1_Click(object sender, ImageClickEventArgs e)

        {
            bool flag = true;

            string confrim_value = Request.Form["Confirm_Value"];

            if ((TextBox4.Text == ""))
            {
                Response.Write("<script>alert('Problem Cannot be Blank')</script>");
                TextBox4.Focus();
                flag = false;
            }

            if ((TextBox6.Text == ""))

            {
                Response.Write("<script>alert('Received Date Cannot be Blank')</script>");
                TextBox6.Focus();
                flag = false;
            }



            if ((confrim_value == "YES") && (flag == true))
            {
                int    Ref_No    = Int32.Parse(TextBox1.Text);
                string Rec_Date  = Calendar1.SelectedDate.ToShortDateString();
                string Prob_Desc = TextBox4.Text;
                string Type      = DropDownList2.SelectedItem.Text;
                string Remarks   = TextBox3.Text;
                string Req_Name  = TextBox2.Text;
                string Com_Type  = DropDownList3.SelectedValue.ToString();

                bl c = new bl();

                if (c.addsrvreq(Ref_No, Rec_Date, Req_Name, Prob_Desc, Type, Com_Type, Remarks))
                {
                    Response.Write("<script> alert('Record Updated Successfully')</script>");
                    Response.Redirect("WebForm1.aspx");
                }

                else
                {
                    Response.Write("<script> alert('Update Unsuccessful')</script>");
                }
            }
            if (flag == false)
            {
                Response.Write("<script> alert('Update Unsuccessful')</script>");
            }
        }
 private void button2_Click(object sender, EventArgs e)
 {
     datalistado.Rows.Clear();
     txtvalortotal.Clear();
     txtdescricao.Clear();
     txtprecouni.Clear();
     txtquant.Clear();
     txttotal.Clear();
     txtvalortotal.Clear();
     buscprods.Clear();
     textBox3.Clear();
     TextBox6.Clear();
     TextBox7.Clear();
 }
Пример #14
0
 protected void Button2_Click(object sender, EventArgs e)
 {
     TextBox1.Text = "";
     TextBox2.Text = "";
     TextBox3.Text = "";
     TextBox4.Text = "";
     TextBox5.Text = "";
     TextBox6.Text = "";
     TextBox1.Focus();
     TextBox2.Focus();
     TextBox3.Focus();
     TextBox4.Focus();
     TextBox5.Focus();
     TextBox6.Focus();
 }
Пример #15
0
 private void Button3_Click(object sender, EventArgs e)
 {
     TextBox1.Clear();
     TextBox2.Clear();
     TextBox3.Clear();
     TextBox4.Clear();
     TextBox5.Clear();
     TextBox6.Clear();
     TextBox7.Clear();
     TextBox8.Clear();
     TextBox9.Clear();
     ComboBox1.Items.Clear();
     RadioButton1.Checked = false;
     RadioButton2.Checked = false;
 }
        protected void Button1_Click(object sender, EventArgs e)
        {
            try
            {
                Service1Client servicio       = new Service1Client();
                USUARIO        ObjUsuario     = new USUARIO();
                USUARIO        ObjUsuarioDesp = new USUARIO();


                ObjUsuario.NOMBRE            = GridView1.SelectedRow.Cells[1].Text.ToString();
                ObjUsuario.APELLIDO          = GridView1.SelectedRow.Cells[2].Text.ToString();
                ObjUsuario.IDENTIFICACION    = GridView1.SelectedRow.Cells[3].Text.ToString();
                ObjUsuario.EMAIL             = Convert.ToString(GridView1.SelectedRow.Cells[4].Text);
                ObjUsuario.TELEFONO_PERSONAL = Convert.ToString(GridView1.SelectedRow.Cells[5].Text);
                ObjUsuario.TELEFONO_OFICINA  = Convert.ToString(GridView1.SelectedRow.Cells[6].Text);
                ObjUsuario.ID_OFICINA        = Convert.ToInt32(GridView1.SelectedRow.Cells[7].Text);
                ObjUsuario.ID_PERFIL         = Convert.ToInt32(GridView1.SelectedRow.Cells[8].Text);



                if (TextBox1.Text.ToString() != null && TextBox2.Text.ToString() != null &&
                    TextBox3.Text.ToString() != null && TextBox4.Text.ToString() != null &&
                    TextBox5.Text.ToString() != null && TextBox6.Text.ToString() != null &&
                    TextBox7.Text.ToString() != null && TextBox8.Text.ToString() != null)
                {
                    ObjUsuarioDesp.NOMBRE            = TextBox2.Text.ToString();
                    ObjUsuarioDesp.APELLIDO          = TextBox3.Text.ToString();
                    ObjUsuarioDesp.IDENTIFICACION    = TextBox4.Text.ToString();
                    ObjUsuarioDesp.EMAIL             = TextBox5.Text.ToString();
                    ObjUsuarioDesp.TELEFONO_PERSONAL = TextBox6.ToString();
                    ObjUsuarioDesp.TELEFONO_OFICINA  = TextBox7.Text.ToString();
                    ObjUsuarioDesp.ID_OFICINA        = Convert.ToInt32(TextBox8.Text);
                    ObjUsuario.ID_PERFIL             = Convert.ToInt32(DropDownList1.Text);



                    servicio.modificarUsuario(ObjUsuario, ObjUsuarioDesp);
                    servicio.borrarUsuario(ObjUsuario);
                    Response.Redirect("AdminUsuariosAdm.aspx");
                }
            }
            catch (Exception error)
            {
                Response.Write(error);
                Response.Redirect("AdminUsuariosAdm.aspx");
                throw error;
            }
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            Button1.Style.Add("display", "none");
            update.Visible     = true;
            TextBox1.Visible   = true;
            TextBox2.Visible   = true;
            TextBox3.Visible   = true;
            TextBox4.Visible   = true;
            TextBox5.Visible   = true;
            TextBox6.Visible   = true;
            TextBox7.Visible   = true;
            TextBox8.Visible   = true;
            userName.Visible   = false;
            fullName.Visible   = false;
            phoneNo.Visible    = false;
            email.Visible      = false;
            address.Visible    = false;
            role.Visible       = false;
            salary.Visible     = false;
            department.Visible = false;

            string s = Request.QueryString["id"];

            if (s != null)
            {
                string        connstring = ConfigurationManager.ConnectionStrings["DBCS"].ConnectionString;
                string        sql        = "select * from userTable where id=" + s;
                SqlConnection conn       = new SqlConnection(connstring);
                SqlCommand    cmd        = new SqlCommand(sql, conn);
                conn.Open();
                SqlDataReader reader = cmd.ExecuteReader();
                if (reader.Read())
                {
                    TextBox1.Text = reader["userName"].ToString();
                    TextBox2.Text = reader["fullName"].ToString();
                    TextBox3.Text = reader["phoneNumber"].ToString();
                    TextBox4.Text = reader["email"].ToString();
                    TextBox5.Text = reader["address"].ToString();
                    TextBox6.ClearSelection();
                    TextBox6.Items.FindByValue(reader["type"].ToString()).Selected = true;
                    TextBox7.Text = reader["departmentId"].ToString();
                    TextBox8.Text = reader["salary"].ToString();
                }
            }

            //
            //TextBox6.Items.FindByValue("Admin").Selected = true;
        }
Пример #18
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Button3.Visible = true;
        if (Session["username"] == null)
        {
            Response.Redirect("~/Default.aspx");
        }
        else
        {
            Button3.Visible = true;
        }

        if (con.State != ConnectionState.Open)
        {
            con.Open();

            if (Page.IsPostBack)
            {
                if (!(TextBox2.Text == ""))
                {
                    if (con.State != ConnectionState.Open)
                    {
                        con.Open();
                    }
                    string query = "select * from Train where train_no='" + TextBox2.Text + "'";
                    trainscmd = new SqlCommand(query, con);
                    trainsda  = new SqlDataAdapter(trainscmd);
                    DataTable dt = new DataTable();
                    trainsda.Fill(dt);
                    TextBox3.Text  = dt.Rows[0]["train_name"].ToString();
                    TextBox4.Text  = dt.Rows[0]["source_stn"].ToString();
                    TextBox7.Text  = dt.Rows[0]["dest_stn"].ToString();
                    TextBox9.Text  = dt.Rows[0]["arrl_day"].ToString();
                    TextBox5.Text  = dt.Rows[0]["arrl_time"].ToString();
                    TextBox10.Text = dt.Rows[0]["dep_day"].ToString();
                    TextBox6.Text  = dt.Rows[0]["dep_time"].ToString();

                    object o = dt.Rows[0]["total_seat"];
                    totalseat = Convert.ToInt32(o);
                    object o1 = dt.Rows[0]["avail_seat"];
                    availseats = Convert.ToInt32(o1);
                    TextBox6.Focus();
                }
            }
        }
    }
        private void TextBox5_PreviewTextInput(object sender, TextCompositionEventArgs e)
        {
            char c = Convert.ToChar(e.Text);

            if (Char.IsControl(c))
            {
                TextBox6.Focus();
                return;
            }
            if (Char.IsSurrogate(c) || Char.IsDigit(c))
            {
                e.Handled = false;
            }
            else
            {
                e.Handled = true;
            }
        }
Пример #20
0
        /// <summary>
        /// ao mudar de grupo selecionado ele coloca as permissões e arruma a toolbar de acordo com o grupo escolhido
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void ChangedGroup()
        {
            try
            {
                if (CurrentGroup != null && (bool)CurrentGroup.Fields["IsAdmin"].Value)
                {
                    LoginGroupItem item = vgMembership.GetGroupByID(ListBox3.SelectedItem.Value);

                    if ((bool)item.Fields["IsAdmin"].Value)
                    {
                        ListBox4.Enabled  = false;
                        CheckBox5.Enabled = false;
                        CheckBox3.Enabled = false;
                        CheckBox4.Enabled = false;
                        CheckBox2.Enabled = false;
                        CheckBox5.Checked = false;
                        CheckBox3.Checked = false;
                        CheckBox4.Checked = false;
                        CheckBox2.Checked = false;
                        EnableGroupButtons(false, false, false, true);

                        CheckBox1.Checked = true;
                        TextBox6.Text     = Crypt.Decripta(item.Fields["Name"].GetFormattedValue());
                        TextBox6.Focus();
                    }
                    else
                    {
                        ListBox4.Enabled  = true;
                        CheckBox5.Enabled = false;
                        CheckBox3.Enabled = false;
                        CheckBox4.Enabled = false;
                        CheckBox2.Enabled = false;
                        EnableGroupButtons(true, true, true, true);
                        TextBox6.Text     = Crypt.Decripta(item.Fields["Name"].GetFormattedValue());
                        CheckBox1.Checked = (bool)item.Fields["IsAdmin"].Value;
                        TextBox6.Focus();
                        ChangedPagesPermission();
                    }
                }
            }
            catch
            {
            }
        }
Пример #21
0
        protected void Button3_Click(object sender, EventArgs e)
        {
            int can = 0;

            SqlDataSource1.InsertParameters["Nombre"].DefaultValue          = TextBox6.Text;
            SqlDataSource1.InsertParameters["NombreAbreviado"].DefaultValue = TextBox1.Text;
            can = SqlDataSource1.Insert();
            if (can == 1)
            {
                Response.Write("<script>alert('Se Guardo con Exito')</script>");
                TextBox6.Text = "";
                TextBox1.Text = "";
                TextBox6.Focus();
            }
            else
            {
                Response.Write("<script>alert('Error, No se  Guardo')</script>");
            }
        }
Пример #22
0
 private void InsertGroup()
 {
     try
     {
         if (CurrentGroup != null && (bool)CurrentGroup.Fields["IsAdmin"].Value)
         {
             ViewState["Insert"] = true;
             TextBox6.Enabled    = true;
             EnableGroupButtons(true, true, false, false);
             ListBox3.Enabled = false;
             TextBox6.Focus();
             TextBox6.Text     = "";
             CheckBox1.Checked = false;
         }
     }
     catch
     {
     }
 }
Пример #23
0
 private void Button2_Click(object sender, EventArgs e)
 {
     TextBox1.Clear();
     TextBox2.Clear();
     TextBox3.Clear();
     TextBox4.Clear();
     TextBox5.Clear();
     TextBox6.Clear();
     TextBox7.Clear();
     TextBox8.Clear();
     TextBox9.Clear();
     TextBox10.Clear();
     ComboBox1.Text       = "Selecione...";
     ComboBox2.Text       = "Selecione...";
     CheckBox1.Checked    = false;
     CheckBox2.Checked    = false;
     CheckBox3.Checked    = false;
     RadioButton1.Checked = false;
     RadioButton2.Checked = false;
     TextBox1.Focus();
 }
Пример #24
0
        protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
        {
            HttpContext.Current.Server.ScriptTimeout = 600;
            Server.ScriptTimeout = 500;
            bool flag = true;

            string confrim_value = Request.Form["Confirm_Value"];

            if (TextBox4.Text == "")
            {
                Response.Write("<script>alert('Problem Cannot be Blank')</script>");
                TextBox4.Focus();
                flag = false;
            }

            if (TextBox6.Text == "")
            {
                Response.Write("<script>alert('Received Date Cannot be Blank')</script>");
                TextBox6.Focus();
                flag = false;
            }

            if (TextBox7.Text == "")
            {
                Response.Write("<script>alert('Requestor Email Cannot be Blank</script>");
                TextBox7.Focus();
                flag = false;
            }

            if ((TextBox8.Text == "") && (TextBox9.Text == ""))
            {
                Response.Write("<script>alert('TimeEntries cannot be Blank')</script>");
                TextBox4.Focus();
                flag = false;
            }

            if ((confrim_value == "YES") && (flag == true) && (CheckBox1.Checked == true))
            {
                int      Ref_No = Int32.Parse(TextBox1.Text);
                DateTime rec_da = System.DateTime.Now;
                if ((TextBox8.Text == "") || (TextBox9.Text == ""))
                {
                    TextBox8.Text = "00";
                    TextBox9.Text = "00";
                }
                string condate  = TextBox6.Text + " " + TextBox8.Text + ":" + TextBox9.Text + ":" + "00";
                string Rec_Date = Convert.ToDateTime(condate).ToString("yyyy/MM/dd HH:mm:ss");

                string   Prob_Desc     = TextBox4.Text;
                string   Type          = DropDownList2.SelectedItem.Text;
                string   Remarks       = DropDownList6.SelectedItem.Value;
                string   Req_Name      = TextBox2.Text;
                string   Com_Type      = DropDownList3.SelectedItem.Text;
                string   Req_Email     = TextBox7.Text;
                string   Req_Status    = DropDownList4.SelectedItem.Text;
                string   Act_Email     = DropDownList5.SelectedItem.Text;
                string   khidmat2      = ddlType.SelectedItem.Text;
                DateTime Escalate_Date = DateTime.Now;
                bool     msgflag       = false;

                bl c = new bl();
                try
                {
                    bool stat = c.addsrvreq(Ref_No, Rec_Date, Req_Name, Prob_Desc, Type, Com_Type, Req_Email, Req_Status, Remarks, Act_Email, khidmat2, Escalate_Date);
                    stat    = c.addsrvreq1(Ref_No, Rec_Date, Req_Name, Prob_Desc, Type, Com_Type, Req_Email, Req_Status, Remarks, Act_Email, khidmat2, Escalate_Date);
                    msgflag = true;
                }


                catch
                {
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "myscript", "alert('Request Couldnt Be Added Try Again')", true);
                }

                if (msgflag)
                {
                    Response.Write("<script>alert('Request Added Successfully');</script>");
                }

                //if (Com_Type != "CONFIGMGMT")

                //{
                //    //email to buswani
                //    string email = "*****@*****.**";
                //    System.Net.Mail.MailMessage message3 = new System.Net.Mail.MailMessage();
                //    message3.To.Add(email);
                //    message3.Subject = "Mail from IT Help Desk";
                //    message3.From = new System.Net.Mail.MailAddress("*****@*****.**");
                //    message3.Body = "Dear       : Mr. Buswani  "
                //    + Environment.NewLine
                //    + Environment.NewLine
                //    + "IT Request Received from :   " + Req_Name + "    on this Date   :" + System.DateTime.Today.ToShortDateString()
                //    + Environment.NewLine
                //    + Environment.NewLine
                //    + "Category         :  " + Type +
                //    Environment.NewLine
                //    + "Reference No     :  " + Ref_No +
                //    Environment.NewLine +
                //    "Problem Desc      :  " + Prob_Desc
                //    + Environment.NewLine
                //    + Environment.NewLine
                //    + "Thank you."
                //    + Environment.NewLine
                //    + "Regards"
                //    + Environment.NewLine
                //    + "AeroLogica Sdn Bhd  "
                //    + Environment.NewLine
                //    + "Tel No: 03 -7846 5112    Ext No: 273 / 314 /317  ";
                //    System.Net.Mail.SmtpClient smtp3 = new System.Net.Mail.SmtpClient("128.2.11.11");
                //    smtp3.Port = 25;

                //    smtp3.Send(message3);
                //    //end of buswani mail message
                //}

                //Response.Cookies[cookname] ["date"]  =Convert.ToString(System.DateTime.Now);
                System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage();
                message.To.Add(Act_Email);
                message.Subject = "Mail from IT Help Desk";
                message.From    = new System.Net.Mail.MailAddress("*****@*****.**");
                if (g.fileName != "")
                {
                    System.Net.Mail.Attachment attach = new System.Net.Mail.Attachment(Server.MapPath((@"~/" + g.fileName)));
                    message.Attachments.Add(attach);
                }

                message.Body = "Problem Description :  " + Prob_Desc +
                               Environment.NewLine
                               + "Reference No         :  " + Ref_No +
                               Environment.NewLine
                               + Environment.NewLine
                               + "Service Request Type :  " + khidmat2 +
                               Environment.NewLine
                               + Environment.NewLine
                               + "Company Name          :  " + Com_Type +
                               Environment.NewLine
                               + Environment.NewLine
                               + "Sent by               :  " + Req_Name +
                               Environment.NewLine
                               + "on this date          :  " + Rec_Date +
                               Environment.NewLine
                               + "Priority Rating is   :  " + Type +
                               Environment.NewLine
                               + "Please Attend to this Problem and Submit Request through Request Application Processing Software as soon as possible" +
                               Environment.NewLine
                               + Environment.NewLine
                               + "Thank you."
                               + Environment.NewLine
                               + "Regards" +
                               Environment.NewLine
                               + Environment.NewLine
                               + "AeroLogica Sdn Bhd  " +
                               Environment.NewLine
                               + "Tel No: 03 -7846 5112    Ext No: 273 / 314 /317  ";

                System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient("128.2.11.11");
                smtp.Port = 25;
                try
                {
                    smtp.Send(message);
                    Response.Write("<script>alert('Email Sent Successfully');</script>");
                    //ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "myscript", "alert('Email Sent Successfully')", true);
                }


                catch
                {
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "myscript", "alert('Email Couldnt be Sent ')", true);
                }


                System.Net.Mail.MailMessage message2 = new System.Net.Mail.MailMessage();
                message2.To.Add(Req_Email);
                message2.Subject = "Mail from IT Help Desk";
                message2.From    = new System.Net.Mail.MailAddress("*****@*****.**");

                message2.Body = "Dear       :  " + Req_Name
                                + Environment.NewLine
                                + Environment.NewLine
                                + "We acknowledge receipt of your request.Your issue has now been prioritised, and our staff has been assigned to work on it. We will update this service request with further information, as we continue to work on the request."
                                + Environment.NewLine
                                + Environment.NewLine
                                + "Category         :  " + Type +
                                Environment.NewLine
                                + "Reference No     :  " + Ref_No +
                                Environment.NewLine +
                                "Problem Desc      :  " + Prob_Desc
                                + Environment.NewLine
                                + Environment.NewLine
                                + "Thank you."
                                + Environment.NewLine
                                + "Regards"
                                + Environment.NewLine
                                + "AeroLogica Sdn Bhd  "
                                + Environment.NewLine
                                + "Tel No: 03 -7846 5112    Ext No: 273 / 314 /317  ";
                System.Net.Mail.SmtpClient smtp2 = new System.Net.Mail.SmtpClient("128.2.11.11");
                smtp2.Port = 25;

                try
                {
                    smtp2.Send(message2);
                    Response.Write("<script>alert('Email sent Successfully');</script>");
                    //ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "myscript", "alert('Email Sent Successfully')", true);
                }
                catch
                {
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "myscript", "alert('Email Couldnt be Sent')", true);
                }

                //if (Type == "Urgent")
                //{
                //    DateTime valdate = Convert.ToDateTime(Request.Cookies[cookname].Value);
                //    Session["valdate"] = valdate;
                //    Session["interval"] = 14400000;
                //    Session["Act_Email"] = Act_Email;
                //    Session["Ref_No"] = Ref_No;
                //    Session["Prob_Desc"] = Prob_Desc;
                //    Session["Req_Name"] = Req_Name;

                //}

                //if (Type == "Priority")
                //{
                //    DateTime valdate = Convert.ToDateTime(Request.Cookies[cookname].Value);
                //    Session["valdate"] = valdate;
                //    Session["interval"] = 28800000;
                //    Session["Act_Email"] = Act_Email;
                //    Session["Ref_No"] = Ref_No;
                //    Session["Prob_Desc"] = Prob_Desc;
                //    Session["Req_Name"] = Req_Name;

                //}
                //if (Type == "Normal")
                //{
                //    DateTime valdate = Convert.ToDateTime(Request.Cookies[cookname].Value);
                //    Session["valdate"] = valdate;

                //    Session["interval"] = 129600000;
                //    Session["Act_Email"] = Act_Email;
                //    Session["Ref_No"] = Ref_No;
                //    Session["Prob_Desc"] = Prob_Desc;
                //    Session["Req_Name"] = Req_Name;
                //}
            }


// EMAIL NO 2

            if (((confrim_value == "YES") && (flag == true)) && (CheckBox2.Checked == true))
            {
                int      Ref_No = Int32.Parse(TextBox1.Text);
                DateTime rec_da = System.DateTime.Now;
                if ((TextBox8.Text == "") || (TextBox9.Text == ""))
                {
                    TextBox8.Text = "00";
                    TextBox9.Text = "00";
                }
                string condate  = TextBox6.Text + " " + TextBox8.Text + ":" + TextBox9.Text + ":" + "00";
                string Rec_Date = Convert.ToDateTime(condate).ToString("yyyy/MM/dd HH:mm:ss");

                string   Prob_Desc     = TextBox4.Text;
                string   Type          = DropDownList2.SelectedItem.Text;
                string   Remarks       = DropDownList6.SelectedItem.Value;
                string   Req_Name      = TextBox2.Text;
                string   Com_Type      = DropDownList3.SelectedItem.Text;
                string   Req_Email     = TextBox7.Text;
                string   Req_Status    = DropDownList4.SelectedItem.Text;
                string   Act_Email     = DropDownList7.SelectedItem.Text;
                string   khidmat2      = ddlType.SelectedItem.Text;
                DateTime Escalate_Date = DateTime.Now;

                bl c = new bl();
                try
                {
                    bool stat = c.addsrvreq(Ref_No, Rec_Date, Req_Name, Prob_Desc, Type, Com_Type, Req_Email, Req_Status, Remarks, Act_Email, khidmat2, Escalate_Date);
                }
                catch
                {
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "myscript", "alert('Request Couldnt Be Added Try Again')", true);
                }

                //Response.Cookies[cookname] ["date"]  =Convert.ToString(System.DateTime.Now);
                System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage();
                message.To.Add(Act_Email);
                message.Subject = "Mail from IT Help Desk";
                message.From    = new System.Net.Mail.MailAddress("*****@*****.**");
                if (g.fileName != "")
                {
                    System.Net.Mail.Attachment attach = new System.Net.Mail.Attachment(Server.MapPath((@"~/" + g.fileName)));
                    message.Attachments.Add(attach);
                }

                message.Body = "Problem Description :  " + Prob_Desc +
                               Environment.NewLine
                               + "Reference No        :  " + Ref_No +
                               Environment.NewLine
                               + Environment.NewLine
                               + "Company Name        :  " + Com_Type +
                               Environment.NewLine
                               + Environment.NewLine
                               + "Sent by             :  " + Req_Name +
                               Environment.NewLine
                               + "on this date        :  " + Rec_Date +
                               Environment.NewLine
                               + "Priority Rating is :  " + Type +
                               Environment.NewLine
                               + "Please Note that this Problem is also CC to         :  " + DropDownList5.Text + "         " + "        " + DropDownList8.Text +
                               Environment.NewLine
                               + "Please Attend to this Problem and Submit Request through Request Application Processing Software as soon as possible" +
                               Environment.NewLine
                               + Environment.NewLine
                               + "Thank you."
                               + Environment.NewLine
                               + "Regards" +
                               Environment.NewLine
                               + Environment.NewLine
                               + "AeroLogica Sdn Bhd  " +
                               Environment.NewLine
                               + "Tel No: 03 -7846 5112    Ext No: 273 / 314 /317  ";

                System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient("128.2.11.11");
                smtp.Port = 25;
                try
                {
                    smtp.Send(message);
                    Response.Write("<script>alert('Email sent to Assignee Person');</script>");
                }
                catch
                {
                    Response.Write("<script>alert('Email Couldnt be sent');</script>");
                }


                System.Net.Mail.MailMessage message2 = new System.Net.Mail.MailMessage();
                message2.To.Add(Req_Email);
                message2.Subject = "Mail from IT Help Desk";
                message2.From    = new System.Net.Mail.MailAddress("*****@*****.**");

                message2.Body = "Dear       :  " + Req_Name
                                + Environment.NewLine
                                + Environment.NewLine
                                + "We acknowledge receipt of your request.Your issue has now been prioritised, and our staff has been assigned to work on it. We will update this service request with further information, as we continue to work on the request."
                                + Environment.NewLine
                                + Environment.NewLine
                                + "Category         :  " + Type +
                                Environment.NewLine
                                + "Reference No     :  " + Ref_No +
                                Environment.NewLine +
                                "Problem Desc      :  " + Prob_Desc
                                + Environment.NewLine
                                + Environment.NewLine
                                + "Thank you."
                                + Environment.NewLine
                                + "Regards"
                                + Environment.NewLine
                                + "AeroLogica Sdn Bhd  "
                                + Environment.NewLine
                                + "Tel No: 03 -7846 5112    Ext No: 273 / 314 /317  ";
                System.Net.Mail.SmtpClient smtp2 = new System.Net.Mail.SmtpClient("128.2.11.11");
                smtp2.Port = 25;

                try
                {
                    smtp2.Send(message2);
                    Response.Write("<script> alert('Email sent to Requestor');</script>");
                }
                catch
                {
                    Response.Write("<script> alert('Email Couldnt be sent');</script>");
                }


                //if (Type == "Urgent")
                //{
                //    DateTime valdate = Convert.ToDateTime(Request.Cookies[cookname].Value);
                //    Session["valdate"] = valdate;
                //    Session["interval"] = 14400000;
                //    Session["Act_Email"] = Act_Email;
                //    Session["Ref_No"] = Ref_No;
                //    Session["Prob_Desc"] = Prob_Desc;
                //    Session["Req_Name"] = Req_Name;


                //}

                //if (Type == "Priority")
                //{
                //    DateTime valdate = Convert.ToDateTime(Request.Cookies[cookname].Value);
                //    Session["valdate"] = valdate;
                //    Session["interval"] = 28800000;
                //    Session["Act_Email"] = Act_Email;
                //    Session["Ref_No"] = Ref_No;
                //    Session["Prob_Desc"] = Prob_Desc;
                //    Session["Req_Name"] = Req_Name;


                //}
                //if (Type == "Normal")
                //{
                //    DateTime valdate = Convert.ToDateTime(Request.Cookies[cookname].Value);
                //    Session["valdate"] = valdate;

                //    Session["interval"] = 129600000;
                //    Session["Act_Email"] = Act_Email;
                //    Session["Ref_No"] = Ref_No;
                //    Session["Prob_Desc"] = Prob_Desc;
                //    Session["Req_Name"] = Req_Name;


                //}
            }
// EMAIL NO 3
            if (((confrim_value == "YES") && (flag == true)) && (CheckBox3.Checked == true))
            {
                int      Ref_No = Int32.Parse(TextBox1.Text);
                DateTime rec_da = System.DateTime.Now;
                if ((TextBox8.Text == "") || (TextBox9.Text == ""))
                {
                    TextBox8.Text = "00";
                    TextBox9.Text = "00";
                }
                string condate  = TextBox6.Text + " " + TextBox8.Text + ":" + TextBox9.Text + ":" + "00";
                string Rec_Date = Convert.ToDateTime(condate).ToString("yyyy/MM/dd HH:mm:ss");

                string   Prob_Desc     = TextBox4.Text;
                string   Type          = DropDownList2.SelectedItem.Text;
                string   Remarks       = DropDownList6.SelectedItem.Value;
                string   Req_Name      = TextBox2.Text;
                string   Com_Type      = DropDownList3.SelectedItem.Text;
                string   Req_Email     = TextBox7.Text;
                string   Req_Status    = DropDownList4.SelectedItem.Text;
                string   Act_Email     = DropDownList8.SelectedItem.Text;
                string   khidmat2      = ddlType.SelectedItem.Text;
                DateTime Escalate_Date = DateTime.Now;


                bl c = new bl();
                try
                {
                    HttpContext.Current.Server.ScriptTimeout = 900000;
                    bool stat = c.addsrvreq(Ref_No, Rec_Date, Req_Name, Prob_Desc, Type, Com_Type, Req_Email, Req_Status, Remarks, Act_Email, khidmat2, Escalate_Date);
                    Response.Write("<script>alert('Request Added Successfully');</script>");
                    //ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "myscript", "alert('Request Added Successfully')", true);
                }
                catch
                {
                    Response.Write("<script>alert('Request NOT Added TRY AGAIN');</script>");
                    //ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "myscript", "alert('Request Not Added Try Again')", true);
                }

                //Response.Cookies[cookname] ["date"]  =Convert.ToString(System.DateTime.Now);
                System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage();
                message.To.Add(Act_Email);
                message.Subject = "Mail from IT Help Desk";
                message.From    = new System.Net.Mail.MailAddress("*****@*****.**");
                if (g.fileName != "")
                {
                    System.Net.Mail.Attachment attach = new System.Net.Mail.Attachment(Server.MapPath((@"~/" + g.fileName)));
                    message.Attachments.Add(attach);
                }

                message.Body = "Problem Description :  " + Prob_Desc +
                               Environment.NewLine
                               + "Reference No        :  " + Ref_No +
                               Environment.NewLine
                               + Environment.NewLine
                               + "Company Name        :  " + Com_Type +
                               Environment.NewLine
                               + Environment.NewLine
                               + "Sent by             :  " + Req_Name +
                               Environment.NewLine
                               + "on this date        :  " + Rec_Date +
                               Environment.NewLine
                               + "Priority Rating is :  " + Type +
                               Environment.NewLine
                               + "Please Attend to this Problem and Submit Request through Request Application Processing Software as soon as possible" +
                               Environment.NewLine
                               + "Please Note that this Problem is also Forwarded to  :  " + DropDownList5.Text + " and  " + DropDownList7.Text +
                               Environment.NewLine
                               + Environment.NewLine
                               + "Thank you."
                               + Environment.NewLine
                               + "Regards" +
                               Environment.NewLine
                               + Environment.NewLine
                               + "AeroLogica Sdn Bhd  " +
                               Environment.NewLine
                               + "Tel No: 03 -7846 5112    Ext No: 273 / 314 /317  ";

                System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient("128.2.11.11");
                smtp.Port = 25;
                try
                {
                    smtp.Send(message);
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "myscript", "alert('Email Sent To Problem Solver')", true);
                }
                catch
                {
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "myscript", "alert('Email Couldnt be Sent Try Again')", true);
                }


                System.Net.Mail.MailMessage message2 = new System.Net.Mail.MailMessage();
                message2.To.Add(Req_Email);
                message2.Subject = "Mail from IT Help Desk";
                message2.From    = new System.Net.Mail.MailAddress("*****@*****.**");

                message2.Body = "Dear       :  " + Req_Name
                                + Environment.NewLine
                                + Environment.NewLine
                                + "We acknowledge receipt of your request.Your issue has now been prioritised, and our staff has been assigned to work on it. We will update this service request with further information, as we continue to work on the request."
                                + Environment.NewLine
                                + Environment.NewLine
                                + "Category         :  " + Type +
                                Environment.NewLine
                                + "Reference No     :  " + Ref_No +
                                Environment.NewLine +
                                "Problem Desc      :  " + Prob_Desc
                                + Environment.NewLine
                                + Environment.NewLine
                                + "Thank you."
                                + Environment.NewLine
                                + "Regards"
                                + Environment.NewLine
                                + "AeroLogica Sdn Bhd  "
                                + Environment.NewLine
                                + "Tel No: 03 -7846 5112    Ext No: 273 / 314 /317  ";
                System.Net.Mail.SmtpClient smtp2 = new System.Net.Mail.SmtpClient("128.2.11.11");
                smtp2.Port = 25;



                try
                {
                    smtp2.Send(message2);
                    Response.Write("<script>alert('Email sent to Requestor');</script>");
                    //ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "myscript", "alert('Email Sent To Requestor')", true);
                }
                catch
                {
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "myscript", "alert('Email Coulnt Be Sent Try Again')", true);
                }


                //if (Type == "Urgent")
                //{
                //    DateTime valdate = Convert.ToDateTime(Request.Cookies[cookname].Value);
                //    Session["valdate"] = valdate;
                //    Session["interval"] = 14400000;
                //    Session["Act_Email"] = Act_Email;
                //    Session["Ref_No"] = Ref_No;
                //    Session["Prob_Desc"] = Prob_Desc;
                //    Session["Req_Name"] = Req_Name;


                //}

                //if (Type == "Priority")
                //{
                //    DateTime valdate = Convert.ToDateTime(Request.Cookies[cookname].Value);
                //    Session["valdate"] = valdate;
                //    Session["interval"] = 28800000;
                //    Session["Act_Email"] = Act_Email;
                //    Session["Ref_No"] = Ref_No;
                //    Session["Prob_Desc"] = Prob_Desc;
                //    Session["Req_Name"] = Req_Name;


                //}
                //if (Type == "Normal")
                //{
                //    DateTime valdate = Convert.ToDateTime(Request.Cookies[cookname].Value);
                //    Session["valdate"] = valdate;

                //    Session["interval"] = 129600000;
                //    Session["Act_Email"] = Act_Email;
                //    Session["Ref_No"] = Ref_No;
                //    Session["Prob_Desc"] = Prob_Desc;
                //    Session["Req_Name"] = Req_Name;


                //}
            }
            Server.Transfer("AddReq.aspx");
        }
Пример #25
0
    protected void Button2_Click(object sender, EventArgs e)
    {
        string firstName, lastName, id, password, cellPhone, workPhone, cellProvider, category;
        bool   encryption;

        Label2.Visible = true;
        string url = TextBox11.Text;

        if (url == null || url.Length == 0)
        {
            Label2.Text = "Enter Valid Url";
            TextBox11.Focus();
            return;
        }
        firstName = TextBox4.Text;
        if (firstName == null || firstName.Length == 0)
        {
            Label2.Text = "Enter First Name";
            TextBox4.Focus();
            return;
        }

        lastName = TextBox5.Text;
        if (lastName == null || lastName.Length == 0)
        {
            Label2.Text = "Enter Last Name";
            TextBox5.Focus();
            return;
        }
        id = TextBox6.Text;
        if (id == null || id.Length == 0)
        {
            Label2.Text = "Enter Id";
            TextBox6.Focus();
            return;
        }
        password = TextBox7.Text;
        if (password == null || password.Length == 0)
        {
            Label2.Text = "Enter Password";
            TextBox7.Focus();
            return;
        }

        workPhone = TextBox8.Text;
        if (workPhone == null || workPhone.Length == 0)
        {
            Label2.Text = "Enter Work Phone";
            TextBox8.Focus();
            return;
        }
        cellPhone = TextBox9.Text;
        if (cellPhone == null || cellPhone.Length == 0)
        {
            Label2.Text = "Enter Cell Phone";
            TextBox9.Focus();
            return;
        }
        cellProvider = TextBox10.Text;

        /* if (cellProvider == null || cellProvider.Length == 0)
         * {
         *   Label2.Text = "Enter Cell Provider";
         *   TextBox10.Focus();
         *   return;
         * }*/

        category       = testSelect.Value;
        encryption     = CheckBox1.Checked;
        Label2.Visible = true;


        List <String> data = new List <string>();

        Label2.Text = category;

        data.Add(firstName);
        data.Add(lastName);
        data.Add(id);
        if (encryption)
        {
            EncryptionService.ServiceClient encryptSVC = new EncryptionService.ServiceClient();
            data.Add(encryptSVC.Encrypt(password));
        }
        else
        {
            data.Add(password);
        }
        data.Add(workPhone);
        data.Add(cellPhone);
        data.Add(category);
        data.Add(encryption.ToString());
        data.Add(cellProvider);



        XmlService.Service1Client svc = new XmlService.Service1Client();

        string response = svc.addPerson(data.ToArray(), url);

        Label2.Text = response;

        Button2.Focus();
    }
Пример #26
0
 protected void TextBox19_TextChanged(object sender, EventArgs e)
 {
     item_name1 = TextBox19.Text;
     TextBox6.Focus();
 }
Пример #27
0
 protected void TextBox5_TextChanged(object sender, System.EventArgs e)
 {
     TextBox6.Focus();
 }
    protected void Button1_Click(object sender, EventArgs e)
    {
        if (DropDownList1.SelectedIndex != 0)
        {
            if (DropDownList2.SelectedIndex != 0)
            {
                string ext = System.IO.Path.GetExtension(FileUpload1.FileName);

                if (ext == ".jpg" || ext == ".png" || ext == ".jpeg" || ext == ".gif" || ext == ".GIF" || ext == ".PNG" || ext == ".JPEG" || ext == ".JPG")
                {
                    FileUpload1.SaveAs(Server.MapPath("~//admin//simple_tiffin_image//" + FileUpload1.FileName));
                    string path = "~//admin//simple_tiffin_image//" + FileUpload1.FileName;

                    try
                    {
                        if (Std_chk.Checked == true)
                        {
                            std = "1";
                        }
                        else
                        {
                            std = "0";
                        }

                        if (avg_chk.Checked == true)
                        {
                            avg = "1";
                        }
                        else
                        {
                            avg = "0";
                        }

                        if (poor_chk.Checked == true)
                        {
                            poor = "1";
                        }
                        else
                        {
                            poor = "0";
                        }

                        if (Rmd_yes_rb.Checked == true)
                        {
                            string q = "insert into simple_tiffin values('" + TextBox6.Text + "','" + DropDownList1.Text + "','" + DropDownList2.Text + "','" + Label2.Text + "','" + TextBox1.Text + "','" + TextBox2.Text + "','" + TextBox3.Text + "','" + TextBox4.Text + "','" + TextBox7.Text + "','" + TextBox5.Text + "','" + std + "','" + avg + "','" + poor + "','" + TextBox8.Text + "','1','" + path + "','Order Now'," + IsAppHomeChk.Checked + ")";
                            dc.setdata(q);

                            ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('" + TextBox6.Text + "' Simple Tiffin Added');", true);

                            TextBox1.Text               = "";
                            TextBox2.Text               = "";
                            TextBox3.Text               = "";
                            TextBox4.Text               = "";
                            TextBox5.Text               = "";
                            TextBox6.Text               = "";
                            TextBox7.Text               = "";
                            TextBox8.Text               = "";
                            Std_chk.Checked             = false;
                            avg_chk.Checked             = false;
                            poor_chk.Checked            = false;
                            IsAppHomeChk.Checked        = false;
                            DropDownList1.SelectedIndex = 0;
                            DropDownList2.Items.Clear();
                            Label2.Text = "";
                        }
                        else if (Rmd_no_rb.Checked == true)
                        {
                            string q = "insert into simple_tiffin values('" + TextBox6.Text + "','" + DropDownList1.Text + "','" + DropDownList2.Text + "','" + Label2.Text + "','" + TextBox1.Text + "','" + TextBox2.Text + "','" + TextBox3.Text + "','" + TextBox4.Text + "','" + TextBox7.Text + "','" + TextBox5.Text + "','" + std + "','" + avg + "','" + poor + "','" + TextBox8.Text + "','0','" + path + "','Order Now'," + IsAppHomeChk.Checked + ")";
                            dc.setdata(q);

                            ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('" + TextBox6.Text + "' Simple Tiffin Added');", true);

                            TextBox1.Text               = "";
                            TextBox2.Text               = "";
                            TextBox3.Text               = "";
                            TextBox4.Text               = "";
                            TextBox5.Text               = "";
                            TextBox6.Text               = "";
                            TextBox7.Text               = "";
                            TextBox8.Text               = "";
                            Std_chk.Checked             = false;
                            avg_chk.Checked             = false;
                            poor_chk.Checked            = false;
                            IsAppHomeChk.Checked        = false;
                            DropDownList1.SelectedIndex = 0;
                            DropDownList2.Items.Clear();
                            Label2.Text = "";
                        }
                    }
                    catch (Exception ex)
                    {
                        string try_msg = ex.Message;
                        //Label2.Text = try_msg;
                        ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('This Tiffin Id Already Exist.');", true);

                        TextBox6.Text = "";
                        TextBox6.Focus();
                    }
                }
                else
                {
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('Please select Image Only');", true);
                }
            }
            else
            {
                ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('Please select provider');", true);
                //Response.Write("<script>alert('Please select provider')</script>");
            }
        }
        else
        {
            ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('Please Select City');", true);
            //Response.Write("<script>alert('Please select city')</script>");
        }
    }