Exemplo n.º 1
0
        public static bool UpdateApoitment(int id, string update, string result, bool date)
        {
            var      conn     = new DataLayer.DataClasses1DataContext();
            Activity activity = (from a in conn.Activity
                                 where a.id_act == id
                                 select a).SingleOrDefault();

            if (activity != null)
            {
                if (date == true)
                {
                    activity.dt_fin_cancel = DateTime.Today;
                }
                else
                {
                    activity.dt_fin_cancel = null;
                }
                activity.status = update;
                activity.result = result;
                try
                {
                    conn.SubmitChanges();
                    return(true);
                }
                catch
                {
                    return(false);
                }
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 2
0
        public static List <int> AppoitmentsIds(int worker)
        {
            var        conn = new DataLayer.DataClasses1DataContext();
            List <int> ids  = (from a in conn.Activity
                               where a.id_pers == worker && (a.status == "opn" || a.status == "pro")
                               select a.id_act).ToList();

            return(ids);
        }
Exemplo n.º 3
0
        public static List <WorkerSection> Appoitments(int worker)
        {
            var conn = new DataLayer.DataClasses1DataContext();
            List <WorkerSection> activity = (from a in conn.Activity
                                             where a.id_pers == worker && (a.status == "opn" || a.status == "pro")
                                             select new WorkerSection(a.id_act, a.seq_name, a.description, a.Request.Object.id_obj, a.Request.Object.name, a.status, a.Activity_Type.act_name)).ToList();

            return(activity);
        }
Exemplo n.º 4
0
        public static Personel Login(string uname, string pass)
        {
            DateTime date = DateTime.Today;
            var      conn = new DataLayer.DataClasses1DataContext();

            try
            {
                Personel user = (from a in conn.Personel
                                 where a.uname == uname && a.password == MD5Hash(pass) && (a.dt_exp > date || a.dt_exp == null)
                                 select a).SingleOrDefault();
                return(user);
            }
            catch
            {
                return(null);
            }
        }