示例#1
0
        private void button2_Click(object sender, EventArgs e)
        {
            bool      sucess = dcDAL.Updatesoln(qid, textsoln.Text);
            emailsBLL email  = new emailsBLL();

            email.to      = txtemail.Text;
            email.subject = "Solidworks support query id =" + qid;
            string body = "<h3>" + "Query- \n " + "</h3>" + "<b>" + textqry.Text + "</b>" + "<h3>" + " \n\n Solution- \n" + "</h3>" + "<b>" + textsoln.Text + "</b>" + "\n\n\n\n\n";

            email.body = body;
            email.name = txtu_Name.Text;
            bool sucess1 = eDAL.sendemail(email);

            if (sucess1 == true)
            {
                MessageBox.Show("email sent sucessfully");
            }
            else
            {
                MessageBox.Show("email not sent");
            }
            //Calling the Clear Method

            if (sucess == true)
            {
                MessageBox.Show("query updated ");
            }
            else
            {
                MessageBox.Show("unable to update query");
            }
        }
示例#2
0
        public bool  sendemail(emailsBLL m)
        {
            bool   sucess    = true;
            string signature = ReadSignature();

            try
            {
                outlook._Application _app = new outlook.Application();
                outlook.MailItem     mail = (outlook.MailItem)_app.CreateItem(outlook.OlItemType.olMailItem);
                mail.BodyFormat = outlook.OlBodyFormat.olFormatHTML;

                mail.To      = m.to;
                mail.Subject = m.subject;
                string body = "<html><body>" + "Kind attention  Mr. " + "<b>" + m.name + "\n\n thank you for contacting Iris Hightech Technical support. A seervice request has been genrated as below:" + "</b>" + m.body + "<span style='font-size:10.0pt;color:#578a90'>this is a system generated mail and query will be closed by itself in the next 24 hours if no response is received by recipients\n\n</span>" + "<span style='color:#1F497D'> Regards</span> \n <span style='font-size:14.0pt;color:#1F497D'>SOLIDWORKS Technical Support</span> \n <span style='color:#1F497D'>Phone no: 011 - 48175001, 011 - 47005616 </span>\n <span style='color:#1F497D'>Email: [email protected] </span>\n<span style='font-size:13.0pt;color:#C00000'> Iris Hightech Private Limited </span>\n <span style='font-size:10.0pt;color:#C00000'>(Authorized Value Added Reseller & Training Centre - SolidWorks - CAM - MakerBot 3D Printer)</span>" + "</body></html>" + "";
                body            = body.Replace("\n", "<br/>");
                mail.HTMLBody   = body;
                mail.Importance = outlook.OlImportance.olImportanceNormal;
                ((outlook.MailItem)mail).Send();
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "message", MessageBoxButtons.OK, MessageBoxIcon.Error);
                sucess = false;
            }
            finally
            {
            }
            return(sucess);
        }
示例#3
0
        private async void button2_Click(object sender, EventArgs e)
        {
            button4_Click(this, new EventArgs());
            await System.Threading.Tasks.Task.Delay(2000);

            OpenFileDialog file = new OpenFileDialog(); //open dialog to choose file
            //if there is a file choosen by the user
            {
                c = dc.Search(companydeact);
                emailsBLL email = new emailsBLL();
                // txtemail.Text = c.c_email;
                email.to      = txtemail.Text;
                email.subject = "solidworks deactivation form ";
                string body = "<span style='color:#1F497D'>Dear Sir,</span> \n<span style='color:#1F497D'>As per our discussion, please find the attached deactivation form.</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='color:#1F497D'>Please sign and stamp and revert it asap.<o:p></o:p></span></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='color:#1F497D'>It will take 24-48 hours to process the request.</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><o:p>&nbsp;</o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><b><span style='color:#1F497D'>In case of any query, feel free to contact us.</span></b><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><b><span style='color:#1F497D'>&nbsp;</span></b><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><b><span style='color:#1F497D'>Technical Support Team</span></b><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='color:#1F497D'>IRIS HIGHTECH PRIVATE LIMITED</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='color:#1F497D'>Contact: mailto [email protected]" + "<span style='color:#6666FF'>[email protected]</span></a><span style='color:#1F497D'> || 011-48175001, 011- 47005616</span><o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p></div> " + "\n\n\n\n\n";
                email.body       = body;
                email.name       = companydeact;
                email.attachment = createandsendpath;
                bool sucess = em.senddeactivationform(email);
                if (sucess == true)
                {
                    MessageBox.Show("email sent sucessfully");
                }
                else
                {
                    MessageBox.Show("email not sent");
                }
            }
        }
