protected void QuoteDetails()
    {
        string conf;

        FetchEmails();
        qry = "SELECT * FROM tblConfirmation WHERE ReqId='" + reqid + "'";
        SqlDataReader dr = ClassHome.getRecords(qry);

        if (dr.Read())
        {
            conf        = dr.GetValue(1).ToString();
            Label1.Text = conf;
            if (Label1.Text == "Yes")
            {
                Label2.Visible      = false;
                Label3.Visible      = false;
                Label1.Visible      = true;
                sendEMail.Visible   = false;
                btnEndchat1.Visible = false;
                Label1.Text         = "The quote you send was accepted by the customer and sent you following details for appointment";
                Panel2.Visible      = true;
            }
            else
            {
                FetchQuote();
                Label2.Visible   = true;
                Label3.Visible   = true;
                Panel1.Visible   = true;
                Label1.Visible   = true;
                Label1.ForeColor = System.Drawing.Color.Red;
                Label1.Text      = "Unfortunately!! Your quote was not accepted by the customer.";
            }
        }
    }
Ejemplo n.º 2
0
    protected void FetchAndTransferChat()
    {
        qry = "SELECT * FROM tblChat WHERE ReqId=" + Request.QueryString["id"];
        SqlDataReader dr = ClassHome.getRecords(qry);

        if (dr.Read())
        {
            reqid         = dr.GetValue(1).ToString();
            sender        = dr.GetValue(2).ToString();
            chatMsg       = dr.GetValue(3).ToString();
            customeremail = dr.GetValue(4).ToString();
            provideremail = dr.GetValue(5).ToString();
        }
        else
        {
        }

        qry = "INSERT INTO tblEndedChats (EReqId,ESender,EChatMsg,ECustomerEmail,EProviderEmail) VALUES ('" + reqid + "', '" + sender + "', '" + chatMsg + "', '" + customeremail + "','" + provideremail + "')";
        int i = ClassHome.setRecords(qry);

        qry = "DELETE FROM tblChat WHERE ReqId='" + reqid + "'";
        int p = ClassHome.setRecords(qry);

        qry = "DELETE FROM tblCustomerRequest WHERE ReqId = '" + reqid + "'";
        int r = ClassHome.setRecords(qry);
    }
    protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
    {
        qry = "SELECT * FROM tblServiceProvider WHERE SPID='" + GridView1.SelectedRow.Cells[1].Text + "'";
        SqlDataReader dr = ClassHome.getRecords(qry);

        if (dr.Read())
        {
            txtStore.Text    = dr.GetValue(1).ToString();
            txtName.Text     = dr.GetValue(2).ToString();
            txtPhone.Text    = dr.GetValue(3).ToString();
            txtUserName.Text = dr.GetValue(4).ToString();
            txtPassword.Text = dr.GetValue(5).ToString();
            txtAddress.Text  = dr.GetValue(6).ToString();
            txtEmail.Text    = dr.GetValue(7).ToString();
            ddlProviderType.SelectedValue = dr.GetValue(8).ToString();
            txtLic.Text       = dr.GetValue(9).ToString();
            txtDriverLic.Text = dr.GetValue(10).ToString();
            txtReference.Text = dr.GetValue(11).ToString();


            btnSubmit.Text    = "Update";
            btnDelete.Visible = true;

            pnlView.Visible  = false;
            pnlTable.Visible = true;
        }
        dr.Close();
    }
    protected void FillGrid()
    {
        qry = "SELECT RejSPID AS [ID],RejSPStoreName AS [Store Name] , RejSPName AS [Provider Name], RejSPPhone AS [Phone], RejSPAddress AS [Address], RejSPEmail AS [Email], SPType AS [Category], RejSPLic AS [Licence Number] FROM viewRejectedSP";
        SqlDataReader dr = ClassHome.getRecords(qry);

        GridView1.DataSource = dr;
        GridView1.DataBind();
    }
    protected void FillGrid()
    {
        qry = "SELECT EmpID AS [ID], EmpName AS [Emp Name], EmpPhone AS [Emp Phone], EmpUserName AS [Emp UserName], EmpPassword AS [Emp Password], EmpAddress AS [Emp Address], EmpEmail AS [Emp Email], EmpType AS [Emp Type] FROM viewEmployee";
        SqlDataReader dr = ClassHome.getRecords(qry);

        GridView1.DataSource = dr;
        GridView1.DataBind();
    }
    protected void FillGrid()
    {
        qry = "SELECT CustomerId AS [ID], CustomerName AS [Customer Name], CustomerUName AS [User Name], CustomerPass AS [Password], CustomerEmail AS [Email ID], CustomerPhone AS [Phone Number], CustomerAddress AS [Address] FROM tblCustomer";
        SqlDataReader dr = ClassHome.getRecords(qry);

        GridView1.DataSource = dr;
        GridView1.DataBind();
    }
    protected void FillGrid()
    {
        qry = "SELECT SPID AS [ID],SPStoreName AS [Store Name] , SPName AS [Provider Name], SPPhone AS [Phone], SPUserName AS [UserName], SPPassword AS [Password], SPAddress AS [Address], SPEmail AS [Email], SPType AS [Category], SPLic AS [Licence Number], SPDriverLic AS [Driver's Lic], SPReferences AS [References] FROM viewServiceProvider";
        SqlDataReader dr = ClassHome.getRecords(qry);

        GridView1.DataSource = dr;
        GridView1.DataBind();
    }
    protected void btnSearch_Click(object sender, EventArgs e)
    {
        qry = "SELECT CustomerId AS [ID], CustomerName AS [Customer Name], CustomerUName AS [User Name], CustomerPass AS [Password], CustomerEmail AS [Email ID], CustomerPhone AS [Phone Number], CustomerAddress AS [Address] FROM tblCustomer WHERE CustomerPhone LIKE '" + txtSearchCompany.Text + "%'";
        SqlDataReader dr = ClassHome.getRecords(qry);

        GridView1.DataSource = dr;
        GridView1.DataBind();
    }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         FillGrid();
         qry = "SELECT DISTINCT([SPType]) FROM[tblServiceProviderType]";
         SqlDataReader dr = ClassHome.getRecords(qry);
         ddlSearchCategory.DataSource = dr;
         ddlSearchCategory.DataBind();
         ddlSearchCategory.Items.Insert(0, "-- select --");
     }
 }
