Exemple #1
0
    public void CallConnection()
    {
        ClsSqlConnection obj = new ClsSqlConnection();
        DataSet          ds  = obj.Select(txtLoginId.Text, txtPassword.Text, txtPassword.Text, "Login");

        if (ds.Tables.Count > 0)
        {
            if (ds.Tables[0].Rows[0]["Code"].ToString() == "200")
            {
                Session["Login"]      = ds.Tables[0].Rows[0]["Login"].ToString();
                Session["CustomerId"] = ds.Tables[0].Rows[0]["CustomerId"].ToString();
                if (txtLoginId.Text == "[email protected]")
                {
                    Response.Redirect("~/Reports/RegisterUserReport.aspx");
                }
                else
                {
                    Response.Redirect("~/Masters/ViewMail.aspx");
                }
            }
            else if (ds.Tables[0].Rows[0]["Code"].ToString() == "404")
            {
                lblError.Text    = ds.Tables[0].Rows[0]["Message"].ToString();
                lblCaptcha.Text  = Guid.NewGuid().ToString().Substring(0, 5);
                txtCaptcha.Text  = "";
                txtPassword.Text = "";
                return;
            }
        }
    }
Exemple #2
0
    public void CallConnection()
    {
        ClsSqlConnection obj = new ClsSqlConnection();
        DataSet          ds  = obj.Select(Email_id.Text, "", txtRecoveryHint.Text, "ChkHint");

        if (ds.Tables.Count > 0)
        {
            if (ds.Tables[0].Rows[0]["Code"].ToString() == "200")
            {
                Session["Login"]     = ds.Tables[0].Rows[0]["Login"].ToString();
                confirm_pass.Visible = true;
                new_pass.Visible     = true;
                newpass.Visible      = true;
                conpass.Visible      = true;
                change.Visible       = true;
                pnlFP.Visible        = pnlFP.Enabled = false;
            }
            else if (ds.Tables[0].Rows[0]["Code"].ToString() == "404")
            {
                confirm_pass.Visible = false;
                new_pass.Visible     = false;
                newpass.Visible      = false;
                conpass.Visible      = false;
                change.Visible       = false;
                pnlFP.Visible        = pnlFP.Enabled = true;
                lblError.Text        = ds.Tables[0].Rows[0]["Message"].ToString();
            }
        }
    }
Exemple #3
0
        private void LoadCustomers()
        {
            ClsSqlConnection obj = new ClsSqlConnection();

            GridCustomers.DataSource = obj.getCustomers();
            GridCustomers.DataBind();
        }
Exemple #4
0
    public void CallConnection1(int id, string Type)
    {
        ClsSqlConnection obj = new ClsSqlConnection();
        DataSet          ds  = obj.Select1(id, Type);

        if (ds.Tables.Count > 0)
        {
            if (Request.QueryString.Count > 0)
            {
                if (Request.QueryString["val"].ToString() == "reply")
                {
                    TxtSubject.Text    = ds.Tables[0].Rows[0]["Subject"].ToString();
                    TxtSubject.Enabled = false;
                    TxtTo.Text         = ds.Tables[0].Rows[0]["ToEmail"].ToString();
                }
                else if (Request.QueryString["val"].ToString() == "forward")
                {
                    TxtSubject.Text    = ds.Tables[0].Rows[0]["Subject"].ToString();
                    TxtSubject.Enabled = false;
                    txtBody.Text       = "<br/>---------- Forwarded message ----------<br/>From: " + BindControls.passwordDecrypt(Request.QueryString["From"].ToString(), "encryptionkey") + ds.Tables[0].Rows[0]["Text"].ToString();
                }
            }
            else if (Type == "ComposeMail")
            {
                ViewState["EmailIds"] = ds.Tables[0];
            }
        }
    }
Exemple #5
0
        private void LoadCustomer()
        {
            ClsSqlConnection obj   = new ClsSqlConnection();
            DataSet          objDS = obj.getCustomers();


            dataGridView1.DataSource = objDS.Tables[0];
        }
Exemple #6
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            ClsSqlConnection obj = new ClsSqlConnection();

            obj.deleteCustomer(txtCstmrName.Text);

            LoadCustomer();
            ClearData();
        }
    public void CallConnection()
    {
        ClsSqlConnection obj = new ClsSqlConnection();
        DataSet          ds  = obj.Select("spRegisterUserReport");

        if (ds.Tables.Count > 0)
        {
            BindControls.BindGridView(gvwUsers, ds.Tables[0]);
        }
    }
