Ejemplo n.º 1
0
        public static CustomList <HouseKeepingValue> GetAllHouseKeepingValue(Int32 EntityID)
        {
            ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
            CustomList <HouseKeepingValue> HouseKeepingValueCollection = new CustomList <HouseKeepingValue>();
            IDataReader reader = null;
            String      sql    = "select *from HouseKeepingValue Where EntityID=" + EntityID;

            try
            {
                conManager.OpenDataReader(sql, out reader);
                while (reader.Read())
                {
                    HouseKeepingValue newHouseKeepingValue = new HouseKeepingValue();
                    newHouseKeepingValue.SetData(reader);
                    HouseKeepingValueCollection.Add(newHouseKeepingValue);
                }
                return(HouseKeepingValueCollection);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                if (reader != null && !reader.IsClosed)
                {
                    reader.Close();
                }
            }
        }
Ejemplo n.º 2
0
        public static CustomList <HouseKeepingValue> GetCompany()
        {
            ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
            CustomList <HouseKeepingValue> HouseKeepingValueCollection = new CustomList <HouseKeepingValue>();
            IDataReader reader = null;
            String      sql    = "Exec GetCompany";

            try
            {
                conManager.OpenDataReader(sql, out reader);
                while (reader.Read())
                {
                    HouseKeepingValue newHouseKeepingValue = new HouseKeepingValue();
                    newHouseKeepingValue.HKID   = reader.GetInt32("HKID");
                    newHouseKeepingValue.HKName = reader.GetString("HKName");
                    HouseKeepingValueCollection.Add(newHouseKeepingValue);
                }
                return(HouseKeepingValueCollection);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                if (reader != null && !reader.IsClosed)
                {
                    reader.Close();
                }
            }
        }
Ejemplo n.º 3
0
        public static CustomList <HouseKeepingValue> GetAllSingleEntity(string spName)
        {
            ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
            CustomList <HouseKeepingValue> HouseKeepingValueCollection = new CustomList <HouseKeepingValue>();
            IDataReader reader = null;
            String      sql    = "EXEC " + spName;

            try
            {
                conManager.OpenDataReader(sql, out reader);
                while (reader.Read())
                {
                    HouseKeepingValue newHouseKeepingValue = new HouseKeepingValue();
                    newHouseKeepingValue.SetDataHeadType(reader);
                    HouseKeepingValueCollection.Add(newHouseKeepingValue);
                }
                return(HouseKeepingValueCollection);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                if (reader != null && !reader.IsClosed)
                {
                    reader.Close();
                }
            }
        }
Ejemplo n.º 4
0
        public static CustomList <HouseKeepingValue> GetAllHouseKeepingValueForDropdown(Int32 parentID)
        {
            ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
            CustomList <HouseKeepingValue> HouseKeepingValueCollection = new CustomList <HouseKeepingValue>();
            IDataReader reader = null;
            String      sql    = "EXEC spGetChangeEventHouseKeepingValue '" + parentID + "'";

            try
            {
                conManager.OpenDataReader(sql, out reader);
                while (reader.Read())
                {
                    HouseKeepingValue newHouseKeepingValue = new HouseKeepingValue();
                    newHouseKeepingValue.SetDataForDropdown(reader);
                    HouseKeepingValueCollection.Add(newHouseKeepingValue);
                }
                return(HouseKeepingValueCollection);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                if (reader != null && !reader.IsClosed)
                {
                    reader.Close();
                }
            }
        }
Ejemplo n.º 5
0
        public static CustomList <HouseKeepingValue> GetAllHouseKeepingValue(string search, string blank)
        {
            ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
            CustomList <HouseKeepingValue> HouseKeepingValueCollection = new CustomList <HouseKeepingValue>();

            IDataReader reader = null;
            String      sql    = search;

            try
            {
                conManager.OpenDataReader(sql, out reader);
                while (reader.Read())
                {
                    HouseKeepingValue newHouseKeepingValue = new HouseKeepingValue();
                    newHouseKeepingValue.SetData(reader);
                    HouseKeepingValueCollection.Add(newHouseKeepingValue);
                }
                HouseKeepingValueCollection.InsertSpName = "spInsertHouseKeepingValue";
                HouseKeepingValueCollection.UpdateSpName = "spUpdateHouseKeepingValue";
                HouseKeepingValueCollection.DeleteSpName = "spDeleteHouseKeepingValue";
                return(HouseKeepingValueCollection);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                if (reader != null && !reader.IsClosed)
                {
                    reader.Close();
                }
            }
        }
