protected void txt_Clr1_TextChanged(object sender, EventArgs e)
    {
        try
        {
            double val = 0;
            clrval1 = 0;
            if (!(string.IsNullOrEmpty(txt_Clr1.Text)))
            {
                clrval1 = Convert.ToDouble(txt_Clr1.Text);
            }
            if (!(string.IsNullOrEmpty(txt_fat1.Text)))
            {
                fatval1 = Convert.ToDouble(txt_fat1.Text);
            }
            if ((clrval1 > 0) && (fatval1 > 0))
            {
                val = (fatval1 * 0.21) + ((clrval1 / 4) + 0.36);
            }
            txt_SNF1.Text = val.ToString("f2");

            //txt_Clr1.Focus();
            // txt_SNF1.Text = snfval1.ToString();
            txt_fat1.Text = fatval1.ToString();
            txt_Clr1.Text = clrval1.ToString();
            Button1.Focus();
        }
        catch (Exception ex)
        {
            ex.ToString();
        }
    }
 protected void Qty_TextChanged(object sender, EventArgs e)
 {
     SPDiscount.Text = string.Format("{0:f2}", ((decimal.Parse(Qty.Text) * decimal.Parse(SpecialDiscount.ToString()))));
     //Amount.Text = string.Format("{0:f2}", (decimal.Parse(Qty.Text) * decimal.Parse(DP.Text)));
     Amount.Text = string.Format("{0:f2}", (decimal.Parse(DP.Text) * (decimal.Parse(Qty.Text)) - decimal.Parse(SPDiscount.Text)));
     Button1.Focus();
 }
Example #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            if (Session["GroomerUserName"] != null && Session["GId"] != null)
            {
                if (!IsPostBack)
                {
                    if (Session["PageFrom"] != null)
                    {
                        if (Session["PageFrom"].ToString() == "Operations")
                        {
                            SuccesfullMessage("Appointment Completed successfully.");
                        }
                        else if (Session["PageFrom"].ToString() == "DailyOperationLog")
                        {
                            SuccesfullMessage("Appointment details submitted successfully.");
                        }
                    }

                    getAppointmentDtls(strMsg);
                    Button1.Focus();
                }
            }
            else
            {
                Response.Redirect("Default.aspx?Msg=Timeout", false);
            }
        }
        catch
        {
        }
    }
    protected void txt_stockname_TextChanged(object sender, EventArgs e)
    {
        try
        {
            getstockcategory();

            if ((ddl_stocktype.SelectedItem.Text == stocktype.Trim()) && (txt_stockname.Text == stockname.Trim()))
            {
                txt_stockname.Text = "";
                lblmsg.Visible     = true;
                lblmsg.ForeColor   = System.Drawing.Color.Red;
                lblmsg.Text        = "StockName Already Available...";
                txt_stockname.Focus();
            }
            else
            {
                Button1.Focus();
            }
        }

        catch (Exception Ex)
        {
            lblmsg.Text    = Ex.Message;
            lblmsg.Visible = true;
        }
    }
Example #5
0
 public CustomMessageBox()
 {
     InitializeComponent();
     text.Text               = MessageBoxReturn.text;
     Button1.Content         = MessageBoxReturn.Button1;
     Button2.Content         = MessageBoxReturn.Button2;
     MessageBoxReturn.Return = false;
     Button1.Focus();
 }
        private void Button_Click_0(object sender, RoutedEventArgs e)
        {
            TextBoxNumbers.Text += 0;
            var scope = FocusManager.GetFocusScope(Button0); // elem is the UIElement to unfocus

            FocusManager.SetFocusedElement(scope, null);     // remove logical focus
            Keyboard.ClearFocus();                           // remove keyboard focus
            Button1.Focus();
            Keyboard.Focus(Button1);
        }
