public bool saveEvent(Schedule s)
        {
            var status = false;

            using (ERPDataContext dc = new ERPDataContext())
            {
                if (s.EventID > 0)
                {
                    //Update the event
                    var v = dc.Schedules.Where(a => a.EventID == s.EventID).FirstOrDefault();
                    if (v != null)
                    {
                        v.Subject     = s.Subject;
                        v.Start       = s.Start;
                        v.End         = s.End;
                        v.Description = s.Description;
                        v.IsFullDay   = s.IsFullDay;
                        v.Theme       = s.Theme;
                    }
                }
                else
                {
                    dc.Schedules.InsertOnSubmit(s);
                }
                dc.SubmitChanges();
                status = true;
            }
            return(status);
        }
Exemple #2
0
        public ActionResult tblCallMst()
        {
            ERPDataContext DB = new ERPDataContext();

            ViewBag.vwState = new SelectList((from a in DB.citydets where a.cityType == 67 && a.cityrute == 3 orderby a.cityname select new { a.citycode, a.cityname }), "citycode", "cityname");
            return(PartialView("tblCallMst"));
        }
    public static List <FacultyIdno> GetFacultyIdno(string firstName, string lastName, string userName)
    {
        using (ERPDataContext reportData = new ERPDataContext())
        {
            if ((firstName.Length + lastName.Length + userName.Length) > 0)
            {
                string convertedUserName = userName.Replace("@delta.edu", "");

                List <FacultyIdno> reportInfo = (from s in reportData.Bios
                                                 join u in reportData.UNames on s.IDNO equals u.IDNO
                                                 where s.FirstNM.Contains(firstName) &&
                                                 s.LastNM.Contains(lastName) &&
                                                 u.Usernames.Contains(convertedUserName) &&
                                                 s.Type != "05" &&
                                                 s.Type != "5"

                                                 select new FacultyIdno()
                {
                    DeltaId = s.IDNO.ToString(),
                    FirstName = s.FirstNM,
                    LastName = s.LastNM,
                    Gender = s.Gender.ToUpper()
                }).OrderBy(x => x.LastName).ToList();
                return(reportInfo);
            }
            else
            {
                return(new List <FacultyIdno>());
            }
        }
    }
        public List <MedDetails> getMedDetails(int ID)
        {
            ERPDataContext dc     = new ERPDataContext();
            var            result = from pres in dc.Prescriptions
                                    join m in dc.Medications on pres.PrescriptionID equals m.PrescriptionID
                                    where pres.AppointmentID == ID
                                    select new
            {
                MedType  = m.MedType,
                MedName  = m.MedName,
                Strength = m.Strength,
                Duration = m.Duration,
                Dose     = m.Dose,
                Dignosis = m.Dignosis,
            };


            foreach (var v in result)
            {
                MedDetails details = new MedDetails();
                details.MedType  = v.MedType;
                details.MedName  = v.MedName;
                details.Strength = v.Strength;
                details.Duration = v.Duration;
                details.Dose     = v.Dose;
                details.Dignosis = v.Dignosis;
                MedList.Add(details);
            }

            return(MedList);
        }
Exemple #5
0
 public JsonResult CheckTimeSlot(string TimeSlot, string date)
 {
     using (ERPDataContext dc = new ERPDataContext())
     {
         return(Json(!dc.Appointments.Any(x => x.TimeSlot == TimeSlot && x.Date.ToString() == date && x.DoctorID == int.Parse(Session["DoctorID"].ToString())), JsonRequestBehavior.AllowGet));
     }
 }
Exemple #6
0
        public ActionResult tblCallMst(tblCallMst frm)
        {
            string sMsg = "";

            try
            {
                ERPDataContext DB = new ERPDataContext();

                if ((from a in DB.tblCallMsts where a.Mobile == frm.Mobile select a).Count() == 0)
                {
                    frm.ID = Convert.ToInt32(DB.tblCallDets.Max(a => (int?)a.ID) + 1);

                    frm.UseCode   = SessionMaster.UserID;
                    frm.CreatedOn = DateTime.Now;

                    DB.tblCallMsts.InsertOnSubmit(frm);
                    DB.SubmitChanges();
                    sMsg = "Saved Successfully !";
                }
                else
                {
                    sMsg = "Already Added !";
                }
            }
            catch (Exception ex)
            {
                sMsg = ex.Message;
            }
            return(Json(Json(sMsg).Data, JsonRequestBehavior.AllowGet));
        }
        public IList getEvents()
        {
            ERPDataContext dc = new ERPDataContext();

            var Event = dc.Schedules.ToList();

            return(Event);
        }
