Exemplo n.º 1
0
 public static bool IsExist(DateTime date, eShiftType shiftType, Guid businessUnitId)
 {
     using (var appDC = BARDBDataContext.Ready())
     {
         return appDC.Shifts.SingleOrDefault(s => s.Date.Date == date.Date && s.ShiftType == (int)shiftType && s.BusinessUnitId == businessUnitId) != null;
     }
 }
Exemplo n.º 2
0
 public static Shift Get(DateTime date, eShiftType shiftType, Guid businessUnitId)
 {
     using (var appDC = BARDBDataContext.Ready())
     {
         return(appDC.Shifts.FirstOrDefault(s => s.Date.Date == date.Date && s.ShiftType == (int)shiftType && s.BusinessUnitId == businessUnitId));
     }
 }
Exemplo n.º 3
0
 public static Shift Get(DateTime date, eShiftType shiftType, Guid businessUnitId)
 {
     using (var appDC = BARDBDataContext.Ready())
     {
         return appDC.Shifts.FirstOrDefault(s => s.Date.Date == date.Date && s.ShiftType == (int)shiftType && s.BusinessUnitId == businessUnitId);
     }
 }
Exemplo n.º 4
0
 public static bool IsExist(DateTime date, eShiftType shiftType, Guid businessUnitId)
 {
     using (var appDC = BARDBDataContext.Ready())
     {
         return(appDC.Shifts.SingleOrDefault(s => s.Date.Date == date.Date && s.ShiftType == (int)shiftType && s.BusinessUnitId == businessUnitId) != null);
     }
 }
Exemplo n.º 5
0
        public static void Delete(DateTime date, eShiftType shiftType, Guid businessUnitId)
        {
            using (var appDC = BARDBDataContext.Ready())
            {
                var toDelete = appDC.Shifts.FirstOrDefault(s => s.Date.Date == date.Date && s.ShiftType == (int)shiftType && s.BusinessUnitId == businessUnitId);

                if (toDelete != null)
                {
                    appDC.Shifts.DeleteOnSubmit(toDelete);
                    appDC.SubmitChanges();
                }
            }
        }
Exemplo n.º 6
0
        public static void Delete(DateTime date, eShiftType shiftType, Guid businessUnitId)
        {
            using (var appDC = BARDBDataContext.Ready())
            {
                var toDelete = appDC.Shifts.FirstOrDefault(s => s.Date.Date == date.Date && s.ShiftType == (int)shiftType && s.BusinessUnitId == businessUnitId);

                if (toDelete != null)
                {
                    appDC.Shifts.DeleteOnSubmit(toDelete);
                    appDC.SubmitChanges();
                }
            }
        }
Exemplo n.º 7
0
        internal ExcelAddressBase Insert(ExcelAddressBase address, eShiftType Shift /*, out ExcelAddressBase topAddress, out ExcelAddressBase leftAddress, out ExcelAddressBase rightAddress, out ExcelAddressBase bottomAddress*/)
        {
            //Before or after, no change
            //if ((_toRow > address._fromRow && _toCol > address.column) ||
            //    (_fromRow > address._toRow && column > address._toCol))
            if (_toRow < address._fromRow || _toCol < address._fromCol || (_fromRow > address._toRow && _fromCol > address._toCol))
            {
                //topAddress = null;
                //leftAddress = null;
                //rightAddress = null;
                //bottomAddress = null;
                return(this);
            }

            int    rows       = address.Rows;
            int    cols       = address.Columns;
            string retAddress = "";

            if (Shift == eShiftType.Right)
            {
                if (address._fromRow > _fromRow)
                {
                    retAddress = GetAddress(_fromRow, _fromCol, address._fromRow, _toCol, _fromRowFixed, _fromColFixed, _toRowFixed, _toColFixed);
                }
                if (address._fromCol > _fromCol)
                {
                    retAddress = GetAddress(_fromRow < address._fromRow ? _fromRow : address._fromRow, _fromCol, address._fromRow, _toCol, _fromRowFixed, _fromColFixed, _toRowFixed, _toColFixed);
                }
            }
            if (_toRow < address._fromRow)
            {
                if (_fromRow < address._fromRow)
                {
                }
                else
                {
                }
            }
            return(null);
        }
Exemplo n.º 8
0
        internal ExcelAddressBase Insert(ExcelAddressBase address, eShiftType Shift/*, out ExcelAddressBase topAddress, out ExcelAddressBase leftAddress, out ExcelAddressBase rightAddress, out ExcelAddressBase bottomAddress*/)
        {
            //Before or after, no change
            //if ((_toRow > address._fromRow && _toCol > address.column) ||
            //    (_fromRow > address._toRow && column > address._toCol))
            if(_toRow < address._fromRow || _toCol < address._fromCol || (_fromRow > address._toRow && _fromCol > address._toCol))
            {
                //topAddress = null;
                //leftAddress = null;
                //rightAddress = null;
                //bottomAddress = null;
                return this;
            }

            int rows = address.Rows;
            int cols = address.Columns;
            string retAddress = "";
            if (Shift==eShiftType.Right)
            {
                if (address._fromRow > _fromRow)
                {
                    retAddress = GetAddress(_fromRow, _fromCol, address._fromRow, _toCol, _fromRowFixed, _fromColFixed, _toRowFixed, _toColFixed);
                }
                if(address._fromCol > _fromCol)
                {
                    retAddress = GetAddress(_fromRow < address._fromRow ? _fromRow : address._fromRow, _fromCol, address._fromRow, _toCol, _fromRowFixed, _fromColFixed, _toRowFixed, _toColFixed);
                }
            }
            if (_toRow < address._fromRow)
            {
                if (_fromRow < address._fromRow)
                {

                }
                else
                {
                }
            }
            return null;
        }