示例#4
0
        private void button5_Click(object sender, EventArgs e)
        {
            OpenFileDialog file  = new OpenFileDialog(); //open dialog to choose file
            string         templ = file.FileName;

            c = dc.Search(companydeact);
            emailsBLL email = new emailsBLL();

            //txtemail.Text = c.c_email;
            email.to      = txtemail.Text;
            email.subject = "solidworks deactivation form ";
            string body = "<span style='color:#1F497D'>Dear Sir,</span> \n<span style='color:#1F497D'>As per our discussion, please find the attached deactivation form.</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='color:#1F497D'>Please sign and stamp and revert it asap.<o:p></o:p></span></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='color:#1F497D'>It will take 24-48 hours to process the request.</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><o:p>&nbsp;</o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><b><span style='color:#1F497D'>In case of any query, feel free to contact us.</span></b><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><b><span style='color:#1F497D'>&nbsp;</span></b><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><b><span style='color:#1F497D'>Technical Support Team</span></b><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='color:#1F497D'>IRIS HIGHTECH PRIVATE LIMITED</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='color:#1F497D'>Contact: </span><a href=\"mailto:swsupport @irishightech.com\" target=\"_blank\"><span style='color:#6666FF'>[email protected]</span></a><span style='color:#1F497D'> || 011-48175001, 011- 47005616</span><o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p></div> " + "\n\n\n\n\n";

            email.body       = body;
            email.name       = companydeact;
            email.attachment = templ;
            bool sucess = em.senddeactivationform(email);

            if (sucess == true)
            {
                MessageBox.Show("email sent sucessfully");
            }
            else
            {
                MessageBox.Show("email not sent");
            }
        }
