public responseCls saveAppoinmentMobile(submit expositions)
        {
            Appoinment app = new Appoinment();

            app.Id     = entities.Appoinments.Count() + 1;
            app.custID = "123";
            app.docID  = expositions.doctor.Id;
            app.time   = expositions.time;

            entities.Appoinments.Add(app);

            mobile mob = new mobile();

            mob.Id      = entities.mobiles.Count() + 1;
            mob.amount  = expositions.amount;
            mob.custID  = "123";
            mob.mobile1 = expositions.phone;
            mob.pin     = expositions.pin;

            entities.mobiles.Add(mob);

            entities.SaveChanges();

            responseCls res = new responseCls();

            res.status  = 400;
            res.success = "Data successfully saved";

            return(res);
        }
        public void sendMail(submit expositions)
        {
            var fromAddress  = new MailAddress("*****@*****.**");
            var fromPassword = "******";
            var toAddress    = new MailAddress(expositions.email);

            string subject = "Shedule Appoinment";
            string body    = "your appoinment is shedule at " + expositions.time + " with " +
                             " dr." + expositions.doctor.name + ".<br> Full payment of " + expositions.amount + " is alredy done and cannot reverse. <br><br> Thank you";


            System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient
            {
                Host                  = "smtp.gmail.com",
                Port                  = 587,
                EnableSsl             = true,
                DeliveryMethod        = System.Net.Mail.SmtpDeliveryMethod.Network,
                UseDefaultCredentials = false,
                Credentials           = new NetworkCredential(fromAddress.Address, fromPassword)
            };

            using (var message = new MailMessage(fromAddress, toAddress)
            {
                Subject = subject,
                Body = body,
                IsBodyHtml = true,
            })

                smtp.Send(message);
        }
        public responseCls saveCredits(submit expositions)
        {
            Appoinment app = new Appoinment();

            app.Id     = entities.Appoinments.Count() + 1;
            app.custID = "123";
            app.docID  = expositions.doctor.Id;
            app.time   = expositions.time;

            entities.Appoinments.Add(app);

            credit cre = new credit();

            cre.custID   = "123";
            cre.Id       = entities.credits.Count() + 1;
            cre.amount   = expositions.amount;
            cre.cardName = expositions.cardName;
            cre.cardNo   = expositions.cardNo;
            cre.csv      = expositions.csv;
            cre.date     = expositions.cardYear + '-' + expositions.cardMonth;

            entities.credits.Add(cre);
            sendMail(expositions);
            entities.SaveChanges();
            responseCls res = new responseCls();

            res.status  = 400;
            res.success = "credit card payment is saved";
            return(res);
        }
        public responseCls saveCreditsOption(submit expositions)
        {
            responseCls res = new responseCls();

            res.status  = 400;
            res.success = "Data successfully saved";

            return(res);
        }
        public responseCls saveAppoinmentMobileOption(submit expositions)
        {
            responseCls res = new responseCls();

            res.status  = 400;
            res.success = "Data successfully saved";

            return(res);
        }