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; } }
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)); } }
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); } }
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); } }
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(); } } }
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); }
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; }