Exemple #8
0
        public ActionResult AvailableDoctor(FormCollection fc)
        {
            ERPDataContext           dc     = new ERPDataContext();
            DocScheduleQuery         qdata  = new DocScheduleQuery();
            DocScheduleStatus        Doc    = new DocScheduleStatus();
            List <DocScheduleStatus> status = new List <DocScheduleStatus>();

            if (ModelState.IsValid)
            {
                qdata.Date       = Convert.ToDateTime(fc["Date"]);
                qdata.Department = Convert.ToString(fc["Department"]);
                var result = dc.Schedules.Where(x => x.Start.Date == qdata.Date.Date).FirstOrDefault();
                if (result != null)
                {
                    var data = from ds in dc.DoctorSchedules
                               join doc in dc.Doctors on ds.DoctorID equals doc.DoctorID
                               where ds.EventID == result.EventID
                               select new
                    {
                        DoctorID   = doc.DoctorID,
                        Department = doc.Department,
                        DoctorName = doc.FirstName + doc.LastName,
                    };

                    var doctor = from doc in data
                                 where (doc.Department == qdata.Department)
                                 select new
                    {
                        Date       = result.Start,
                        DoctorID   = doc.DoctorID,
                        Department = doc.Department,
                        DoctorName = doc.DoctorName
                    };
                    if (doctor != null)
                    {
                        foreach (var v in doctor)
                        {
                            Doc.DoctorID   = v.DoctorID;
                            Doc.Date       = qdata.Date.ToString("MM/dd/yyyy");
                            Doc.Department = v.Department;
                            Doc.DoctorName = v.DoctorName;
                            Doc.Status     = result.Subject;
                        }
                        status.Add(Doc);
                        return(View(status));
                    }
                    else
                    {
                        ViewBag.NoDoctor = "No Doctor is Available";
                        return(Redirect("/MakeAppointment/AppointmentIndex"));
                    }
                }
                ViewBag.NoSchedule = "No Schedule Availble";
                return(Redirect("/MakeAppointment/AppointmentIndex"));
            }
            return(View());
        }
//------------------- Find by keywords --------------------------------------------------------

        /// <summary>
        /// Finds all  Global Application Setting Template data with application Setting Name containing specified keyword
        /// </summary>
        /// <param name="applicationSettingName"> Application Setting Name</param>
        /// <returns>List of  Global Application Setting Template</returns>
        public List <GlobalApplicationSettingTemplate> FindByApplicationSettingName(string applicationSettingName)
        {
            ERPDataContext dataContext = (ERPDataContext)this.DataContext;
            var            list        = from o in dataContext.GlobalApplicationSettingTemplates
                                         where
                                         o.ApplicationSettingName.Contains(applicationSettingName)
                                         select o;

            return(list.ToList());
        }
