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 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); }