Ejemplo n.º 6
0
 public static CustomList<HouseKeepingValue> GetCompany()
 {
     ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
     CustomList<HouseKeepingValue> HouseKeepingValueCollection = new CustomList<HouseKeepingValue>();
     IDataReader reader = null;
     String sql = "Exec GetCompany";
     try
     {
         conManager.OpenDataReader(sql, out reader);
         while (reader.Read())
         {
             HouseKeepingValue newHouseKeepingValue = new HouseKeepingValue();
             newHouseKeepingValue.HKID = reader.GetInt32("HKID");
             newHouseKeepingValue.HKName = reader.GetString("HKName");
             HouseKeepingValueCollection.Add(newHouseKeepingValue);
         }
         return HouseKeepingValueCollection;
     }
     catch (Exception ex)
     {
         throw (ex);
     }
     finally
     {
         if (reader != null && !reader.IsClosed)
             reader.Close();
     }
 }
Ejemplo n.º 7
0
 public static CustomList<HouseKeepingValue> GetAllHouseKeepingValueForDropdown(Int32 parentID)
 {
     ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
     CustomList<HouseKeepingValue> HouseKeepingValueCollection = new CustomList<HouseKeepingValue>();
     IDataReader reader = null;
     String sql = "EXEC spGetChangeEventHouseKeepingValue '" + parentID + "'";
     try
     {
         conManager.OpenDataReader(sql, out reader);
         while (reader.Read())
         {
             HouseKeepingValue newHouseKeepingValue = new HouseKeepingValue();
             newHouseKeepingValue.SetDataForDropdown(reader);
             HouseKeepingValueCollection.Add(newHouseKeepingValue);
         }
         return HouseKeepingValueCollection;
     }
     catch (Exception ex)
     {
         throw (ex);
     }
     finally
     {
         if (reader != null && !reader.IsClosed)
             reader.Close();
     }
 }
Ejemplo n.º 8
0
 public static CustomList<HouseKeepingValue> GetAllSingleEntity(string spName)
 {
     ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
     CustomList<HouseKeepingValue> HouseKeepingValueCollection = new CustomList<HouseKeepingValue>();
     IDataReader reader = null;
     String sql = "EXEC " + spName;
     try
     {
         conManager.OpenDataReader(sql, out reader);
         while (reader.Read())
         {
             HouseKeepingValue newHouseKeepingValue = new HouseKeepingValue();
             newHouseKeepingValue.SetDataHeadType(reader);
             HouseKeepingValueCollection.Add(newHouseKeepingValue);
         }
         return HouseKeepingValueCollection;
     }
     catch (Exception ex)
     {
         throw (ex);
     }
     finally
     {
         if (reader != null && !reader.IsClosed)
             reader.Close();
     }
 }
Ejemplo n.º 9
0
 public static CustomList<HouseKeepingValue> GetAllHouseKeepingValue(Int32 EntityID)
 {
     ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
     CustomList<HouseKeepingValue> HouseKeepingValueCollection = new CustomList<HouseKeepingValue>();
     IDataReader reader = null;
     String sql = "select *from HouseKeepingValue Where EntityID=" + EntityID;
     try
     {
         conManager.OpenDataReader(sql, out reader);
         while (reader.Read())
         {
             HouseKeepingValue newHouseKeepingValue = new HouseKeepingValue();
             newHouseKeepingValue.SetData(reader);
             HouseKeepingValueCollection.Add(newHouseKeepingValue);
         }
         return HouseKeepingValueCollection;
     }
     catch (Exception ex)
     {
         throw (ex);
     }
     finally
     {
         if (reader != null && !reader.IsClosed)
             reader.Close();
     }
 }