Example #7
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        XmlService.Service1Client svc = new XmlService.Service1Client();

        if (TextBox1.Text.Length > 0 && TextBox2.Text.Length > 0)
        {
            Label1.Visible = true;
            string response = svc.searchKey(TextBox1.Text, TextBox2.Text);

            if (response.Trim().Length == 0)
            {
                Label1.Text = "Key did not match with any data in the file";

                TextBox3.Visible = false;
            }
            else if (!response.Equals("File Not Found") && !response.Equals("Something went wrong"))
            {
                string[] content   = response.Split('@');
                int      resLength = content.Length - 1;
                Label1.Text      = resLength + (resLength == 1? " result " : " results ") + "found  :";
                TextBox3.Visible = true;
                TextBox3.Text    = "";
                foreach (string result in content)
                {
                    if (result != null && result.Length > 0)
                    {
                        foreach (string res in result.Split(','))
                        {
                            if (result.Trim().Length > 0)
                            {
                                TextBox3.Text += res.Trim() + "\n";
                            }
                        }
                    }
                }
            }
            else
            {
                TextBox3.Visible = false;
                Label1.Text      = response;
            }
        }
        else if (TextBox1.Text.Length <= 0)
        {
            TextBox3.Visible = false;
            Label1.Text      = "Please Enter URL";
        }
        else if (TextBox2.Text.Length <= 0)
        {
            TextBox3.Visible = false;
            Label1.Text      = "Please Enter Key";
        }
        Button1.Focus();
    }
Example #8
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     if (IsChagneSave)
     {
         chkFunctionForSubmit();
     }
     else
     {
         Label1.Text = "Please Save Your Current Changes";
         Button1.Focus();
     }
 }
Example #9
0
    protected void txt_tarifno_TextChanged(object sender, EventArgs e)
    {
        bl.tarif_no = txt_tarifno.Text;
        DataSet ds = new DataSet();

        ds = dl.secectterifno(bl);
        if (ds.Tables[0].Rows.Count > 0)
        {
            ScriptManager.RegisterStartupScript(this, this.GetType(), "redirect", "alert('The Tarif No Already Exists');", true);
            txt_tarifno.Focus();
            txt_tarifno.Text = string.Empty;
        }
        else
        {
            Button1.Focus();
        }
    }
        public void Start()
        {
            try
            {
                var s = (Storyboard)TryFindResource("ShowStoryboard") as Storyboard;

                if (s != null)
                {
                    s.Begin();
                }

                Tip1.FadeIn();
                Tip1.AfterFadeIn += (sender, evt) => { Button1.Focus(); };
            }
            catch (Exception ex)
            {
                Diagnostics.LogException(ex);
                OnError();
            }
        }
        protected void ProductCode_TextChanged(object sender, EventArgs e)
        {
            SqlConnection con = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["conn"].ToString());
            SqlCommand    cmd = new SqlCommand("", con);

            cmd.CommandText = "select *,dbo.GETAVLQTY(productId,@FrenchiseID)as AQTY from ProductRepurchase where ProductCode =@Pid and Status != 1";

            cmd.Parameters.AddWithValue("@Pid", ProductCode.Text);
            cmd.Parameters.AddWithValue("@FrenchiseID", ConfigurationManager.AppSettings["FrenchiseID"].ToString());
            con.Open();
            SqlDataReader dr = cmd.ExecuteReader();

            while (dr.Read())
            {
                PID.Value           = dr["ProductID"].ToString();
                ProductName.Text    = dr["ProductName"].ToString();
                SpecialDiscount     = Convert.ToDecimal(dr["DiscountAmount"].ToString().Replace(".0000", ".00"));
                SPDiscount.Text     = SpecialDiscount.ToString();
                MRP.Text            = string.Format("{0:f2}", decimal.Parse(dr["MRP"].ToString()));
                DP.Text             = dr["SalesAmount"].ToString().Replace(".0000", ".00");
                BV.Text             = dr["BV"].ToString();
                CashBack.Text       = dr["CashBack"].ToString();
                txtselcashback.Text = dr["SelfCashBack"].ToString();
                Tax.Text            = string.Format("{0:f2}", decimal.Parse(dr["Vat"].ToString()));
                CGST.Text           = string.Format("{0:f2}", decimal.Parse(dr["CGST"].ToString()));
                SGST.Text           = string.Format("{0:f2}", decimal.Parse(dr["SGST"].ToString()));
                IGST.Text           = string.Format("{0:f2}", decimal.Parse(dr["IGST"].ToString()));
                Cess.Text           = string.Format("{0:f2}", decimal.Parse(dr["Cess"].ToString()));
                Qty.Text            = "1";
                // Amount.Text = string.Format("{0:f2}", (decimal.Parse(Qty.Text) * decimal.Parse(DP.Text)));
                //Amount.Text = string.Format("{0:f2}", (decimal.Parse(DP.Text) - decimal.Parse(SPDiscount.Text)));
                Amount.Text = string.Format("{0:f2}", (decimal.Parse(DP.Text) * (decimal.Parse(Qty.Text)) - decimal.Parse(SPDiscount.Text)));
                //  txtAVLQTY.Text = dr["AQTY"].ToString();
                //imageload.HRef = dr["ImageUrl"].ToString();
            }
            dr.Close();
            con.Close();

            Button1.Focus();
            // imageload.Focus();
        }