Ejemplo n.º 10
0
    /* public void FillGrid()
     * {
     * SqlConnection con = new SqlConnection(@"Data Source = (LocalDB)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\HomeSol.mdf;Integrated Security=True");
     * qry = "SELECT * FROM tblChat WHERE ReqId=" + Request.QueryString["id"];
     * SqlDataReader dr = ClassHome.getRecords(qry);
     * GridView1.DataSource = dr;
     * GridView1.DataBind();
     * }*/
    public void FetchEmails()
    {
        qry = "SELECT * FROM tblChat WHERE ReqId=" + Request.QueryString["id"];
        SqlDataReader dr = ClassHome.getRecords(qry);

        if (dr.Read())
        {
            reqid         = dr.GetValue(1).ToString();
            customeremail = dr.GetValue(4).ToString();
            provideremail = dr.GetValue(5).ToString();
            Label1.Text   = customeremail;
            Label2.Text   = provideremail;
        }
    }
    protected void FetchQuote()
    {
        FetchEmails();
        qry = "SELECT * FROM tblQuote WHERE ReqId=" + reqid;
        SqlDataReader dr = ClassHome.getRecords(qry);

        if (dr.Read())
        {
            quoteid         = dr.GetValue(0).ToString();
            quote           = dr.GetValue(1).ToString();
            Label2.Text     = quote;
            lblQuoteId.Text = quoteid;
        }
    }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (Session["utype"].ToString() == "Reception")
         {
             Response.Redirect("EmployeeDash.aspx");
         }
         qry = "SELECT DISTINCT([SPType]) FROM[tblServiceProviderType]";
         SqlDataReader dr = ClassHome.getRecords(qry);
         ddlSearchCategory.DataSource = dr;
         ddlSearchCategory.DataBind();
         ddlSearchCategory.Items.Insert(0, "-- select --");
     }
 }
    protected void btnSearch_Click(object sender, EventArgs e)
    {
        if (ddlSearchCategory.SelectedIndex == 0)
        {
            qry = "SELECT RejSPID AS [ID], RejSPStoreName AS [Store Name] , RejSPName AS [Provider Name], RejSPPhone AS [Phone], RejSPAddress AS [Address], RejSPEmail AS [Email], SPType AS [Category], RejSPLic AS [Licence Number] FROM viewRejectedSP WHERE RejSPStoreName LIKE '" + txtSearchCompany.Text + "%'";
        }
        else
        {
            qry = "SELECT RejSPID AS [ID], RejSPStoreName AS [Store Name] , RejSPName AS [Provider Name], RejSPPhone AS [Phone], RejSPAddress AS [Address], RejSPEmail AS [Email], SPType AS [Category], RejSPLic AS [Licence Number] FROM viewRejectedSP WHERE RejSPStoreName LIKE '" + txtSearchCompany.Text + "%' AND SPType='" + ddlSearchCategory.SelectedValue + "'";
        }
        SqlDataReader dr = ClassHome.getRecords(qry);

        GridView1.DataSource = dr;
        GridView1.DataBind();
    }
    protected void btnLogin_Click(object sender, EventArgs e)
    {
        Session["uname"] = txtName.Text;

        query = "SELECT * FROM viewEmployee WHERE EmpUserName='******' AND EmpPassword='******'";
        SqlDataReader dr = ClassHome.getRecords(query);

        if (dr.Read())
        {
            Session["utype"] = dr.GetValue(8).ToString();
            Response.Redirect("EmployeeDash.aspx");
        }
        else
        {
            lblMsg.Text = "Invalid UserName or Password";
        }
        dr.Close();
    }
    public void FetchEmails()
    {
        Label lbl1 = DataList1.Items[0].FindControl("lblRequest") as Label;

        chatMsg = lbl1.Text;
        Label  lbl      = DataList1.Items[0].FindControl("lblReqId") as Label;
        string lblreqid = lbl.Text;

        qry = "SELECT * FROM tblChat WHERE ReqId=" + lblreqid;
        SqlDataReader dr = ClassHome.getRecords(qry);

        if (dr.Read())
        {
            reqid         = dr.GetValue(1).ToString();
            sender1       = dr.GetValue(2).ToString();
            customeremail = dr.GetValue(4).ToString();
            provideremail = dr.GetValue(5).ToString();
        }
    }
    protected void sendEMail_Click1(object sender, EventArgs e)
    {
        Label             lbl        = DataList1.Items[0].FindControl("lblEmail") as Label;
        string            lbltext    = lbl.Text;
        Label             lbl1       = DataList1.Items[0].FindControl("lblName") as Label;
        string            lblname    = lbl1.Text;
        Label             lbl2       = DataList1.Items[0].FindControl("lblStoreName") as Label;
        string            lblstore   = lbl2.Text;
        Label             lbl3       = DataList1.Items[0].FindControl("lblPhone") as Label;
        string            lblphone   = lbl3.Text;
        Label             lbl4       = DataList1.Items[0].FindControl("lblAddress") as Label;
        string            lbladdress = lbl4.Text;
        NetworkCredential loginInfo  = new NetworkCredential("*****@*****.**", "homesolutions");
        MailMessage       msg        = new MailMessage();
        string            text       = "Hello!! " + lblname + " You got one new request from customer:\n" + txtContent.Text +
                                       @"<html> <body> <br><hr/> Thanks and Regards <br> <b>Home Solutions and Co. </b></body> </html> ";

        msg.From = new MailAddress("*****@*****.**");
        msg.To.Add(new MailAddress(lbltext)); //the email id where you need to send email.
        msg.Subject    = "Update on your application in Home Solutions";
        msg.Body       = text;
        msg.IsBodyHtml = true;
        SmtpClient client = new SmtpClient("smtp.gmail.com", 587);

        client.EnableSsl             = true;
        client.UseDefaultCredentials = false;
        client.Credentials           = loginInfo;
        client.Send(msg);
        InsertDetails();
        string reqid, msg1;

        qry = "SELECT * FROM tblCustomerRequest WHERE CustPhone = '" + custphone + "'";
        SqlDataReader dr = ClassHome.getRecords(qry);

        if (dr.Read())
        {
            reqid = dr.GetValue(0).ToString();
            msg1  = dr.GetValue(5).ToString();
            qry   = "INSERT INTO tblChat (ReqId,Sender,ChatMsg,CustomerEmail,ProviderEmail) VALUES ('" + reqid + "','" + custname + "','" + msg1 + "','" + custemail + "', '" + lbltext + "')";
            int p = ClassHome.setRecords(qry);
        }
        Response.Redirect("Dashboard.aspx");
    }