Ejemplo n.º 10
0
        public static CustomList<HouseKeepingValue> GetAllHouseKeepingValue(string search, string blank)
        {
            ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
            CustomList<HouseKeepingValue> HouseKeepingValueCollection = new CustomList<HouseKeepingValue>();

            IDataReader reader = null;
            String sql = search;
            try
            {
                conManager.OpenDataReader(sql, out reader);
                while (reader.Read())
                {
                    HouseKeepingValue newHouseKeepingValue = new HouseKeepingValue();
                    newHouseKeepingValue.SetData(reader);
                    HouseKeepingValueCollection.Add(newHouseKeepingValue);
                }
                HouseKeepingValueCollection.InsertSpName = "spInsertHouseKeepingValue";
                HouseKeepingValueCollection.UpdateSpName = "spUpdateHouseKeepingValue";
                HouseKeepingValueCollection.DeleteSpName = "spDeleteHouseKeepingValue";
                return HouseKeepingValueCollection;
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                if (reader != null && !reader.IsClosed)
                    reader.Close();
            }
        }
Ejemplo n.º 11
0
 private void SetDataInControls(HouseKeepingValue hk)
 {
     try
     {
         txtHKName.Text = hk.HKName;
         txtShortName.Text = hk.ShortName;
         txtDescription.Text = hk.Description;
         txtAddress.Text = hk.Address;
     }
     catch (Exception ex)
     {
         throw (ex);
     }
 }
Ejemplo n.º 12
0
 private void PopulateHKInformation(HouseKeepingValue hK)
 {
     try
     {
         SetDataInControls(hK);
         ChildList = manager.GetAllHousekeepingHierarchy(hK.HKID);
         foreach (HouseKeepingValue hKV in ParentList)
         {
             if (ChildList.FindAll(f => f.ParentID == hKV.HKID).Count != 0)
             {
                 hKV.IsSaved = true;
             }
             else
             {
                 hKV.IsSaved = false;
             }
         }
     }
     catch (Exception ex)
     {
         throw (ex);
     }
 }
Ejemplo n.º 13
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            try
            {

                CustomList<HouseKeepingValue> lstHKEntry = HouseKeepingList;
                if (lstHKEntry.Count == 0)
                {
                    HouseKeepingValue newHouseKeepingEntry = new HouseKeepingValue();
                    lstHKEntry.Add(newHouseKeepingEntry);
                }
                CustomList<HouseKeepingValue> lstParent = ParentList;
                CustomList<HousekeepingHierarchy> lstChild = ChildList;
                CustomList<HousekeepingHierarchy> savedList = new CustomList<HousekeepingHierarchy>();
                foreach (HouseKeepingValue hKV in lstParent)
                {
                    if (hKV.IsSaved)
                    {
                        HousekeepingHierarchy childObj = ChildList.Find(f => f.ParentID == hKV.HKID);
                        if (childObj.IsNotNull())
                        {
                            savedList.Add(childObj);
                        }
                        else
                        {
                            HousekeepingHierarchy obj = new HousekeepingHierarchy();
                            obj.ParentID = hKV.HKID;
                            savedList.Add(obj);
                        }
                    }
                    else
                    {
                        HousekeepingHierarchy childObj = ChildList.Find(f => f.ParentID == hKV.HKID);
                        if (childObj.IsNotNull())
                        {
                            childObj.Delete();
                            savedList.Add(childObj);
                        }
                    }
                }

                SetDataFromControls(ref lstHKEntry);

                if (!CheckUserAuthentication(lstHKEntry)) return;
                manager.SaveHKEntry(ref lstHKEntry, ref savedList);
                this.SuccessMessage = (StaticInfo.SavedSuccessfullyMsg);
            }
            catch (SqlException ex)
            {
                this.ErrorMessage = (ExceptionHelper.getSqlExceptionMessage(ex));
            }
            catch (Exception ex)
            {
                this.ErrorMessage = (ExceptionHelper.getExceptionMessage(ex));
            }
        }