Example #12
0
    public DataTable function()
    {
        string str = "";

        if (ddlSearch.SelectedItem.Text == "Status")
        {
            if (rbtnactive.Checked == true)
            {
                str = "Select ID,Name,State,Email,Mobile,Active from Member where Active='Register'";
            }
            else if (rbtnblock.Checked == true)
            {
                str = "Select ID,Name,State,Email,Mobile,Active from Member where Active='nos'";
            }
        }
        else if (ddlSearch.SelectedItem.Text == "Name")
        {
            str = "Select ID,Name,State,Email,Mobile,Active from Member where Name like '%" + txtname.Text + "%'";
            txtname.Focus();
        }
        else if (ddlSearch.SelectedItem.Text == "State")
        {
            str = "Select ID,Name,State,Email,Mobile,Active from Member where State='" + ddlState.SelectedValue.ToString() + "'";
            ddlState.Focus();
        }
        else if (ddlSearch.SelectedItem.Text == "IMID")
        {
            str = "Select ID,Name,State,Email,Mobile,Active from Member where ID='" + txtid.Text + "'";
            txtid.Focus();
        }
        else if (ddlSearch.SelectedItem.Text == "All Members")
        {
            str = "Select ID,Name,State,Email,Mobile,Active from Member";
            Button1.Focus();
        }
        SqlDataAdapter adp = new SqlDataAdapter(str, con);
        DataTable      dt  = new DataTable();

        adp.Fill(dt);
        return(dt);
    }