Exemple #10
0
//------------------- Find by keywords --------------------------------------------------------

        /// <summary>
        /// Finds all  Application Setting data with setting Key containing specified keyword
        /// </summary>
        /// <param name="settingKey"> Setting Key</param>
        /// <returns>List of  Application Setting</returns>
        public List <ApplicationSetting> FindBySettingKey(string settingKey)
        {
            ERPDataContext dataContext = (ERPDataContext)this.DataContext;
            var            list        = from o in dataContext.ApplicationSettings
                                         where
                                         o.SettingKey.Contains(settingKey)
                                         select o;

            return(list.ToList());
        }
        /// <summary>
        /// Finds all  Global Application Setting data with user I D containing specified keyword
        /// </summary>
        /// <param name="userID"> User I D</param>
        /// <returns>List of  Global Application Setting</returns>
        public List <GlobalApplicationSetting> FindByUserID(string userID)
        {
            ERPDataContext dataContext = (ERPDataContext)this.DataContext;
            var            list        = from o in dataContext.GlobalApplicationSettings
                                         where
                                         o.UserID.Contains(userID)
                                         select o;

            return(list.ToList());
        }
        /// <summary>
        /// Finds all  Theme data with loading Animation Audio containing specified keyword
        /// </summary>
        /// <param name="loadingAnimationAudio"> Loading Animation Audio</param>
        /// <returns>List of  Theme</returns>
        public List <Theme> FindByLoadingAnimationAudio(string loadingAnimationAudio)
        {
            ERPDataContext dataContext = (ERPDataContext)this.DataContext;
            var            list        = from o in dataContext.Themes
                                         where
                                         o.LoadingAnimationAudio.Contains(loadingAnimationAudio)
                                         select o;

            return(list.ToList());
        }
        /// <summary>
        /// Finds all  Theme data with theme Info containing specified keyword
        /// </summary>
        /// <param name="themeInfo"> Theme Info</param>
        /// <returns>List of  Theme</returns>
        public List <Theme> FindByThemeInfo(string themeInfo)
        {
            ERPDataContext dataContext = (ERPDataContext)this.DataContext;
            var            list        = from o in dataContext.Themes
                                         where
                                         o.ThemeInfo.Contains(themeInfo)
                                         select o;

            return(list.ToList());
        }
        /// <summary>
        /// Finds all  Theme data with taskbar Menu Color containing specified keyword
        /// </summary>
        /// <param name="taskbarMenuColor"> Taskbar Menu Color</param>
        /// <returns>List of  Theme</returns>
        public List <Theme> FindByTaskbarMenuColor(string taskbarMenuColor)
        {
            ERPDataContext dataContext = (ERPDataContext)this.DataContext;
            var            list        = from o in dataContext.Themes
                                         where
                                         o.TaskbarMenuColor.Contains(taskbarMenuColor)
                                         select o;

            return(list.ToList());
        }
        /// <summary>
        /// Finds all  Theme data with default Wallpaper containing specified keyword
        /// </summary>
        /// <param name="defaultWallpaper"> Default Wallpaper</param>
        /// <returns>List of  Theme</returns>
        public List <Theme> FindByDefaultWallpaper(string defaultWallpaper)
        {
            ERPDataContext dataContext = (ERPDataContext)this.DataContext;
            var            list        = from o in dataContext.Themes
                                         where
                                         o.DefaultWallpaper.Contains(defaultWallpaper)
                                         select o;

            return(list.ToList());
        }
        /// <summary>
        /// Finds all  Global Application Setting data with setting Value containing specified keyword
        /// </summary>
        /// <param name="settingValue"> Setting Value</param>
        /// <returns>List of  Global Application Setting</returns>
        public List <GlobalApplicationSetting> FindBySettingValue(string settingValue)
        {
            ERPDataContext dataContext = (ERPDataContext)this.DataContext;
            var            list        = from o in dataContext.GlobalApplicationSettings
                                         where
                                         o.SettingValue.Contains(settingValue)
                                         select o;

            return(list.ToList());
        }
//----------------------  find by dates -----------------------------------------------


//-----------------------  Find by Foreign keys ---------------------------------------

        /// <summary>
        /// Finds all  Global Application Setting Template data with specified is Active
        /// </summary>
        /// <param name="isActive"> Is Active</param>
        /// <returns>List of  Global Application Setting Template</returns>
        public List <GlobalApplicationSettingTemplate> FindByIsActive(Int16 isActive)
        {
            ERPDataContext dataContext = (ERPDataContext)this.DataContext;
            var            list        = from o in dataContext.GlobalApplicationSettingTemplates
                                         where
                                         o.IsActive == isActive
                                         select o;

            return(list.ToList());
        }
