예제 #1
0
        private DialogResult GetTimeGroup()
        {
            BalanceProduktion Credin = new BalanceProduktion();

            Credin.UseDefaultCredentials = true;

            int direction = 0;

            if (Globals.TheGlobalCome)
            {
                direction = 1;
            }
            else
            {
                direction = 2;
            }
            bool vis   = false;
            bool visTg = Credin.WSReturnSelectTimeGroup();
            bool visAb = Credin.WSShowAbsence(Employee.TheEmployeeNo, Employee.TheTimeGroupCode, DateTime.Now, direction);

            if ((visAb == true) && (visTg == true))
            {
                vis = true;
            }
            if ((visAb == false) && (visTg == true))
            {
                vis = true;
            }
            if ((visAb == true) && (visTg == false))
            {
                vis = false;
            }
            if ((visAb == false) && (visTg == false))
            {
                vis = false;
            }



            if (vis)
            {
                var dbTimeGroup = new TimeGroupRelationConnDataContext();
                var TimeGroups  =
                    from TimeGroup in dbTimeGroup.Credin_Employee_Time_Group_Relations
                    where TimeGroup.Employee_No_.Equals(Employee.TheEmployeeNo)
                    select new { TimeGroup.Time_Group_No_, TimeGroup.Time_Group_Name };

                if (TimeGroups.Count() > 0)
                {
                    fmTimeGroupRelation tgr = new fmTimeGroupRelation();
                    return(tgr.ShowDialog());
                }
            }
            return(System.Windows.Forms.DialogResult.None);
        }
예제 #2
0
        public fmTimeGroupRelation()
        {
            InitializeComponent();

            var dbTimeGroup = new TimeGroupRelationConnDataContext();
            var TimeGroups  =
                from TimeGroup in dbTimeGroup.Credin_Employee_Time_Group_Relations
                where TimeGroup.Employee_No_.Equals(Employee.TheEmployeeNo)
                select new { TimeGroup.Time_Group_No_, TimeGroup.Time_Group_Name };

            if (TimeGroups.Count() > 0)
            {
                dgWorkshift.DataSource = TimeGroups;
                dgWorkshift.Update();
            }
        }