Example #13
0
        private void Button1_Click(object sender, EventArgs e)
        {
            label4.Visible = false;
            label5.Visible = false;
            //engine.RecognizeAsync(RecognizeMode.Multiple);
            Button1.Focus();

            if (TextBox1.Text != "" && TextBox2.Text != "")
            {
                if (data.CheckUser(TextBox1.Text, TextBox2.Text))
                {
                    this.Hide();
                    userId = TextBox1.Text;
                    engine2.Dispose();
                    engine.RecognizeAsyncCancel();
                    MessageBox.Show("Logged in!");
                    Form1 f = new Form1();
                    f.Show();
                }
                else
                {
                    MessageBox.Show("User id and Password does not match", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            else
            {
                if (TextBox1.Text == "")
                {
                    label4.Visible = true;
                }
                if (TextBox2.Text == "")
                {
                    label5.Visible = true;
                }
            }
        }
Example #14
0
 //обработка правильных ответов
 private void RightFun()
 {
     resultLbl.Text = "Молодец! Правильно!";
     Button1.Focus();
     winCount++;
     progressBar1.Value += 5;
     WinsTxtBox.Text     = winCount.ToString();
     if (progressBar1.Value == 100)
     {
         DialogResult result = MessageBox.Show("Молодец! Задание выполнено!\nПродолжим?", "", MessageBoxButtons.YesNo, MessageBoxIcon.None);
         if (result == DialogResult.Yes)
         {
             progressBar1.Value = 0;
             winCount           = 0;
             errCount           = 0;
             WinsTxtBox.Text    = winCount.ToString();
             Start();
         }
         else
         {
             Close();
         }
     }
 }
 protected void Button1_Click(object sender, EventArgs e)
 {
     if (Page.IsValid)
     {
         SqlConnection cn  = new SqlConnection(Application["strCn"].ToString());
         SqlCommand    cmd = new SqlCommand();
         cn.Open();
         cmd.CommandText = "update taVariabel set MIN_LEMBUR = '1/1/1900 " + txtCol1Item0.Text + ":00',MAKS_LEMBUR = '1/1/1900 " + txtCol1Item1.Text + ":00',MIN_LEMBUR_LIBUR = '1/1/1900 " + txtCol1Item2.Text + ":00',MAKS_LEMBUR_LIBUR = '1/1/1900 " + txtCol1Item3.Text + ":00',MAKS_TOTAL_LEMBUR = " + txtCol1Item4.Text + ",BATAS_TERIMA_UANG_MAKAN_LEMBUR = " + txtCol1Item5.Text + ",TARIF_UANG_MAKAN_LEMBUR = " + txtCol1Item6.Text + "";
         cmd.CommandType = CommandType.Text;
         cmd.Connection  = cn;
         try
         {
             cmd.ExecuteNonQuery();
             ExceptionDetails2.Text = lblConfigUpdated.Text;
             rtwin.azlib.AddUserAct(Session["UserID"].ToString(), "1155", "", Application["strCn"].ToString());
         }
         catch (Exception ex)
         {
             ExceptionDetails2.Text = lblConfigNotUpdated.Text + ex.Message;
         }
         cn.Close();
         Button1.Focus();
     }
 }
 protected void Button2_Click(object sender, EventArgs e)
 {
     Button1.Focus();
     Label1.Text = "button2 clicked & button1 in Focus";
 }
Example #17
0
 protected void txtid_TextChanged(object sender, EventArgs e)
 {
     Button1.Focus();
 }
Example #18
0
 protected void rbtnactive_CheckedChanged1(object sender, EventArgs e)
 {
     Button1.Focus();
 }
Example #19
0
    /*Reports*/

    protected void ddlState_SelectedIndexChanged(object sender, EventArgs e)
    {
        Button1.Focus();
    }
Example #20
0
 protected void RadioButton2_CheckedChanged(object sender, EventArgs e)
 {
     Button1.Focus();
 }
        private void Save_Click(object sender, EventArgs e)
        {
            try
            {
                if (txtCustomerID.Text == "")
                {
                    MessageBox.Show("Please retrieve Customer Details", "Input Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    Button1.Focus();
                    return;
                }

                if (txtTaxPer.Text == "")
                {
                    MessageBox.Show("Please enter tax percentage", "Input Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    txtTaxPer.Focus();
                    return;
                }
                if (txtDiscountPer.Text == "")
                {
                    MessageBox.Show("Please enter discount percentage", "Input Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    txtDiscountPer.Focus();
                    return;
                }
                if (txtTotalPayment.Text == "")
                {
                    MessageBox.Show("Please enter total payment", "Input Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    txtTotalPayment.Focus();
                    return;
                }
                if (cmbPaymentType.Text == "")
                {
                    MessageBox.Show("Please select payment type", "Input Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    cmbPaymentType.Focus();
                    return;
                }
                if (cmbStatus.Text == "")
                {
                    MessageBox.Show("Please select status", "Input Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    cmbStatus.Focus();
                    return;
                }
                if (ListView1.Items.Count == 0)
                {
                    MessageBox.Show("sorry no product added", "", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }

                auto();

                con = new SqlConnection(cs.DBConn);
                con.Open();

                string cb = "insert Into Invoice_Info(InvoiceNo,InvoiceDate,CustomerID,SubTotal,VATPer,VATAmount,DiscountPer,DiscountAmount,GrandTotal,TotalPayment,PaymentDue,PaymentType,Status,Remarks) VALUES ('" + txtInvoiceNo.Text + "','" + dtpInvoiceDate.Text + "','" + txtCustomerID.Text + "'," + txtSubTotal.Text + "," + txtTaxPer.Text + "," + txtTaxAmt.Text + "," + txtDiscountPer.Text + "," + txtDiscountAmount.Text + "," + txtTotal.Text + "," + txtTotalPayment.Text + "," + txtPaymentDue.Text + ",'" + cmbPaymentType.Text + "','" + cmbStatus.Text + "','" + txtRemarks.Text + "')";
                cmd            = new SqlCommand(cb);
                cmd.Connection = con;
                cmd.ExecuteReader();
                if (con.State == ConnectionState.Open)
                {
                    con.Close();
                }
                con.Close();


                for (int i = 0; i <= ListView1.Items.Count - 1; i++)
                {
                    con = new SqlConnection(cs.DBConn);

                    string cd = "insert Into ProductSold(InvoiceNo,ProductID,ProductName,Quantity,Price,TotalAmount) VALUES (@d1,@d2,@d3,@d4,@d5,@d6)";
                    cmd            = new SqlCommand(cd);
                    cmd.Connection = con;
                    cmd.Parameters.AddWithValue("d1", txtInvoiceNo.Text);
                    cmd.Parameters.AddWithValue("d2", ListView1.Items[i].SubItems[1].Text);
                    cmd.Parameters.AddWithValue("d3", ListView1.Items[i].SubItems[2].Text);
                    cmd.Parameters.AddWithValue("d4", ListView1.Items[i].SubItems[4].Text);
                    cmd.Parameters.AddWithValue("d5", ListView1.Items[i].SubItems[3].Text);
                    cmd.Parameters.AddWithValue("d6", ListView1.Items[i].SubItems[5].Text);
                    con.Open();
                    cmd.ExecuteNonQuery();
                    con.Close();
                }
                for (int i = 0; i <= ListView1.Items.Count - 1; i++)
                {
                    con = new SqlConnection(cs.DBConn);
                    con.Open();
                    string cb1 = "update temp_stock set Quantity = Quantity - " + ListView1.Items[i].SubItems[4].Text + " where ProductID= '" + ListView1.Items[i].SubItems[1].Text + "'";
                    cmd            = new SqlCommand(cb1);
                    cmd.Connection = con;
                    cmd.ExecuteNonQuery();
                    con.Close();
                }

                Save.Enabled     = false;
                btnPrint.Enabled = true;
                GetData();
                MessageBox.Show("Successfully Placed", "Order", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
 private void Login_Form2_Load(object sender, EventArgs e)
 {
     Button1.Focus();
 }
Example #23
0
 private void MessageBoxEx_Activated(object sender, EventArgs e)
 {
     Button1.Focus(); // put initial focus on Yes button
 }
Example #24
0
 protected void Page_Load(object sender, EventArgs e)
 {
     Button1.Focus();
 }
Example #25
0
 protected void ppriceTxt_TextChanged(object sender, EventArgs e)
 {
     Button1.Focus();
 }
Example #26
0
 protected void Calendar1_SelectionChanged(object sender, EventArgs e)
 {
     TextBox3.Text     = Calendar1.SelectedDate.ToShortDateString();
     Calendar1.Visible = !Calendar1.Visible;
     Button1.Focus();
 }