Exemple #8
0
        private void displayCustomer(string CustomerCode)
        {
            ClsSqlConnection obj        = new ClsSqlConnection();
            DataSet          objDataSet = obj.getCustomers(CustomerCode);



            string objCustName    = objDataSet.Tables[0].Rows[0][0].ToString();
            string objCustCountry = objDataSet.Tables[0].Rows[0][1].ToString();
            string objGender      = objDataSet.Tables[0].Rows[0][2].ToString();
            string objHobby       = objDataSet.Tables[0].Rows[0][3].ToString();
            bool   Married        = false;

            if (objDataSet.Tables[0].Rows[0][4] != DBNull.Value)
            {
                Married = Convert.ToBoolean(objDataSet.Tables[0].Rows[0][4].ToString());
            }



            txtCstmrName.Text = objCustName;
            cBoxCountry.Text  = objCustCountry;
            if ((objGender.Length == 0) || (objGender.Trim() == "Male"))
            {
                rbtnMale.Checked = true;
            }
            else
            {
                rbtnFemale.Checked = true;
            }

            if (objHobby.Trim() == "Reading")
            {
                chkbxReading.Checked  = true;
                chkbxPainting.Checked = false;
            }
            else
            {
                chkbxPainting.Checked = true;
                chkbxReading.Checked  = false;
            }

            if (Married)
            {
                rbtnMarried.Checked = true;
            }
            else
            {
                rbtnSingle.Checked = true;
            }
        }
Exemple #9
0
    public void CallConnection1()
    {
        ClsSqlConnection obj = new ClsSqlConnection();
        DataSet          ds  = obj.Select(Email_id.Text, newpass.Text, "", "ForgotPassword");

        if (ds.Tables.Count > 0)
        {
            if (ds.Tables[0].Rows[0]["Code"].ToString() == "200")
            {
                Session["Login"] = ds.Tables[0].Rows[0]["Login"].ToString();
                lblError.Text    = ds.Tables[0].Rows[0]["Message"].ToString();
            }
        }
    }
Exemple #10
0
    public void CallConnection(string sender)
    {
        string To  = "";
        string Cc  = "";
        string BCc = "";

        if (TxtTo.Text.Contains(','))
        {
            To = TxtTo.Text.Replace(",", ";");
        }
        else
        {
            To = TxtTo.Text;
        }
        if (TxtCc.Text.Contains(','))
        {
            Cc = TxtCc.Text.Replace(",", ";");
        }
        else
        {
            Cc = TxtCc.Text;
        }
        if (TxtBcc.Text.Contains(','))
        {
            BCc = TxtBcc.Text.Replace(",", ";");
        }
        else
        {
            BCc = TxtBcc.Text;
        }
        ClsSqlConnection obj    = new ClsSqlConnection();
        string           mailid = "";

        if (Session["ComeFrom"] != null)
        {
            if (Session["ComeFrom"].ToString() == "Drafts")
            {
                mailid = Session["DMaildId"].ToString();
            }
        }
        DataSet ds = obj.Insert(TxtSubject.Text, txtBody.Text, "192.168.1.1", Session["CustomerId"].ToString(), To, Cc, BCc, "", sender, mailid);

        if (ds.Tables.Count > 0)
        {
            Session.Remove("DMaildId");
            Session.Remove("ComeFrom");
        }
    }
 public void CallConnection(string MailType)
 {
     if (Session["Data"] == null)
     {
         ClsSqlConnection obj = new ClsSqlConnection();
         DataSet          ds  = obj.Select(int.Parse(Session["CustomerId"].ToString()), MailType);
         if (ds.Tables.Count > 0)
         {
             BindControls.BindGridView(gvwMails, ds.Tables[0]);
         }
     }
     else if (Session["Data"] != null)
     {
         BindControls.BindGridView(gvwMails, (Session["Data"] as DataSet).Tables[0]);
         Session["Data"] = null;
     }
 }
