Exemplo n.º 1
0
        public static GovernmentOfficial GetDetailsByContactNumber(string ContactNumber)
        {
            GovernmentOfficial info = null;

            info = BaseDataAccess.GetRecords <GovernmentOfficial>(string.Format("select * from GovernmentOfficials where ContactNumber='{0}'", ContactNumber));

            return(info);
        }
Exemplo n.º 2
0
        public static GovernmentOfficial GetDetails(string officialCode)
        {
            GovernmentOfficial info = null;

            info = BaseDataAccess.GetRecords <GovernmentOfficial>(string.Format("select * from GovernmentOfficials where OfficialCode='{0}'", officialCode));
            if (info != null)
            {
                info.DepartmentDesignation = DepartmentDesignationDA.GetDetails(info.DesignationId);
            }
            return(info);
        }
        /// <summary>
        /// THis function is to be edited. Once the Logic is done.
        /// </summary>
        /// <param name="username"></param>
        /// <returns></returns>
        public static List <Department> GetAllByUseraname(string username)
        {
            List <Department> listDepartment = new List <Department>();

            GovernmentOfficial info = null;

            info = GovernmentOfficialDA.GetDetailsByContactNumber(username);

            List <DepartmentXOfficial> listoff = new List <DepartmentXOfficial>();

            if (info != null)
            {
                listoff = DepartmentXOfficialsDA.GetAllForOfficial(info.Id);
            }

            foreach (DepartmentXOfficial i in listoff)
            {
                Department dept = null;
                dept = GetDetails(i.DepartmentId);

                listDepartment.Add(dept);
            }
            return(listDepartment);
        }
 /// <summary>
 /// This Function is used to Delete previously added GovernmentOfficials from database and is performed by SuperAdmin Only.
 /// </summary>
 public static bool Delete(GovernmentOfficial info)
 {
     return(GovernmentOfficialDA.Delete(info));
 }
 /// <summary>
 /// This Function is used to Update previously added GovernmentOfficials in database and is performed by SuperAdmin Only.
 /// </summary>
 public static bool Update(GovernmentOfficial info)
 {
     return(GovernmentOfficialDA.Update(info));
 }
 /// <summary>
 /// This Function is used to add new GovernmentOfficials to database and is performed by SuperAdmin Only.
 /// </summary>
 public static bool Add(GovernmentOfficial info)
 {
     return(GovernmentOfficialDA.Add(info));
 }
Exemplo n.º 7
0
 public static bool Delete(GovernmentOfficial info)
 {
     return(BaseDataAccess.ExecuteSQL(String.Format("delete from GovernmentOfficials where Id='{0}'", info.Id)));
 }
Exemplo n.º 8
0
 public static bool Update(GovernmentOfficial info)
 {
     return(BaseDataAccess.ExecuteSQL(String.Format("update GovernmentOfficials set Name='{0}', ContactNumber='{1}', ContactEmail='{2}', Picture='{3}', DesignationId='{4}', OfficialCode='{5}' where Id='{6}'", info.Name, info.ContactNumber, info.ContactEmail, info.Picture, info.DesignationId, info.OfficialCode, info.Id)));
 }
Exemplo n.º 9
0
 public static bool Add(GovernmentOfficial info)
 {
     return(BaseDataAccess.ExecuteSQL(String.Format("insert into GovernmentOfficials(Name, ContactNumber, ContactEmail, Picture, DesignationId, OfficialCode) values('{0}', '{1}', '{2}', '{3}', '{4}', '{5}') ", info.Name, info.ContactNumber, info.ContactEmail, info.Picture, info.DesignationId, info.OfficialCode)));
 }