Ejemplo n.º 1
0
 ///<summary>Inserts one Recall into the database.  Provides option to use the existing priKey.</summary>
 internal static long Insert(Recall recall,bool useExistingPK)
 {
     if(!useExistingPK && PrefC.RandomKeys) {
         recall.RecallNum=ReplicationServers.GetKey("recall","RecallNum");
     }
     string command="INSERT INTO recall (";
     if(useExistingPK || PrefC.RandomKeys) {
         command+="RecallNum,";
     }
     command+="PatNum,DateDueCalc,DateDue,DatePrevious,RecallInterval,RecallStatus,Note,IsDisabled,RecallTypeNum,DisableUntilBalance,DisableUntilDate) VALUES(";
     if(useExistingPK || PrefC.RandomKeys) {
         command+=POut.Long(recall.RecallNum)+",";
     }
     command+=
              POut.Long  (recall.PatNum)+","
         +    POut.Date  (recall.DateDueCalc)+","
         +    POut.Date  (recall.DateDue)+","
         +    POut.Date  (recall.DatePrevious)+","
         +    POut.Int   (recall.RecallInterval.ToInt())+","
         +    POut.Long  (recall.RecallStatus)+","
         +"'"+POut.String(recall.Note)+"',"
         +    POut.Bool  (recall.IsDisabled)+","
         //DateTStamp can only be set by MySQL
         +    POut.Long  (recall.RecallTypeNum)+","
         +"'"+POut.Double(recall.DisableUntilBalance)+"',"
         +    POut.Date  (recall.DisableUntilDate)+")";
     if(useExistingPK || PrefC.RandomKeys) {
         Db.NonQ(command);
     }
     else {
         recall.RecallNum=Db.NonQ(command,true);
     }
     return recall.RecallNum;
 }
Ejemplo n.º 2
0
 ///<summary>Inserts one Recall into the database.  Returns the new priKey.</summary>
 internal static long Insert(Recall recall)
 {
     if(DataConnection.DBtype==DatabaseType.Oracle) {
         recall.RecallNum=DbHelper.GetNextOracleKey("recall","RecallNum");
         int loopcount=0;
         while(loopcount<100){
             try {
                 return Insert(recall,true);
             }
             catch(Oracle.DataAccess.Client.OracleException ex){
                 if(ex.Number==1 && ex.Message.ToLower().Contains("unique constraint") && ex.Message.ToLower().Contains("violated")){
                     recall.RecallNum++;
                     loopcount++;
                 }
                 else{
                     throw ex;
                 }
             }
         }
         throw new ApplicationException("Insert failed.  Could not generate primary key.");
     }
     else {
         return Insert(recall,false);
     }
 }
Ejemplo n.º 3
0
        static void Game_OnGameUpdate(EventArgs args)
        {
            if (Player.IsDead)
            {
                return;
            }

            if (Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.Combo)
            {
                Combo();
            }

            if (Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.Mixed)
            {
                Harass();
            }

            if (Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.LaneClear)
            {
                Laneclear();
                Jungleclear();
            }

            if (SharpShooter.Menu.Item("stealthrecall", true).GetValue <KeyBind>().Active)
            {
                if (Q.IsReady() && Recall.IsReady())
                {
                    Q.Cast();
                    Recall.Cast();
                }
            }

            Killsteal();
        }
Ejemplo n.º 4
0
        ///<summary>Gets all recalls for the supplied patients, usually a family or single pat.  Result might have a length of zero.</summary>
        public static Recall[] GetList(int[] patNums)
        {
            string wherePats = "";

            for (int i = 0; i < patNums.Length; i++)
            {
                if (i != 0)
                {
                    wherePats += " OR ";
                }
                wherePats += "PatNum=" + patNums[i].ToString();
            }
            string command =
                "SELECT * from recall "
                + "WHERE " + wherePats;
            DataTable table = General.GetTable(command);

            Recall[] List = new Recall[table.Rows.Count];
            for (int i = 0; i < List.Length; i++)
            {
                List[i]                = new Recall();
                List[i].RecallNum      = PIn.PInt(table.Rows[i][0].ToString());
                List[i].PatNum         = PIn.PInt(table.Rows[i][1].ToString());
                List[i].DateDueCalc    = PIn.PDate(table.Rows[i][2].ToString());
                List[i].DateDue        = PIn.PDate(table.Rows[i][3].ToString());
                List[i].DatePrevious   = PIn.PDate(table.Rows[i][4].ToString());
                List[i].RecallInterval = new Interval(PIn.PInt(table.Rows[i][5].ToString()));
                List[i].RecallStatus   = PIn.PInt(table.Rows[i][6].ToString());
                List[i].Note           = PIn.PString(table.Rows[i][7].ToString());
                List[i].IsDisabled     = PIn.PBool(table.Rows[i][8].ToString());
            }
            return(List);
        }