Exemple #12
0
        private void btnSearch_Click(object sender, EventArgs e)
        {
            CommonCode obj = new CommonCode();

            if (obj.Validate(txtCustomerName.Text) == false)
            {
                MessageBox.Show("Customer name is compulsory");
                return;
            }

            ClsSqlConnection obj1 = new ClsSqlConnection();

            DataSet objDS = obj1.getCustomers(txtCustomerName.Text);


            dataGridView1.DataSource = objDS.Tables[0];
        }
    public void CallConnection()
    {
        ClsSqlConnection obj = new ClsSqlConnection();
        DataSet          ds  = obj.Select(Session["Login"].ToString(), newpass.Text, currpass.Text, "ChangePassword");

        if (ds.Tables.Count > 0)
        {
            if (ds.Tables[0].Rows[0]["Code"].ToString() == "200")
            {
                Session["Login"] = ds.Tables[0].Rows[0]["Login"].ToString();
                Response.Redirect("~/Masters/ViewMail.aspx");
            }
            else if (ds.Tables[0].Rows[0]["Code"].ToString() == "404")
            {
                lblError.Text = ds.Tables[0].Rows[0]["Message"].ToString();
            }
        }
    }
    public void CallConnection(int id, string MailType)
    {
        ClsSqlConnection obj = new ClsSqlConnection();
        DataSet          ds  = obj.Select(id, MailType);

        Session["Data"] = ds;
        if (MailType == "ReadMail")
        {
            if (ds.Tables.Count > 0)
            {
                BindControls.BindFormView(frmReadMail, ds.Tables[0]);
            }
        }
        else
        {
            Response.Redirect("~/Masters/ViewMail.aspx");
        }
    }
    public void CallConnection()
    {
        ClsSqlConnection obj = new ClsSqlConnection();
        DataSet          ds  = obj.Insert1(txtFirstName.Text, txtLastName.Text, txtEmailAddress.Text, datepicker.Text, rblGender.SelectedItem.Text, txtMobileNo.Text, txtHint.Text, txtPassword.Text);

        if (ds.Tables.Count > 0)
        {
            if (ds.Tables[0].Rows[0]["code"].ToString() == "200")
            {
                txtCaptcha.Text         = txtFirstName.Text = txtLastName.Text = txtEmailAddress.Text = datepicker.Text = txtMobileNo.Text = txtHint.Text = txtPassword.Text = "";
                rblGender.SelectedIndex = 0;
            }
            else
            {
                lblCaptcha.Text = Guid.NewGuid().ToString().Substring(0, 5);
                txtCaptcha.Text = "";
            }
            lblError.Text = ds.Tables[0].Rows[0]["Message"].ToString();
        }
    }
 public void CallConnectionDelete(int MailDetailId)
 {
     ClsSqlConnection obj = new ClsSqlConnection();
     DataSet          ds  = obj.Delete(MailDetailId, BindControls.HoldMailType);
 }
Exemple #17
0
        private void btnSubmit_Click(object sender, EventArgs e)
        {
            CommonCode obj = new CommonCode();

            if (obj.Validate(txtCstmrName.Text) == false)
            {
                MessageBox.Show("Customer name is compulsory");

                return;
            }

            string sex = "";

            if (rbtnMale.Checked == true)
            {
                sex = "Male";
            }
            else if (rbtnFemale.Checked == true)
            {
                sex = "Female";
            }
            else
            {
                MessageBox.Show("Select a gender"); return;
            }

            string hobbies = "No hobbies";

            if (chkbxReading.Checked == true)
            {
                hobbies = "Reading";
            }
            else if (chkbxPainting.Checked == true)
            {
                hobbies = "Painting";
            }

            string status = "";

            if (rbtnMarried.Checked == true)
            {
                status = "1";
            }
            else if (rbtnSingle.Checked == true)
            {
                status = "0";
            }
            else
            {
                MessageBox.Show("Select a status"); return;
            }
            string stat = "";

            if (status == "0")
            {
                stat = "Single";
            }
            else
            {
                stat = "Married";
            }

            /*  FrmcstmrPreview PreObj = new FrmcstmrPreview();
             * PreObj.getValues(txtCstmrName.Text, cBoxCountry.Text.ToString(), sex, hobbies, stat);
             *
             * PreObj.ShowDialog();
             */
            ClsSqlConnection obj1 = new ClsSqlConnection();

            obj1.insertCustomers(txtCstmrName.Text, cBoxCountry.Text, sex, hobbies, status);
            LoadCustomer();
            ClearData();
        }