Exemple #18
0
        /// <summary>
        /// Finds all  Application Group data with application Group Icon containing specified keyword
        /// </summary>
        /// <param name="applicationGroupIcon"> Application Group Icon</param>
        /// <returns>List of  Application Group</returns>
        public List <ApplicationGroup> FindByApplicationGroupIcon(string applicationGroupIcon)
        {
            ERPDataContext dataContext = (ERPDataContext)this.DataContext;
            var            list        = from o in dataContext.ApplicationGroups
                                         where
                                         o.ApplicationGroupIcon.Contains(applicationGroupIcon)
                                         select o;

            return(list.ToList());
        }
Exemple #19
0
        /// <summary>
        /// Finds all  Application Item data with application Desc containing specified keyword
        /// </summary>
        /// <param name="applicationDesc"> Application Desc</param>
        /// <returns>List of  Application Item</returns>
        public List <ApplicationItem> FindByApplicationDesc(string applicationDesc)
        {
            ERPDataContext dataContext = (ERPDataContext)this.DataContext;
            var            list        = from o in dataContext.ApplicationItems
                                         where
                                         o.ApplicationDesc.Contains(applicationDesc)
                                         select o;

            return(list.ToList());
        }
Exemple #20
0
        /// <summary>
        /// Finds all  Application Item data with specified is Displayed
        /// </summary>
        /// <param name="isDisplayed"> Is Displayed</param>
        /// <returns>List of  Application Item</returns>
        public List <ApplicationItem> FindByIsDisplayed(Int16 isDisplayed)
        {
            ERPDataContext dataContext = (ERPDataContext)this.DataContext;
            var            list        = from o in dataContext.ApplicationItems
                                         where
                                         o.IsDisplayed == isDisplayed
                                         select o;

            return(list.ToList());
        }
Exemple #21
0
//----------------------  find by dates -----------------------------------------------


//-----------------------  Find by Foreign keys ---------------------------------------

        /// <summary>
        /// Finds all  Application Item data with specified application Group Id
        /// </summary>
        /// <param name="applicationGroupId"> Application Group Id</param>
        /// <returns>List of  Application Item</returns>
        public List <ApplicationItem> FindByApplicationGroupId(Int16 applicationGroupId)
        {
            ERPDataContext dataContext = (ERPDataContext)this.DataContext;
            var            list        = from o in dataContext.ApplicationItems
                                         where
                                         o.ApplicationGroupId == applicationGroupId
                                         select o;

            return(list.ToList());
        }
        /// <summary>
        /// Delete all  Application Item data with application Desc containing specified keyword
        /// </summary>
        /// <param name="applicationDesc"> Application Desc</param>
        /// <returns>List of  Application Item</returns>
        public void DeleteByApplicationDesc(string applicationDesc)
        {
            ERPDataContext dataContext = (ERPDataContext)this.DataContext;
            var            list        = from o in dataContext.ApplicationItems
                                         where
                                         o.ApplicationDesc.Contains(applicationDesc)
                                         select o;

            dataContext.ApplicationItems.RemoveRange(list);
            dataContext.SaveChanges();
        }
        /// <summary>
        /// Delete all  Application Item data with specified is Displayed
        /// </summary>
        /// <param name="isDisplayed"> Is Displayed</param>
        /// <returns>List of  Application Item</returns>
        public void DeleteByIsDisplayed(Int16 isDisplayed)
        {
            ERPDataContext dataContext = (ERPDataContext)this.DataContext;
            var            list        = from o in dataContext.ApplicationItems
                                         where
                                         o.IsDisplayed == isDisplayed
                                         select o;

            dataContext.ApplicationItems.RemoveRange(list);
            dataContext.SaveChanges();
        }
//-----------------------  Delete by Foreign keys ---------------------------------------

        /// <summary>
        /// Delete all  Application Item data with specified application Group Id
        /// </summary>
        /// <param name="applicationGroupId"> Application Group Id</param>
        /// <returns>List of  Application Item</returns>
        public void DeleteByApplicationGroupId(Int16 applicationGroupId)
        {
            ERPDataContext dataContext = (ERPDataContext)this.DataContext;
            var            list        = from o in dataContext.ApplicationItems
                                         where
                                         o.ApplicationGroupId == applicationGroupId
                                         select o;

            dataContext.ApplicationItems.RemoveRange(list);
            dataContext.SaveChanges();
        }
