public ActionResult Profile()
        {
            AdminVWModel av       = new AdminVWModel();
            long         vendorId = Session["VendorId"] != null?Convert.ToInt64(Session["VendorId"]) : 0;

            av.Vendors = VendorManager.GetVendorById(vendorId);
            //VendorManager.GetVendorById(vendorId);
            return(View("~/Areas/VendorPanel/Views/VendorHome/Profile.cshtml", av));
        }
        private void _sendEmail(Vendor vendor)
        {
            try
            {
                var data = VendorManager.GetVendorById(Convert.ToInt64(vendor.VendorId));

                StringBuilder sb = new StringBuilder();
                sb.AppendFormat("<div style=\"background:#F6F6F6;width:600px;margin:10px auto;overflow: hidden; padding-bottom:40px; box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.10), 0 3px 3px 0 rgba(0, 0, 0, 0.10); font-family:Roboto, Helvetica, Arial;\">");
                sb.AppendFormat("<div style=\"padding-top:20px; text-align:center; background:#333333eb;\">");
                sb.AppendFormat("<img src=\"http://ss.byteheart.com/images/Share_space.png\" alt=\"Sharespace\">");
                sb.AppendFormat("<p style=\"font-size:30px; color:#ffff;font-weight:600;text-align:center;\">Welcome to ShareSpace</p>");
                sb.AppendFormat("<p style=\"font-size:25px; color:#ffff;font-weight:500;text-align:center;\">You are registered as a Vendor</p>");
                sb.AppendFormat("<p style=\"font-size:24px; color:#ffff;font-weight:600;text-align:center;\">Your email is: {0}</p>", vendor.Email.ToString());
                sb.AppendFormat("<p style=\"font-size:24px; color:#ffff;font-weight:600;text-align:center;\">Your password is: {0}</p>", vendor.Password);
                sb.AppendFormat("<img src=\"http://ss.byteheart.com/images/mail_middle.png\" alt='' style=\"display:block; border: 0; outline: none; text-decoration:none; -ms-interpolation-mode:bicubic; width: 600px; \" >");
                sb.AppendFormat(
                    "<p style=\"font-size:18px; color:#ffff;\">You can see details from <a style=\"color:#ffff;\" href='http://ss.byteheart.com/Auth/Login' target='_blank'> your panel </a></p>");
                sb.AppendFormat("\n<p style=\"font-size:18px; color:#ffff;\">Your username: {0} and Password: {1}</p>", vendor.Email.Trim(), vendor.Password);
                sb.AppendFormat("</div>");


                SmtpClient client = new SmtpClient("smtp.office365.com", 587);
                client.EnableSsl   = true;
                client.Credentials = new System.Net.NetworkCredential("*****@*****.**", "SlimGuy@12");
                MailAddress from    = new MailAddress("*****@*****.**", "Sharespace", System.Text.Encoding.UTF8);
                MailAddress to      = new MailAddress(vendor.Email.Trim());
                MailMessage message = new MailMessage(from, to);
                MailAddress bcc     = new MailAddress("*****@*****.**");
                message.Bcc.Add(bcc);
                MailAddress bcc2 = new MailAddress("*****@*****.**");
                message.Bcc.Add(bcc2);
                message.Body            = sb.ToString();
                message.BodyEncoding    = System.Text.Encoding.UTF8;
                message.IsBodyHtml      = true;
                message.Subject         = "Sharespace Vendor Confirmation";
                message.SubjectEncoding = System.Text.Encoding.UTF8;
                client.Send(message);
            }
            catch (Exception exception)
            {
                Console.WriteLine(exception);
                throw;
            }
        }
        public ActionResult AddEditVendor(int OPM_ID, int VP_ID = 0)
        {
            BuyerOrderNumberListManager objBuyerOrderNumber    = new BuyerOrderNumberListManager(new DataContext());
            ParticipiantManager         objParticipiantManager = new ParticipiantManager(new DataContext());
            SupplierListManager         objSupplierListManager = new SupplierListManager(new DataContext());
            VendorManager context  = new VendorManager(new DataContext());
            Vendor_Model  objModel = new Vendor_Model();

            if (VP_ID != 0)
            {
                objModel.Table = context.GetVendorById(VP_ID);
            }
            else
            {
                objModel.Table        = new Vendor();
                objModel.Table.OPM_ID = OPM_ID;
            }
            objModel.BuyerOrderNumberList = Extens.ToSelectList(objBuyerOrderNumber.GetDtBuyerOrderNumber(), "BuyerOrderNumberName", "BuyerOrderNumberName");
            objModel.ParticipiantNameList = Extens.ToSelectList(objParticipiantManager.GetDtParticipiantName(), "Name", "Name");
            objModel.SupplierNameList     = Extens.ToSelectList(objSupplierListManager.GetDtSupplier(), "Suppliername", "Suppliername");
            return(PartialView("VendorCRUD", objModel));
        }
 public ActionResult UpdateVendor(AdminVWModel adminVwModel, int vendorId)
 {
     adminVwModel.Vendors = VendorManager.GetVendorById(vendorId);
     return(View("~/Views/Vendor/InsertVendor.cshtml", adminVwModel));
 }