Ejemplo n.º 17
0
    protected void GridView1_SelectedIndexChanged1(object sender, EventArgs e)
    {
        qry = "SELECT * FROM viewPreServiceProvider WHERE PreSPID='" + GridView1.SelectedRow.Cells[1].Text + "'";
        SqlDataReader dr = ClassHome.getRecords(qry);

        if (dr.Read())
        {
            lblStoreName.Text  = dr.GetValue(1).ToString();
            lblName.Text       = dr.GetValue(2).ToString();
            lblPhone.Text      = dr.GetValue(3).ToString();
            lblEmail.Text      = dr.GetValue(5).ToString();
            lblAddress.Text    = dr.GetValue(4).ToString();
            lblLic.Text        = dr.GetValue(7).ToString();
            lblType.Text       = dr.GetValue(10).ToString();
            lblTypeID.Text     = dr.GetValue(6).ToString();
            lblDriverLic.Text  = dr.GetValue(8).ToString();
            lblReferences.Text = dr.GetValue(9).ToString();
        }
        dr.Close();
    }
    protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
    {
        qry = "SELECT * FROM tblCustomer WHERE CustomerId='" + GridView1.SelectedRow.Cells[1].Text + "'";
        SqlDataReader dr = ClassHome.getRecords(qry);

        if (dr.Read())
        {
            txtName.Text     = dr.GetValue(1).ToString();
            txtUserName.Text = dr.GetValue(2).ToString();
            txtPassword.Text = dr.GetValue(3).ToString();
            txtEmail.Text    = dr.GetValue(4).ToString();
            txtPhone.Text    = dr.GetValue(5).ToString();
            txtAddress.Text  = dr.GetValue(6).ToString();

            btnSubmit.Text    = "Update";
            btnDelete.Visible = true;

            pnlView.Visible  = false;
            pnlTable.Visible = true;
        }
        dr.Close();
    }
    protected void btnConfirm_Click(object sender, EventArgs e)
    {
        string ProviderStore, CustomerName, CustomerPhone, ProviderPhone, CustomerAddress, CustomerQuery, QuoteAmount;

        qry = "SELECT * FROM tblAppointment WHERE ApptId=" + Request.QueryString["id"];
        SqlDataReader dr = ClassHome.getRecords(qry);

        if (dr.Read())
        {
            ProviderStore   = dr.GetValue(1).ToString();
            CustomerName    = dr.GetValue(2).ToString();
            CustomerPhone   = dr.GetValue(3).ToString();
            ProviderPhone   = dr.GetValue(4).ToString();
            CustomerAddress = dr.GetValue(5).ToString();
            CustomerQuery   = dr.GetValue(6).ToString();
            QuoteAmount     = dr.GetValue(7).ToString();
            qry             = "INSERT INTO tblComplete (ProviderStore,CustomerName,CustomerPhone,ProviderPhone,CustomerAddress,CustomerQuery,QuoteAmount) VALUES ('" + ProviderStore + "','" + CustomerName + "','" + CustomerPhone + "','" + ProviderPhone + "','" + CustomerAddress + "','" + CustomerQuery + "','" + QuoteAmount + "')";
            int i = ClassHome.setRecords(qry);
            qry = "DELETE FROM tblAppointment WHERE ApptId=" + Request.QueryString["id"];
            int p = ClassHome.setRecords(qry);
        }
        Response.Redirect("CompletedRequests.aspx");
    }
    protected void FetchDetails()
    {
        Label lbl1 = DataList1.Items[0].FindControl("lblProviderPhone") as Label;

        providerphone = lbl1.Text;
        Label lbl2 = DataList1.Items[0].FindControl("lblStoreName") as Label;

        providerstore = lbl2.Text;
        Label lbl4 = DataList1.Items[0].FindControl("lblCustomerQuery") as Label;

        customerquery = lbl4.Text;
        Label lbl5 = DataList1.Items[0].FindControl("lblQuote") as Label;

        quote = lbl5.Text;

        qry = "SELECT * FROM tblServiceProvider WHERE SPPhone=" + providerphone;
        SqlDataReader dr = ClassHome.getRecords(qry);

        if (dr.Read())
        {
            provideremail = dr.GetValue(7).ToString();
        }
    }
