/// <summary> /// Swaps the receiving units. /// </summary> /// <param name="receivingUnitID">The receiving unit ID.</param> /// <param name="receivingUnitIDTarget">The receiving unit ID target.</param> public static void SwapReceivingUnits(int receivingUnitID, int receivingUnitIDTarget) { BLL.Institution ru = new Institution(); var query = HCMIS.Repository.Queries.Institution.UpdateSwapReceivingUnitsOrder(receivingUnitID, receivingUnitIDTarget); ru.LoadFromRawSql(query); ru.FlushData(); query = HCMIS.Repository.Queries.Institution.UpdateSwapReceivingUnitsIssueDoc(receivingUnitID, receivingUnitIDTarget); ru.LoadFromRawSql(query); }
/// <summary> /// Gets the top receiving units. /// </summary> /// <returns></returns> public static DataTable GetTopReceivingUnits() { var query = HCMIS.Repository.Queries.Institution.SelectGetTopReceivingUnits(); Institution institution = new Institution(); institution.LoadFromRawSql(query); return(institution.DataTable); }
/// <summary> /// Gets all receiving units. /// </summary> /// <returns></returns> public static Institution GetAllReceivingUnits() { Institution rec = new Institution(); var query = HCMIS.Repository.Queries.Institution.SelectLoadAll(); rec.LoadFromRawSql(query); return(rec); }
/// <summary> /// Gets receiving units for IssuDetail by Account report. /// </summary> /// public static DataTable GetDistinctInstitutionForIssueDetail() { var query = HCMIS.Repository.Queries.Institution.SelectGetDistinctInstitutionForIssueDetail(); Institution institution = new Institution(); institution.LoadFromRawSql(query); return(institution.DataTable); }
/// <summary> /// Gets the resupply per unit. /// </summary> /// <param name="recievingUnitID">The recieving unit ID.</param> /// <returns></returns> public static DataTable GetResupplyPerUnit(int recievingUnitID) { var query = HCMIS.Repository.Queries.Institution.SelectGetResupplyPerUnit(recievingUnitID); Institution institution = new Institution(); institution.LoadFromRawSql(query); return(institution.DataTable); }
/// <returns></returns> /// /// <summary> /// Gets the receiving units by type ID. /// </summary> /// <param name="TypeID">The type ID.</param> /// <returns></returns> public static Institution GetReceivingUnitsByTypeID(int TypeID) { Institution rec = new Institution(); var query = HCMIS.Repository.Queries.Institution.SelectGetReceivingUnitsByTypeID(TypeID); rec.LoadFromRawSql(query); return(rec); }
public static Institution LoadReceivingUnitByFilter(int woredaID) { var query = HCMIS.Repository.Queries.Institution.SelectLoadReceivingUnitByFilter(woredaID); var inst = new Institution(); inst.LoadFromRawSql(query); return(inst); }
/// <summary> /// Loads the receiving unit by filter. /// </summary> /// <param name="woredaID">The woreda ID.</param> /// <param name="zoneID">The zone ID.</param> /// <param name="ruType">Type of the ru.</param> /// <param name="ownershipType">Type of the ownership.</param> /// <param name="activeStatus">The active status.</param> /// <param name="inProcess">The in process.</param> /// <param name="hasBeenIssuedTo">if set to <c>true</c> [has been issued to].</param> /// <returns></returns> public static Institution LoadReceivingUnitByFilter(int woredaID, int zoneID, int ruType, int ownershipType, int activeStatus, Boolean inProcess, bool hasBeenIssuedTo) { var filterQuery = HCMIS.Repository.Queries.Institution.SelectLoadReceivingUnitByFilter(woredaID, zoneID, ruType, ownershipType, activeStatus, hasBeenIssuedTo, inProcess); var ru = new Institution(); ru.LoadFromRawSql(filterQuery); return(ru); }
/// <summary> /// Gets the other ID. /// </summary> /// <returns></returns> public static int getOtherID() { var filterQuery = HCMIS.Repository.Queries.Institution.SelectgetOtherID(); BLL.Institution ru = new Institution(); ru.LoadFromRawSql(filterQuery); return(ru.ID); }
/// <summary> /// Loads the receiving unit by filter. /// </summary> /// <param name="name">The name.</param> /// <returns></returns> public static Institution LoadReceivingUnitByFilter(string name) { var query = HCMIS.Repository.Queries.Institution.SelectLoadReceivingUnitByFilter(name); BLL.Institution ru = new Institution(); ru.LoadFromRawSql(query); return(ru); }
public static DataTable GetItemFacilityDistribution(int ModeID, DateTime StartDate, DateTime EndDate, int RegionID = -1, int ZoneID = -1, int WoredaID = -1) { string query = HCMIS.Repository.Queries.Institution.SelectGetItemFacilityDistribution(ModeID, StartDate.ToShortDateString(), EndDate.ToShortDateString(), RegionID, ZoneID, WoredaID); Institution inst = new Institution(); inst.LoadFromRawSql(query); return(inst.DefaultView.Table); }
/// <summary> /// Loads the hubs. /// </summary> /// <returns></returns> public static DataView LoadHubs() { // remember Hub is RUType 8 var filterQuery = HCMIS.Repository.Queries.Institution.SelectLoadHubs(InstitutionType.Constants.HUB); BLL.Institution ru = new Institution(); ru.LoadFromRawSql(filterQuery); return(ru.DefaultView); }
public static bool ValidateNewAddition(string facilityName, int woredaID) { BLL.Institution institution = new Institution(); var query = HCMIS.Repository.Queries.Institution.SelectValidateNewAddition(facilityName, woredaID); institution.LoadFromRawSql(query); if (institution.RowCount > 0) //If it already exists, then it's not valid. { return(false); } else { return(true); } }
/// <summary> /// Gets the receiving units by zone. /// </summary> /// <param name="zoneID">The zone ID.</param> /// <returns></returns> public static Institution GetReceivingUnitsByZone(int zoneID) { Institution rec = new Institution(); var query = HCMIS.Repository.Queries.Institution.SelectGetReceivingUnitsByZone(zoneID); rec.LoadFromRawSql(query); return rec; }
public static DataTable GetItemFacilityDistribution(int ModeID, DateTime StartDate, DateTime EndDate, int RegionID = -1, int ZoneID = -1, int WoredaID = -1) { string query = HCMIS.Repository.Queries.Institution.SelectGetItemFacilityDistribution(ModeID, StartDate.ToShortDateString(), EndDate.ToShortDateString(), RegionID, ZoneID, WoredaID); Institution inst = new Institution(); inst.LoadFromRawSql(query); return inst.DefaultView.Table; }
/// <summary> /// Gets the top receiving units. /// </summary> /// <returns></returns> public static DataTable GetTopReceivingUnits() { var query = HCMIS.Repository.Queries.Institution.SelectGetTopReceivingUnits(); Institution institution = new Institution(); institution.LoadFromRawSql(query); return institution.DataTable; }
public static bool ValidateNewAddition(string facilityName, int woredaID) { BLL.Institution institution = new Institution(); var query = HCMIS.Repository.Queries.Institution.SelectValidateNewAddition(facilityName, woredaID); institution.LoadFromRawSql(query); if(institution.RowCount>0) //If it already exists, then it's not valid. { return false; } else { return true; } }
/// <summary> /// Swaps the receiving units. /// </summary> /// <param name="receivingUnitID">The receiving unit ID.</param> /// <param name="receivingUnitIDTarget">The receiving unit ID target.</param> public static void SwapReceivingUnits(int receivingUnitID, int receivingUnitIDTarget) { BLL.Institution ru = new Institution(); var query = HCMIS.Repository.Queries.Institution.UpdateSwapReceivingUnitsOrder(receivingUnitID, receivingUnitIDTarget); ru.LoadFromRawSql(query); ru.FlushData(); query = HCMIS.Repository.Queries.Institution.UpdateSwapReceivingUnitsIssueDoc(receivingUnitID, receivingUnitIDTarget); ru.LoadFromRawSql(query); }
public static Institution LoadReceivingUnitByFilter(int woredaID) { var query = HCMIS.Repository.Queries.Institution.SelectLoadReceivingUnitByFilter(woredaID); var inst = new Institution(); inst.LoadFromRawSql(query); return inst; }
/// <summary> /// Loads the receiving unit by filter. /// </summary> /// <param name="name">The name.</param> /// <returns></returns> public static Institution LoadReceivingUnitByFilter(string name) { var query = HCMIS.Repository.Queries.Institution.SelectLoadReceivingUnitByFilter(name); BLL.Institution ru = new Institution(); ru.LoadFromRawSql(query); return ru; }
/// <summary> /// Loads the receiving unit by filter. /// </summary> /// <param name="woredaID">The woreda ID.</param> /// <param name="zoneID">The zone ID.</param> /// <param name="ruType">Type of the ru.</param> /// <param name="ownershipType">Type of the ownership.</param> /// <param name="activeStatus">The active status.</param> /// <param name="inProcess">The in process.</param> /// <param name="storeID">The store ID.</param> /// <param name="hasBeenIssuedTo">if set to <c>true</c> [has been issued to].</param> /// <returns></returns> public static Institution LoadReceivingUnitByFilter(int woredaID, int zoneID, int ruType, int ownershipType, int activeStatus, Boolean inProcess,int storeID,bool hasBeenIssuedTo) { var query = HCMIS.Repository.Queries.Institution.SelectLoadReceivingUnitByFilterByName(woredaID, zoneID, ruType, ownershipType, activeStatus, hasBeenIssuedTo, inProcess, storeID); BLL.Institution ru = new Institution(); ru.LoadFromRawSql(query); return ru; }
/// <summary> /// Loads the hubs. /// </summary> /// <returns></returns> public static DataView LoadHubs() { // remember Hub is RUType 8 var filterQuery = HCMIS.Repository.Queries.Institution.SelectLoadHubs(InstitutionType.Constants.HUB); BLL.Institution ru = new Institution(); ru.LoadFromRawSql(filterQuery); return ru.DefaultView; }
/// <summary> /// Gets receiving units for IssuDetail by Account report. /// </summary> /// public static DataTable GetDistinctInstitutionForIssueDetail() { var query = HCMIS.Repository.Queries.Institution.SelectGetDistinctInstitutionForIssueDetail(); Institution institution = new Institution(); institution.LoadFromRawSql(query); return institution.DataTable; }
/// <summary> /// Gets the resupply per unit. /// </summary> /// <param name="recievingUnitID">The recieving unit ID.</param> /// <returns></returns> public static DataTable GetResupplyPerUnit(int recievingUnitID) { var query = HCMIS.Repository.Queries.Institution.SelectGetResupplyPerUnit(recievingUnitID); Institution institution = new Institution(); institution.LoadFromRawSql(query); return institution.DataTable; }
/// <summary> /// Gets all receiving units. /// </summary> /// <returns></returns> public static Institution GetAllReceivingUnits() { Institution rec = new Institution(); var query = HCMIS.Repository.Queries.Institution.SelectLoadAll(); rec.LoadFromRawSql(query); return rec; }
/// <summary> /// Gets the other ID. /// </summary> /// <returns></returns> public static int getOtherID() { var filterQuery = HCMIS.Repository.Queries.Institution.SelectgetOtherID(); BLL.Institution ru = new Institution(); ru.LoadFromRawSql(filterQuery); return ru.ID; }