public static bool Update(DepartmentXAreaOnDuty info) { if (info.VillageId == 0) { return(BaseDataAccess.ExecuteSQL(String.Format("update DepartmentXAreaOnDuty set DepartmentId='{0}', StateId='{1}', CityId='{2}', VillageId='{3}',LocalityId='{4}', OnDutyPersonId='{5}',DutyTimeFrom='{6}',DutyTimeTo='{7}' where Id='{8}'", info.DepartmentId, info.StateId, info.CityId, info.VillageId, info.LocalityId, info.OnDutyPersonId, info.DutyTimeFrom.ToShortTimeString(), info.DutyTimeTo.ToShortTimeString(), info.Id))); } else { return(BaseDataAccess.ExecuteSQL(String.Format("update DepartmentXAreaOnDuty set DepartmentId='{0}', StateId='{1}', CityId='{2}', VillageId='{3}',LocalityId='{4}', OnDutyPersonId='{5}',DutyTimeFrom='{6}',DutyTimeTo='{7}' where Id='{8}'", info.DepartmentId, info.StateId, info.CityId, info.VillageId, info.LocalityId, info.OnDutyPersonId, info.DutyTimeFrom.ToShortTimeString(), info.DutyTimeTo.ToShortTimeString(), info.Id))); } }
public static bool Add(DepartmentXAreaOnDuty info) { if (info.VillageId == 0) { return(BaseDataAccess.ExecuteSQL(String.Format("insert into DepartmentXAreaOnDuty(DepartmentId, StateId, CityId,LocalityId, OnDutyPersonId, DutyTimeFrom, DutyTimeTo)values('{0}','{1}','{2}','{3}','{4}','{5}','{6}')", info.DepartmentId, info.StateId, info.CityId, info.LocalityId, info.OnDutyPersonId, info.DutyTimeFrom.ToShortTimeString(), info.DutyTimeTo.ToShortTimeString()))); } else { return(BaseDataAccess.ExecuteSQL(String.Format("insert into DepartmentXAreaOnDuty(DepartmentId, StateId, CityId,VillageId,LocalityId, OnDutyPersonId, DutyTimeFrom, DutyTimeTo)values('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}')", info.DepartmentId, info.StateId, info.CityId, info.VillageId, info.LocalityId, info.OnDutyPersonId, info.DutyTimeFrom.ToShortTimeString(), info.DutyTimeTo.ToShortTimeString()))); } }
public static DepartmentXAreaOnDuty GetByTime(int departmentId, DateTime timeOfDay) { DepartmentXAreaOnDuty info = null; info = BaseDataAccess.GetRecords <DepartmentXAreaOnDuty>(String.Format("select * from DepartmentXAreaOnDuty where DepartmentId='{0}'", departmentId)); if (info != null) { info.State = StateDA.GetDetails(info.StateId); info.City = CityDA.GetDetails(info.CityId); if (info.VillageId != 0) { info.Village = VillageDA.GetDetails(info.VillageId); } info.Locality = LocalityDA.GetDetails(info.LocalityId); info.Department = DepartmentDA.GetDetails(info.DepartmentId); info.GovermentOfficial = GovernmentOfficialDA.GetDetails(info.OnDutyPersonId); } return(info); }
public static bool Delete(DepartmentXAreaOnDuty info) { return(BaseDataAccess.ExecuteSQL(String.Format("delete from DepartmentXAreaOnDuty where Id='{0}'", info.Id))); }
/// <summary> /// This Function is used to Delete previously added DepartmentXAreaOnDuty from database and is performed by SuperAdmin Only. /// </summary> public static bool Delete(DepartmentXAreaOnDuty info) { return(DepartmentXAreaOnDutyDA.Delete(info)); }
/// <summary> /// This Function is used to Update previously added DepartmentXAreaOnDuty in database and is performed by SuperAdmin Only. /// </summary> public static bool Update(DepartmentXAreaOnDuty info) { return(DepartmentXAreaOnDutyDA.Update(info)); }
/// <summary> /// This Function is used to add new DepartmentXAreaOnDuty to database and is performed by SuperAdmin Only. /// </summary> public static bool Add(DepartmentXAreaOnDuty info) { return(DepartmentXAreaOnDutyDA.Add(info)); }