Ejemplo n.º 21
0
    protected void btnLogin_Click(object sender, EventArgs e)
    {
        string password = txtPwd.Text;
        string enc      = encryption(password);

        query = "SELECT * FROM tblCustomer WHERE CustomerUName='" + txtName.Text + "' AND CustomerPass='******'";
        SqlDataReader dr = ClassHome.getRecords(query);

        if (dr.Read())
        {
            Session["CustName"]    = dr.GetValue(1).ToString();
            Session["CustEmail"]   = dr.GetValue(4).ToString();
            Session["CustPhone"]   = dr.GetValue(5).ToString();
            Session["CustAddress"] = dr.GetValue(6).ToString();
            Session["uname"]       = txtName.Text;
            Response.Redirect("Dashboard.aspx");
        }
        else
        {
            lblMsg.Text = "Invalid UserName or Password";
        }
        dr.Close();
    }
Ejemplo n.º 22
0
    protected void CheckQuote()
    {
        string quote;

        qry = "SELECT * FROM tblQuote where Reqid =" + Request.QueryString["id"];
        SqlDataReader dr = ClassHome.getRecords(qry);

        if (dr.Read())
        {
            quote            = dr.GetValue(1).ToString();
            lblQuote.Text    = "Provider Sent you the quote: $" + quote;
            lblQuote.Visible = true;
        }

        if (lblQuote.Text == "Label")
        {
        }
        else
        {
            lblQuote.Visible = true;
            Panel1.Visible   = false;
            Panel3.Visible   = true;
        }
    }
    protected void btnSendAppt_Click(object sender, EventArgs e)
    {
        string CustomerName, CustomerPhone, ProviderName, ProviderPhone, CustomerAddress, CustomerQuery;

        FetchQuote();
        qry = "SELECT * FROM tblCustomerRequest WHERE ReqId=" + reqid;
        SqlDataReader dr = ClassHome.getRecords(qry);

        if (dr.Read())
        {
            CustomerName    = dr.GetValue(1).ToString();
            CustomerPhone   = dr.GetValue(2).ToString();
            ProviderName    = dr.GetValue(8).ToString();
            ProviderPhone   = dr.GetValue(10).ToString();
            CustomerAddress = dr.GetValue(4).ToString();
            CustomerQuery   = dr.GetValue(5).ToString();
            qry             = "INSERT INTO tblAppointment (ProviderStore,CustomerName,CustomerPhone,ProviderPhone,CustomerAddress,CustomerQuery,QuoteAmount,Date,TIME) VALUES('" + ProviderName + "','" + CustomerName + "','" + CustomerPhone + "','" + ProviderPhone + "','" + CustomerAddress + "','" + CustomerQuery + "','" + Label2.Text + "','" + txtApp.Text + "','" + txtApptime.Text + "')";
            int i = ClassHome.setRecords(qry);
        }
        qry = "DELETE FROM tblCustomerRequest WHERE ReqId=" + reqid;
        int r = ClassHome.setRecords(qry);

        Response.Redirect("ProviderAppointmentDetails.aspx");
    }
Ejemplo n.º 24
0
    protected void btnLogin_Click(object sender, EventArgs e)
    {
        string password = txtPass.Text;
        string enc      = encryption(password);

        query = "SELECT * FROM tblServiceProvider WHERE SPUserName='******' AND SPPassword='******'";
        SqlDataReader dr = ClassHome.getRecords(query);

        if (dr.Read())
        {
            Session["ProviderStore"]   = dr.GetValue(1).ToString();
            Session["ProviderName"]    = dr.GetValue(2).ToString();
            Session["ProviderEmail"]   = dr.GetValue(7).ToString();
            Session["ProviderPhone"]   = dr.GetValue(3).ToString();
            Session["ProviderAddress"] = dr.GetValue(6).ToString();
            Session["uname"]           = txtName.Text;
            Response.Redirect("ServiceProviderDash.aspx");
        }
        else
        {
            lblMsg.Text = "Invalid UserName or Password";
        }
        dr.Close();
    }