Exemple #25
0
        /// <summary>
        /// Delete all  Application Setting data with app Name containing specified keyword
        /// </summary>
        /// <param name="appName"> App Name</param>
        /// <returns>List of  Application Setting</returns>
        public void DeleteByAppName(string appName)
        {
            ERPDataContext dataContext = (ERPDataContext)this.DataContext;
            var            list        = from o in dataContext.ApplicationSettings
                                         where
                                         o.AppName.Contains(appName)
                                         select o;

            dataContext.ApplicationSettings.RemoveRange(list);
            dataContext.SaveChanges();
        }
Exemple #26
0
//------------------- Delete by keywords --------------------------------------------------------

        /// <summary>
        /// Delete all  Application Setting data with setting Key containing specified keyword
        /// </summary>
        /// <param name="settingKey"> Setting Key</param>
        /// <returns>List of  Application Setting</returns>
        public void DeleteBySettingKey(string settingKey)
        {
            ERPDataContext dataContext = (ERPDataContext)this.DataContext;
            var            list        = from o in dataContext.ApplicationSettings
                                         where
                                         o.SettingKey.Contains(settingKey)
                                         select o;

            dataContext.ApplicationSettings.RemoveRange(list);
            dataContext.SaveChanges();
        }
Exemple #27
0
        /// <summary>
        /// Delete all  Theme data with loading Animation Audio containing specified keyword
        /// </summary>
        /// <param name="loadingAnimationAudio"> Loading Animation Audio</param>
        /// <returns>List of  Theme</returns>
        public void DeleteByLoadingAnimationAudio(string loadingAnimationAudio)
        {
            ERPDataContext dataContext = (ERPDataContext)this.DataContext;
            var            list        = from o in dataContext.Themes
                                         where
                                         o.LoadingAnimationAudio.Contains(loadingAnimationAudio)
                                         select o;

            dataContext.Themes.RemoveRange(list);
            dataContext.SaveChanges();
        }
Exemple #28
0
        /// <summary>
        /// Delete all  Global Application Setting data with user I D containing specified keyword
        /// </summary>
        /// <param name="userID"> User I D</param>
        /// <returns>List of  Global Application Setting</returns>
        public void DeleteByUserID(string userID)
        {
            ERPDataContext dataContext = (ERPDataContext)this.DataContext;
            var            list        = from o in dataContext.GlobalApplicationSettings
                                         where
                                         o.UserID.Contains(userID)
                                         select o;

            dataContext.GlobalApplicationSettings.RemoveRange(list);
            dataContext.SaveChanges();
        }
Exemple #29
0
//-----------------------  Delete by Foreign keys ---------------------------------------

        /// <summary>
        /// Delete all  Global Application Setting Template data with specified is Active
        /// </summary>
        /// <param name="isActive"> Is Active</param>
        /// <returns>List of  Global Application Setting Template</returns>
        public void DeleteByIsActive(Int16 isActive)
        {
            ERPDataContext dataContext = (ERPDataContext)this.DataContext;
            var            list        = from o in dataContext.GlobalApplicationSettingTemplates
                                         where
                                         o.IsActive == isActive
                                         select o;

            dataContext.GlobalApplicationSettingTemplates.RemoveRange(list);
            dataContext.SaveChanges();
        }
Exemple #30
0
        /// <summary>
        /// Delete all  Global Application Setting Template data with application Setting Value containing specified keyword
        /// </summary>
        /// <param name="applicationSettingValue"> Application Setting Value</param>
        /// <returns>List of  Global Application Setting Template</returns>
        public void DeleteByApplicationSettingValue(string applicationSettingValue)
        {
            ERPDataContext dataContext = (ERPDataContext)this.DataContext;
            var            list        = from o in dataContext.GlobalApplicationSettingTemplates
                                         where
                                         o.ApplicationSettingValue.Contains(applicationSettingValue)
                                         select o;

            dataContext.GlobalApplicationSettingTemplates.RemoveRange(list);
            dataContext.SaveChanges();
        }