Ejemplo n.º 5
0
        ///<summary>Converts a DataTable to a list of objects.</summary>
        public static List <Recall> TableToList(DataTable table)
        {
            List <Recall> retVal = new List <Recall>();
            Recall        recall;

            for (int i = 0; i < table.Rows.Count; i++)
            {
                recall                     = new Recall();
                recall.RecallNum           = PIn.Long(table.Rows[i]["RecallNum"].ToString());
                recall.PatNum              = PIn.Long(table.Rows[i]["PatNum"].ToString());
                recall.DateDueCalc         = PIn.Date(table.Rows[i]["DateDueCalc"].ToString());
                recall.DateDue             = PIn.Date(table.Rows[i]["DateDue"].ToString());
                recall.DatePrevious        = PIn.Date(table.Rows[i]["DatePrevious"].ToString());
                recall.RecallInterval      = new Interval(PIn.Int(table.Rows[i]["RecallInterval"].ToString()));
                recall.RecallStatus        = PIn.Long(table.Rows[i]["RecallStatus"].ToString());
                recall.Note                = PIn.String(table.Rows[i]["Note"].ToString());
                recall.IsDisabled          = PIn.Bool(table.Rows[i]["IsDisabled"].ToString());
                recall.DateTStamp          = PIn.DateT(table.Rows[i]["DateTStamp"].ToString());
                recall.RecallTypeNum       = PIn.Long(table.Rows[i]["RecallTypeNum"].ToString());
                recall.DisableUntilBalance = PIn.Double(table.Rows[i]["DisableUntilBalance"].ToString());
                recall.DisableUntilDate    = PIn.Date(table.Rows[i]["DisableUntilDate"].ToString());
                recall.DateScheduled       = PIn.Date(table.Rows[i]["DateScheduled"].ToString());
                retVal.Add(recall);
            }
            return(retVal);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Удаление сотрудника
        /// </summary>
        /// <param name="context"></param>
        /// <param name="numberRecall"></param>
        public void DeleteRecall(HotelContext context, int numberRecall)
        {
            Recall recalls = context.Recalls.Where(c => c.NumberRecall == numberRecall).FirstOrDefault();

            context.Recalls.Remove(recalls);
            context.SaveChanges();
        }
Ejemplo n.º 7
0
        ///<summary>Converts a DataTable to a list of objects.</summary>
        public static List <Recall> TableToList(DataTable table)
        {
            List <Recall> retVal = new List <Recall>();
            Recall        recall;

            foreach (DataRow row in table.Rows)
            {
                recall                     = new Recall();
                recall.RecallNum           = PIn.Long(row["RecallNum"].ToString());
                recall.PatNum              = PIn.Long(row["PatNum"].ToString());
                recall.DateDueCalc         = PIn.Date(row["DateDueCalc"].ToString());
                recall.DateDue             = PIn.Date(row["DateDue"].ToString());
                recall.DatePrevious        = PIn.Date(row["DatePrevious"].ToString());
                recall.RecallInterval      = new Interval(PIn.Int(row["RecallInterval"].ToString()));
                recall.RecallStatus        = PIn.Long(row["RecallStatus"].ToString());
                recall.Note                = PIn.String(row["Note"].ToString());
                recall.IsDisabled          = PIn.Bool(row["IsDisabled"].ToString());
                recall.DateTStamp          = PIn.DateT(row["DateTStamp"].ToString());
                recall.RecallTypeNum       = PIn.Long(row["RecallTypeNum"].ToString());
                recall.DisableUntilBalance = PIn.Double(row["DisableUntilBalance"].ToString());
                recall.DisableUntilDate    = PIn.Date(row["DisableUntilDate"].ToString());
                recall.DateScheduled       = PIn.Date(row["DateScheduled"].ToString());
                recall.Priority            = (OpenDentBusiness.RecallPriority)PIn.Int(row["Priority"].ToString());
                retVal.Add(recall);
            }
            return(retVal);
        }
Ejemplo n.º 8
0
        ///<summary></summary>
        /// <param name="funcCreateShortGUID">If not null, then this function will be called to set AsapComm.ShortGUID.
        /// This simulates having already asked HQ for the short guid and allows this step to be skipped for the purpose of unit test.</param>
        /// <param name="dateTimeSmsScheduled">Allows due date of SMS send to be set manually. This is used to simulate an SMS that will be sent later. Allows email to be sent first.</param>
        public static AsapComm CreateAsapCommRecall(Recall recall, Schedule sched, long clinicNum, Func <string> funcCreateShortGUID = null,
                                                    DateTime dateTimeSmsScheduled = default(DateTime))
        {
            AsapComm asapComm = new AsapComm {
                ClinicNum            = clinicNum,
                DateTimeExpire       = sched.SchedDate.Date.Add(sched.StartTime),
                DateTimeOrig         = recall.DateDue,
                DateTimeSmsScheduled = (dateTimeSmsScheduled == default(DateTime) ? DateTime.Now : dateTimeSmsScheduled),
                EmailSendStatus      = AutoCommStatus.SendNotAttempted,
                FKey              = recall.RecallNum,
                FKeyType          = AsapCommFKeyType.Recall,
                Note              = "",
                PatNum            = recall.PatNum,
                ResponseStatus    = AsapRSVPStatus.AwaitingTransmit,
                ScheduleNum       = sched.ScheduleNum,
                ShortGUID         = (funcCreateShortGUID != null ? funcCreateShortGUID() : ""),
                SmsSendStatus     = AutoCommStatus.SendNotAttempted,
                TemplateEmail     = PrefC.GetString(PrefName.WebSchedAsapEmailTemplate),
                TemplateEmailSubj = PrefC.GetString(PrefName.WebSchedAsapEmailSubj),
                TemplateText      = PrefC.GetString(PrefName.WebSchedAsapTextTemplate)
            };

            AsapComms.Insert(asapComm);
            return(asapComm);
        }
Ejemplo n.º 9
0
 //associated with play button
 //changes chance
 public void OnClick()
 {
     ValidCheck();         //makes accepted true if word is valid
     if (accepted)
     {
         Debug.Log("accepted");
         for (int i = 0; i < list.Count; i++)
         {
             list[i].GetComponent <place>().placed = true;
         }
         list.Clear();
         if (chance == 1)
         {
             chance        = 2;
             Score.Score1 += currsc;
         }
         else
         {
             chance        = 1;
             Score.Score2 += currsc;
         }
         first = false;
     }
     else
     {
         Recall.recall();
     }
     currsc = 0;
     count  = 0;
 }
Ejemplo n.º 10
0
        private void butRecall_Click(object sender, System.EventArgs e)
        {
            Procedure[] procList   = Procedures.Refresh(PatCur.PatNum);
            Recall[]    recallList = Recalls.GetList(new int[] { PatCur.PatNum });     //get the recall for this pt
            if (recallList.Length == 0)
            {
                MsgBox.Show(this, "This patient does not have any recall due.");
                return;
            }
            Recall recallCur = recallList[0];

            InsPlan[]   planList = InsPlans.Refresh(FamCur);
            Appointment apt      = Appointments.CreateRecallApt(PatCur, procList, recallCur, planList);

            AptSelected = apt.AptNum;
            oResult     = OtherResult.PinboardAndSearch;
            if (recallCur.DateDue < DateTime.Today)
            {
                DateJumpToString = DateTime.Today.ToShortDateString();              //they are overdue
            }
            else
            {
                DateJumpToString = recallCur.DateDue.ToShortDateString();
            }
            DialogResult = DialogResult.OK;
        }
Ejemplo n.º 11
0
 ///<summary>Inserts one Recall into the database.  Returns the new priKey.</summary>
 public static long Insert(Recall recall)
 {
     if (DataConnection.DBtype == DatabaseType.Oracle)
     {
         recall.RecallNum = DbHelper.GetNextOracleKey("recall", "RecallNum");
         int loopcount = 0;
         while (loopcount < 100)
         {
             try {
                 return(Insert(recall, true));
             }
             catch (Oracle.DataAccess.Client.OracleException ex) {
                 if (ex.Number == 1 && ex.Message.ToLower().Contains("unique constraint") && ex.Message.ToLower().Contains("violated"))
                 {
                     recall.RecallNum++;
                     loopcount++;
                 }
                 else
                 {
                     throw ex;
                 }
             }
         }
         throw new ApplicationException("Insert failed.  Could not generate primary key.");
     }
     else
     {
         return(Insert(recall, false));
     }
 }
Ejemplo n.º 12
0
        ///<summary>Updates one Recall in the database.</summary>
        public static void Update(Recall recall)
        {
            string command = "UPDATE recall SET "
                             + "PatNum             =  " + POut.Long(recall.PatNum) + ", "
                             + "DateDueCalc        =  " + POut.Date(recall.DateDueCalc) + ", "
                             + "DateDue            =  " + POut.Date(recall.DateDue) + ", "
                             + "DatePrevious       =  " + POut.Date(recall.DatePrevious) + ", "
                             + "RecallInterval     =  " + POut.Int(recall.RecallInterval.ToInt()) + ", "
                             + "RecallStatus       =  " + POut.Long(recall.RecallStatus) + ", "
                             + "Note               =  " + DbHelper.ParamChar + "paramNote, "
                             + "IsDisabled         =  " + POut.Bool(recall.IsDisabled) + ", "
                             //DateTStamp can only be set by MySQL
                             + "RecallTypeNum      =  " + POut.Long(recall.RecallTypeNum) + ", "
                             + "DisableUntilBalance= '" + POut.Double(recall.DisableUntilBalance) + "', "
                             + "DisableUntilDate   =  " + POut.Date(recall.DisableUntilDate) + ", "
                             + "DateScheduled      =  " + POut.Date(recall.DateScheduled) + ", "
                             + "Priority           =  " + POut.Int((int)recall.Priority) + " "
                             + "WHERE RecallNum = " + POut.Long(recall.RecallNum);

            if (recall.Note == null)
            {
                recall.Note = "";
            }
            OdSqlParameter paramNote = new OdSqlParameter("paramNote", OdDbType.Text, POut.StringParam(recall.Note));

            Db.NonQ(command, paramNote);
        }
Ejemplo n.º 13
0
        private void btRecallOk_Click(object sender, RoutedEventArgs e)
        {
            Recall recall = new Recall();

            if (tbRecallName.Text == string.Empty || tbClientFirstName.Text == string.Empty ||
                tbClientLastName.Text == string.Empty || tbClientPatronymic.Text == string.Empty)
            {
                MessageBox.Show("Заполните все обязательные поля!");
            }
            else
            {
                recall.NameRecall       = tbRecallName.Text;
                recall.ContextRecall    = tbRecallContext.Text;
                recall.ClientFirstName  = tbClientFirstName.Text;
                recall.ClientLastName   = tbClientLastName.Text;
                recall.ClientPatronymic = tbClientPatronymic.Text;
                recall.ClientPhone      = tbClientPhone.Text;
                recall.ClientCity       = tbClientCity.Text;
                recall.ClientStreet     = tbClientStreet.Text;
                recall.ClientHouse      = tbClientHouse.Text;
                recall.Date             = DateTime.Now;
                recall.Punkt            = (Punkt)cbRecallPunkt.SelectionBoxItem;
                dbContext.Recalls.Add(recall);
                dbContext.SaveChanges();
            }
        }
Ejemplo n.º 14
0
        public ActionResult Recall(string Name, int DoctorId)
        {
            Recall recallModel = service.GetRecall(Name, DoctorId);

            ViewBag.Recalls = recallModel;
            return(View());
        }
Ejemplo n.º 15
0
        public Recall GetRecall(string Name, int DoctorId)
        {
            Doctor doctor = (Doctor)base.GetElement(DoctorId);
            Recall recall = doctor.Recalls.FirstOrDefault(rec => rec.Name == Name);

            return(recall);
        }
Ejemplo n.º 16
0
        private static double GetRecallPercent(Recall recall)
        {
            var recallDuration = recall.Duration;
            var cd             = recall.Started + recallDuration - Game.Time;
            var percent        = (cd > 0 && Math.Abs(recallDuration) > float.Epsilon) ? 1f - (cd / recallDuration) : 1f;

            return(percent);
        }
Ejemplo n.º 17
0
        /// <summary>
        /// Добавление сотрудника
        /// </summary>
        /// <param name="context"></param>
        /// <param name="dateTime"></param>
        /// <param name="typeRecall"></param>
        /// <param name="topicRecall"></param>
        /// <param name="comment"></param>
        /// <param name="hotelUser"></param>
        /// <param name="room"></param>
        /// <param name="employee"></param>
        public void AddRecall(HotelContext context, DateTime dateTime, string typeRecall, string topicRecall, string comment, HotelUser hotelUser, Room room, Employee employee)
        {
            //var context = new HotelContext();
            Recall recalls = context.Recalls.Add(new Recall {
                DateTime = dateTime, TypeRecall = typeRecall, Comment = comment, HotelUser = hotelUser, Room = room, Employee = employee
            });

            context.SaveChanges();
        }
Ejemplo n.º 18
0
 ///<summary>Returns true if Update(Recall,Recall) would make changes to the database.
 ///Does not make any changes to the database and can be called before remoting role is checked.</summary>
 public static bool UpdateComparison(Recall recall, Recall oldRecall)
 {
     if (recall.PatNum != oldRecall.PatNum)
     {
         return(true);
     }
     if (recall.DateDueCalc.Date != oldRecall.DateDueCalc.Date)
     {
         return(true);
     }
     if (recall.DateDue.Date != oldRecall.DateDue.Date)
     {
         return(true);
     }
     if (recall.DatePrevious.Date != oldRecall.DatePrevious.Date)
     {
         return(true);
     }
     if (recall.RecallInterval != oldRecall.RecallInterval)
     {
         return(true);
     }
     if (recall.RecallStatus != oldRecall.RecallStatus)
     {
         return(true);
     }
     if (recall.Note != oldRecall.Note)
     {
         return(true);
     }
     if (recall.IsDisabled != oldRecall.IsDisabled)
     {
         return(true);
     }
     //DateTStamp can only be set by MySQL
     if (recall.RecallTypeNum != oldRecall.RecallTypeNum)
     {
         return(true);
     }
     if (recall.DisableUntilBalance != oldRecall.DisableUntilBalance)
     {
         return(true);
     }
     if (recall.DisableUntilDate.Date != oldRecall.DisableUntilDate.Date)
     {
         return(true);
     }
     if (recall.DateScheduled.Date != oldRecall.DateScheduled.Date)
     {
         return(true);
     }
     if (recall.Priority != oldRecall.Priority)
     {
         return(true);
     }
     return(false);
 }
Ejemplo n.º 19
0
 public bool CreateRecall(Recall instance)
 {
     if (instance.RecallId == 0)
     {
         Db.Recalls.InsertOnSubmit(instance);
         Db.Recalls.Context.SubmitChanges();
         return(true);
     }
     return(false);
 }
        public async Task SaveCustomerRecallForExecutor(RecallDTO recallDTO)
        {
            if (recallDTO.CustomerCommentForExecutor == null)
            {
            }

            Recall recall = _mapper.Map <Recall>(recallDTO);

            await _database.Recalls.AddCustomerRecallPropertiesForExecutor(recall);
        }
        protected void RecallButton_Click(object sender, EventArgs e)
        {
            Recall newRecall = new Recall();

            newRecall.UserId = UserAct.UserId;
            newRecall.DishId = DishPage.DishId;
            newRecall.Text   = RecallTextbox.Text;
            Repository.CreateRecall(newRecall);
            Response.Redirect(Request.RawUrl);
        }
Ejemplo n.º 22
0
 ///<summary></summary>
 public FormRecallListEdit(Recall recallCur)
 {
     InitializeComponent();
     RecallCur = recallCur;
     Lan.F(this);
     for (int i = 0; i < listFamily.Columns.Count; i++)
     {
         listFamily.Columns[i].Text = Lan.g(this, listFamily.Columns[i].Text);
     }
 }
Ejemplo n.º 23
0
        public void AddRecall(Recall recall)
        {
            Doctor doctor = context.Doctors.Find(recall.DoctorId);

            if (doctor.Recalls == null)
            {
                doctor.Recalls = new List <Recall>();
            }
            doctor.Recalls.Add(recall);
            context.SaveChanges();
        }
Ejemplo n.º 24
0
        public IActionResult Create(Recall recall)
        {
            if (ModelState.IsValid)
            {
                db.Recalls.Add(recall);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(recall));
        }
Ejemplo n.º 25
0
 private void butPerio_Click(object sender, EventArgs e)
 {
     //make sure we have both special types properly setup.
     if (!RecallTypes.PerioAndProphyBothHaveTriggers())
     {
         MsgBox.Show(this, "Prophy and Perio special recall types are not setup properly.  They must both exist, and they must both have a trigger.");
         return;
     }
     if (IsPerio)
     {
         //change the perio types to prophy
         for (int i = 0; i < RecallList.Count; i++)
         {
             if (PrefC.GetLong(PrefName.RecallTypeSpecialPerio) == RecallList[i].RecallTypeNum)
             {
                 RecallList[i].RecallTypeNum  = PrefC.GetLong(PrefName.RecallTypeSpecialProphy);
                 RecallList[i].RecallInterval = RecallTypes.GetInterval(PrefC.GetLong(PrefName.RecallTypeSpecialProphy));
                 //previous date will be reset below in synch, but probably won't change since similar triggers.
                 Recalls.Update(RecallList[i]);
                 SecurityLogs.MakeLogEntry(Permissions.RecallEdit, RecallList[i].PatNum, "Recall changed to Prophy from the Recalls for Patient window.");
                 break;
             }
         }
     }
     else
     {
         bool found = false;
         //change any prophy types to perio
         for (int i = 0; i < RecallList.Count; i++)
         {
             if (PrefC.GetLong(PrefName.RecallTypeSpecialProphy) == RecallList[i].RecallTypeNum)
             {
                 RecallList[i].RecallTypeNum  = PrefC.GetLong(PrefName.RecallTypeSpecialPerio);
                 RecallList[i].RecallInterval = RecallTypes.GetInterval(PrefC.GetLong(PrefName.RecallTypeSpecialPerio));
                 //previous date will be reset below in synch, but probably won't change since similar triggers.
                 Recalls.Update(RecallList[i]);
                 SecurityLogs.MakeLogEntry(Permissions.RecallEdit, RecallList[i].PatNum, "Recall changed to Perio from the Recalls for Patient window.");
                 found = true;
                 break;
             }
         }
         //if none found, then add a perio
         if (!found)
         {
             Recall recall = new Recall();
             recall.PatNum         = PatNum;
             recall.RecallInterval = RecallTypes.GetInterval(PrefC.GetLong(PrefName.RecallTypeSpecialPerio));
             recall.RecallTypeNum  = PrefC.GetLong(PrefName.RecallTypeSpecialPerio);
             Recalls.Insert(recall);
             SecurityLogs.MakeLogEntry(Permissions.RecallEdit, recall.PatNum, "Perio recall added from the Recalls for Patient window.");
         }
     }
     FillGrid();
 }
Ejemplo n.º 26
0
        public static Appointment CreateAppointmentFromRecall(Recall recall, Patient pat, DateTime aptDateTime, long opNum, long provNum)
        {
            RecallType  recallType = RecallTypes.GetFirstOrDefault(x => x.RecallTypeNum == recall.RecallTypeNum);
            Appointment appt       = CreateAppointment(pat.PatNum, aptDateTime, opNum, provNum, pattern: recallType.TimePattern, clinicNum: pat.ClinicNum);

            foreach (string procCode in RecallTypes.GetProcs(recallType.RecallTypeNum))
            {
                ProcedureT.CreateProcedure(pat, procCode, ProcStat.TP, "", 50, appt.AptDateTime, provNum: provNum, aptNum: appt.AptNum);
            }
            return(appt);
        }
Ejemplo n.º 27
0
        ///<summary>Synchronizes all recall for one patient. Sets dateDueCalc and DatePrevious.  Also updates dateDue to match dateDueCalc if not disabled.  The supplied recall can be null if patient has no existing recall. Deletes or creates any recalls as necessary.</summary>
        public static void Synch(int patNum)
        {
            Recall[] recalls = GetList(new int[] { patNum });
            Recall   recall  = null;

            if (recalls.Length > 0)
            {
                recall = recalls[0];
            }
            Synch(patNum, recall);
        }
Ejemplo n.º 28
0
        public bool RemoveRecall(int RecallId)
        {
            Recall instance = Db.Recalls.FirstOrDefault(p => p.RecallId == RecallId);

            if (instance != null)
            {
                Db.Recalls.DeleteOnSubmit(instance);
                Db.Recalls.Context.SubmitChanges();
                return(true);
            }

            return(false);
        }
Ejemplo n.º 29
0
        /// <summary>
        /// Обновление сотрудника
        /// </summary>
        /// <param name="context"></param>
        /// <param name="numberRecall"></param>
        /// <param name="dateTime"></param>
        /// <param name="typeRecall"></param>
        /// <param name="topicRecall"></param>
        /// <param name="comment"></param>
        /// <param name="hotelUser"></param>
        /// <param name="room"></param>
        /// <param name="employee"></param>
        public void UpdateRecall(HotelContext context, int numberRecall, DateTime dateTime, string typeRecall, string topicRecall, string comment, HotelUser hotelUser, Room room, Employee employee)
        {
            Recall recalls = context.Recalls.Where(c => c.NumberRecall == numberRecall).FirstOrDefault();

            recalls.DateTime    = dateTime;
            recalls.TypeRecall  = typeRecall;
            recalls.TopicRecall = topicRecall;
            recalls.Comment     = comment;
            recalls.HotelUser   = hotelUser;
            recalls.Room        = room;
            recalls.Employee    = employee;
            context.SaveChanges();
        }
Ejemplo n.º 30
0
 ///<summary>Will only return true if not disabled, date previous is empty, DateDue is same as DateDueCalc, etc.</summary>
 public static bool IsAllDefault(Recall recall)
 {
     if (recall.IsDisabled ||
         recall.DatePrevious.Year > 1880 ||
         recall.DateDue != recall.DateDueCalc ||
         recall.RecallInterval != new Interval(0, 0, 6, 0) ||
         recall.RecallStatus != 0 ||
         recall.Note != "")
     {
         return(false);
     }
     return(true);
 }
Ejemplo n.º 31
0
        private void butAdd_Click(object sender, EventArgs e)
        {
            Recall recall = new Recall();

            recall.RecallTypeNum  = 0;         //user will have to pick
            recall.PatNum         = PatNum;
            recall.RecallInterval = new Interval(0, 0, 6, 0);
            FormRecallEdit FormRE = new FormRecallEdit();

            FormRE.IsNew     = true;
            FormRE.RecallCur = recall;
            FormRE.ShowDialog();
            FillGrid();
        }
Ejemplo n.º 32
0
        public bool UpdateRecall(Recall instance)
        {
            Recall cache = Db.Recalls.FirstOrDefault(p => p.RecallId == instance.RecallId);

            if (instance.RecallId != 0)
            {
                cache.UserId = instance.UserId;
                cache.DishId = instance.DishId;
                cache.Text   = instance.Text;
                Db.Recalls.Context.SubmitChanges();
                return(true);
            }
            return(false);
        }
Ejemplo n.º 33
0
		///<summary>Converts a DataTable to a list of objects.</summary>
		public static List<Recall> TableToList(DataTable table){
			List<Recall> retVal=new List<Recall>();
			Recall recall;
			for(int i=0;i<table.Rows.Count;i++) {
				recall=new Recall();
				recall.RecallNum          = PIn.Long  (table.Rows[i]["RecallNum"].ToString());
				recall.PatNum             = PIn.Long  (table.Rows[i]["PatNum"].ToString());
				recall.DateDueCalc        = PIn.Date  (table.Rows[i]["DateDueCalc"].ToString());
				recall.DateDue            = PIn.Date  (table.Rows[i]["DateDue"].ToString());
				recall.DatePrevious       = PIn.Date  (table.Rows[i]["DatePrevious"].ToString());
				recall.RecallInterval     = new Interval(PIn.Int(table.Rows[i]["RecallInterval"].ToString()));
				recall.RecallStatus       = PIn.Long  (table.Rows[i]["RecallStatus"].ToString());
				recall.Note               = PIn.String(table.Rows[i]["Note"].ToString());
				recall.IsDisabled         = PIn.Bool  (table.Rows[i]["IsDisabled"].ToString());
				recall.DateTStamp         = PIn.DateT (table.Rows[i]["DateTStamp"].ToString());
				recall.RecallTypeNum      = PIn.Long  (table.Rows[i]["RecallTypeNum"].ToString());
				recall.DisableUntilBalance= PIn.Double(table.Rows[i]["DisableUntilBalance"].ToString());
				recall.DisableUntilDate   = PIn.Date  (table.Rows[i]["DisableUntilDate"].ToString());
				recall.DateScheduled      = PIn.Date  (table.Rows[i]["DateScheduled"].ToString());
				retVal.Add(recall);
			}
			return retVal;
		}
Ejemplo n.º 34
0
 private static double GetRecallPercent(Recall recall)
 {
     var recallDuration = recall.Duration;
     var cd = recall.Started + recallDuration - Game.Time;
     var percent = (cd > 0 && Math.Abs(recallDuration) > float.Epsilon) ? 1f - (cd / recallDuration) : 1f;
     return percent;
 }
 public bool AddRecall(Recall instance)
 {
     dataBase.Recall.InsertOnSubmit(instance);
     dataBase.Recall.Context.SubmitChanges();
     return true;
 }
Ejemplo n.º 36
0
		///<summary>Converts one Recall object to its mobile equivalent.  Warning! CustomerNum will always be 0.</summary>
		internal static Recallm ConvertToM(Recall recall){
			Recallm recallm=new Recallm();
			//CustomerNum cannot be set.  Remains 0.
			recallm.RecallNum          =recall.RecallNum;
			recallm.PatNum             =recall.PatNum;
			recallm.DateDue            =recall.DateDue;
			recallm.DatePrevious       =recall.DatePrevious;
			recallm.RecallStatus       =recall.RecallStatus;
			recallm.Note               =recall.Note;
			recallm.IsDisabled         =recall.IsDisabled;
			recallm.DisableUntilBalance=recall.DisableUntilBalance;
			recallm.DisableUntilDate   =recall.DisableUntilDate;
			return recallm;
		}
Ejemplo n.º 37
0
		///<summary>Updates one Recall in the database.  Uses an old object to compare to, and only alters changed fields.  This prevents collisions and concurrency problems in heavily used tables.</summary>
		public static void Update(Recall recall,Recall oldRecall){
			string command="";
			if(recall.PatNum != oldRecall.PatNum) {
				if(command!=""){ command+=",";}
				command+="PatNum = "+POut.Long(recall.PatNum)+"";
			}
			if(recall.DateDueCalc != oldRecall.DateDueCalc) {
				if(command!=""){ command+=",";}
				command+="DateDueCalc = "+POut.Date(recall.DateDueCalc)+"";
			}
			if(recall.DateDue != oldRecall.DateDue) {
				if(command!=""){ command+=",";}
				command+="DateDue = "+POut.Date(recall.DateDue)+"";
			}
			if(recall.DatePrevious != oldRecall.DatePrevious) {
				if(command!=""){ command+=",";}
				command+="DatePrevious = "+POut.Date(recall.DatePrevious)+"";
			}
			if(recall.RecallInterval != oldRecall.RecallInterval) {
				if(command!=""){ command+=",";}
				command+="RecallInterval = "+POut.Int(recall.RecallInterval.ToInt())+"";
			}
			if(recall.RecallStatus != oldRecall.RecallStatus) {
				if(command!=""){ command+=",";}
				command+="RecallStatus = "+POut.Long(recall.RecallStatus)+"";
			}
			if(recall.Note != oldRecall.Note) {
				if(command!=""){ command+=",";}
				command+="Note = '"+POut.String(recall.Note)+"'";
			}
			if(recall.IsDisabled != oldRecall.IsDisabled) {
				if(command!=""){ command+=",";}
				command+="IsDisabled = "+POut.Bool(recall.IsDisabled)+"";
			}
			//DateTStamp can only be set by MySQL
			if(recall.RecallTypeNum != oldRecall.RecallTypeNum) {
				if(command!=""){ command+=",";}
				command+="RecallTypeNum = "+POut.Long(recall.RecallTypeNum)+"";
			}
			if(recall.DisableUntilBalance != oldRecall.DisableUntilBalance) {
				if(command!=""){ command+=",";}
				command+="DisableUntilBalance = '"+POut.Double(recall.DisableUntilBalance)+"'";
			}
			if(recall.DisableUntilDate != oldRecall.DisableUntilDate) {
				if(command!=""){ command+=",";}
				command+="DisableUntilDate = "+POut.Date(recall.DisableUntilDate)+"";
			}
			if(recall.DateScheduled != oldRecall.DateScheduled) {
				if(command!=""){ command+=",";}
				command+="DateScheduled = "+POut.Date(recall.DateScheduled)+"";
			}
			if(command==""){
				return;
			}
			command="UPDATE recall SET "+command
				+" WHERE RecallNum = "+POut.Long(recall.RecallNum);
			Db.NonQ(command);
		}
Ejemplo n.º 38
0
		///<summary>Updates one Recall in the database.</summary>
		public static void Update(Recall recall){
			string command="UPDATE recall SET "
				+"PatNum             =  "+POut.Long  (recall.PatNum)+", "
				+"DateDueCalc        =  "+POut.Date  (recall.DateDueCalc)+", "
				+"DateDue            =  "+POut.Date  (recall.DateDue)+", "
				+"DatePrevious       =  "+POut.Date  (recall.DatePrevious)+", "
				+"RecallInterval     =  "+POut.Int   (recall.RecallInterval.ToInt())+", "
				+"RecallStatus       =  "+POut.Long  (recall.RecallStatus)+", "
				+"Note               = '"+POut.String(recall.Note)+"', "
				+"IsDisabled         =  "+POut.Bool  (recall.IsDisabled)+", "
				//DateTStamp can only be set by MySQL
				+"RecallTypeNum      =  "+POut.Long  (recall.RecallTypeNum)+", "
				+"DisableUntilBalance= '"+POut.Double(recall.DisableUntilBalance)+"', "
				+"DisableUntilDate   =  "+POut.Date  (recall.DisableUntilDate)+", "
				+"DateScheduled      =  "+POut.Date  (recall.DateScheduled)+" "
				+"WHERE RecallNum = "+POut.Long(recall.RecallNum);
			Db.NonQ(command);
		}