示例#5
0
        public bool senddeactivationform(emailsBLL m)
        {
            bool   sucess    = true;
            string signature = ReadSignature();

            try
            {
                outlook._Application _app = new outlook.Application();
                outlook.MailItem     mail = (outlook.MailItem)_app.CreateItem(outlook.OlItemType.olMailItem);
                mail.BodyFormat = outlook.OlBodyFormat.olFormatHTML;

                mail.To      = m.to;
                mail.Subject = m.subject;
                string body = "<html><body>" + m.body + "<span style='font-size:10.0pt;color:#578a90'>this is a system generated mail and query will be closed by itself in the next 24 hours if no response is received by recipients\n\n</span>";
                body          = body.Replace("\n", "<br/>");
                mail.HTMLBody = body;
                if (string.IsNullOrEmpty(m.attachment) == false)
                {
                    // need to check to see if file exists before we attach !
                    if (!File.Exists(m.attachment))
                    {
                        MessageBox.Show("Attached document " + m.attachment + " does not exist", "File Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                    else
                    {
                        mail.Attachments.Add(m.attachment, outlook.OlAttachmentType.olByValue, 1, "vaibhav.pdf");
                    }
                }
                //mail.Display();     // display the email
                mail.Importance = outlook.OlImportance.olImportanceNormal;
                ((outlook.MailItem)mail).Send();
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "message", MessageBoxButtons.OK, MessageBoxIcon.Error);
                sucess = false;
            }
            finally
            {
            }
            return(sucess);
        }
示例#6
0
        private void Form1_Load(object sender, EventArgs e)
        {
            locationsBLL l  = new locationsBLL();
            locationDAL  ld = new locationDAL();



            c = dc.Search(companydeact);
            emailsBLL email = new emailsBLL();

            txtemail.Text   = c.c_email;
            txtcompany.Text = c.c_name;
            l = ld.search("template");
            lbltemplate.Text = l.location;
            filePath         = lbltemplate.Text;
            l             = ld.search("save deactivation");
            lblsave.Text  = l.location;
            filepathemail = lblsave.Text;
            savepath      = lblsave.Text;
        }
示例#7
0
        private void button3_Click(object sender, EventArgs e)
        {
            string   keyword = txtu_Name.Text;
            queryBLL q       = new queryBLL();

            bool    qsucess = tDAL.chkcustumer(keyword);
            custBLL dc      = tDAL.searchcustumer(keyword);

            if (qsucess == true)
            {
                keyword = txtcompany.Text;
                companysBLL c = pDAL.Search(keyword);
                q.ques     = textqry.Text;
                q.soln     = textsoln.Text;
                q.cu_id    = dc.id;
                q.c_id     = dc.cid;
                q.u_name   = dc.name;
                emailname  = q.u_name;
                q.u_mobile = dc.mobile;
                dc.nquery  = dc.nquery++;
                bool incquery = tDAL.Increasenoofquery(dc); if (incquery == true)
                {
                    MessageBox.Show("user and query updated");
                }
                else
                {
                    MessageBox.Show("user and query not updated");
                }
                q.status = 1;
                bool success = dcDAL.Insert(q);
                q    = dcDAL.Getqueryforsearch(q);
                qid  = q.q_id;
                qid1 = q.q_id;
            }

            if (qsucess == false)
            {
                keyword = txtcompany.Text;
                bool csucess = pDAL.chkcompanybyname(keyword);
                if (csucess == true)
                {
                    keyword = txtcompany.Text;
                    companysBLL c = pDAL.Search(keyword);

                    custBLL ca = new custBLL();
                    ca.name   = txtu_Name.Text;
                    emailname = q.u_name;
                    ca.mobile = txtu_Contact.Text;
                    string type = "user";
                    ca.type  = type;
                    ca.email = txtemail.Text;
                    bool isadded = false;
                    int  id      = c.id;
                    ca.cid    = id;
                    ca.nquery = 0;
                    isadded   = tDAL.Insert(ca);
                    if (isadded == true)
                    {
                        MessageBox.Show("new user added");
                    }
                    else
                    {
                        MessageBox.Show("new user can not be added");
                    }
                }

                else
                {
                    MessageBox.Show("plz add new company");
                    addcompanys ca = new addcompanys();
                    ca.Show();
                }

                //space to add new user(custumer)
                //addnewcostumer costumer = new addnewcostumer();
                //costumer.Show();
                //this.Hide();
                //MessageBox.Show("plz add new costumer");
                //Failed to Add New product
                //MessageBox.Show("new user added");
            }


            //if the product is added successfully then the value of success will be true else it will be false
            if (qsucess == true)
            {
                //Product Inserted Successfully
                MessageBox.Show("query Added Successfully");


                emailsBLL email = new emailsBLL();
                email.to      = txtemail.Text;
                email.subject = "solidworks support query " + qid;
                string body = "<h3>" + "query- \n " + "</h3>" + "<b>" + textqry.Text + "</b>" + "<h3>" + " \n\n solution- \n" + "</h3>" + "<b>" + textsoln.Text + "</b>" + "\n\n\n\n\n";
                email.body = body;
                email.name = txtu_Name.Text;
                bool sucess = eDAL.sendemail(email);
                if (sucess == true)
                {
                    MessageBox.Show("email sent sucessfully");
                }
                else
                {
                    MessageBox.Show("email not sent");
                }
                //Calling the Clear Method
            }
        }
示例#8
0
        private void button4_Click(object sender, EventArgs e)
        {
            string   keyword = txtu_Name.Text;
            queryBLL q       = new queryBLL();

            bool    qsucess = tDAL.chkcustumer(keyword);//chking costumer
            custBLL dc      = tDAL.searchcustumer(keyword);

            if (qsucess == true)// if costumer is found
            {
                keyword = txtcompany.Text;
                companysBLL c = pDAL.Search(keyword);
                q.ques     = textqry.Text;
                q.soln     = textsoln.Text;
                q.cu_id    = dc.id;
                q.c_id     = dc.cid;
                q.u_name   = dc.name;
                emailname  = q.u_name;
                q.u_mobile = dc.mobile;
                dc.nquery  = dc.nquery++;
                q.status   = 0;
                q.datetime = DateTime.Now;
                bool success  = dcDAL.Insert(q);
                bool incquery = tDAL.Increasenoofquery(dc); if (incquery == true)
                {
                    MessageBox.Show("user and query updated");
                }
                else
                {
                    MessageBox.Show("user and query not updated");
                }
                emailname = q.u_name;
                q         = dcDAL.Getqueryforsearch(q);
                qid       = q.q_id;
                if (success == true)
                {
                    //Product Inserted Successfully
                    MessageBox.Show("query Added Successfully");
                    emailsBLL email = new emailsBLL();
                    email.to      = txtemail.Text;
                    email.subject = "solidworks support query " + qid;
                    string body = "<h3>" + "SR NO." + DateTime.Today + "  " + qid + "query- \n " + "</h3>" + "<b>" + textqry.Text + "</b>" + "<h3>" + " \n\n solution- \n" + "</h3>" + "<b>" + textsoln.Text + "</b>" + "\n\n\n\n\n";
                    email.body = body;
                    email.name = txtu_Name.Text;
                    bool sucess = eDAL.sendemail(email);
                    if (sucess == true)
                    {
                        MessageBox.Show("email sent sucessfully");
                    }
                    else
                    {
                        MessageBox.Show("email not sent");
                    }
                    //Calling the Clear Method
                }
            }

            if (qsucess == false)
            {
                keyword = txtcompany.Text;
                bool csucess = pDAL.chkcompanybyname(keyword);
                if (csucess == true)
                {
                    keyword = txtcompany.Text;
                    companysBLL c = pDAL.Search(keyword);

                    custBLL ca = new custBLL();
                    ca.name   = txtu_Name.Text;
                    ca.mobile = txtu_Contact.Text;
                    string type = "user";
                    ca.type  = type;
                    ca.email = txtemail.Text;
                    bool isadded = false;
                    int  id      = c.id;
                    ca.cid    = id;
                    ca.nquery = 0;

                    isadded = tDAL.Insert(ca);
                    if (isadded == true)
                    {
                        MessageBox.Show("new user added");
                    }
                    else
                    {
                        MessageBox.Show("new user can not be added");
                    }
                }

                else
                {
                    MessageBox.Show("plz add new company");
                    addcompanys ca = new addcompanys();
                    ca.Show();
                }
            }
        }