示例#1
0
        public List <System.Web.Mvc.SelectListItem> GetProjectName()
        {
            try
            {
                obj_con.clearParameter();

                DataTable dt = ConvertDatareadertoDataTable(obj_con.ExecuteReader("Sp_mstProject_GetProjectName", CommandType.StoredProcedure));
                obj_con.CommitTransaction();
                obj_con.closeConnection();
                List <System.Web.Mvc.SelectListItem> lst  = new List <System.Web.Mvc.SelectListItem>();
                System.Web.Mvc.SelectListItem        sli1 = new System.Web.Mvc.SelectListItem();
                sli1.Text  = "Select All";
                sli1.Value = "-1";
                lst.Add(sli1);
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    System.Web.Mvc.SelectListItem sli = new System.Web.Mvc.SelectListItem();
                    sli.Text  = Convert.ToString(dt.Rows[i][1]);
                    sli.Value = Convert.ToString(dt.Rows[i][0]);

                    lst.Add(sli);
                }
                return(lst);
            }
            catch (Exception ex)
            {
                throw new Exception("Sp_mstProject_GetProjectName");
            }
            finally
            {
                obj_con.closeConnection();
            }
        }
示例#2
0
 //select all data from database
 public List <LocationClass> getAll()
 {
     try
     {
         obj_con.clearParameter();
         DataTable dt = ConvertDatareadertoDataTable(obj_con.ExecuteReader("sp_Location_selectall", CommandType.StoredProcedure));
         obj_con.CommitTransaction();
         obj_con.closeConnection();
         return(ConvertToList(dt));
     }
     catch (Exception ex)
     {
         throw new Exception("sp_Location_selectall:" + ex.Message);
     }
 }
示例#3
0
 public Int32?GetMaxSequenceNumber()
 {
     try
     {
         DataTable dt = ConvertDatareadertoDataTable(obj_con.ExecuteReader("sp_WebsiteBanner_GetMaxNumber", CommandType.StoredProcedure));
         return(Convert.ToInt32(dt.Rows[0]["LastSequenceNumber"]));
     }
     catch (Exception ex)
     {
         obj_con.RollbackTransaction();
         throw new Exception("sp_WebsiteBanner_GetMaxNumber:" + ex.Message);
     }
 }
示例#4
0
//select all data from database
        public List <proposalchecklistflatroofClass> getAll()
        {
            try
            {
                obj_con.clearParameter();
                DataTable dt = ConvertDatareadertoDataTable(obj_con.ExecuteReader("sp_proposalchecklistflatroof_selectall", CommandType.StoredProcedure));
                obj_con.CommitTransaction();
                obj_con.closeConnection();
                return(ConvertToList(dt));
            }
            catch (Exception ex)
            {
                throw new Exception("sp_proposalchecklistflatroof_selectall");
            }
        }
示例#5
0
 //select all data from database
 public string getAll()
 {
     try
     {
         obj_con.clearParameter();
         DataTable dt = ConvertDatareadertoDataTable(obj_con.ExecuteReader("sp_Admin_selectall", CommandType.StoredProcedure));
         obj_con.CommitTransaction();
         obj_con.closeConnection();
         return(SessionUtilities.ConvertDataTableTojSonString(dt));
     }
     catch (Exception ex)
     {
         throw new Exception("sp_Admin_selectall:" + ex.Message);
     }
 }
//select all data from database
        public List <buildingdeficiencyrepairClass> getAll()
        {
            try
            {
                obj_con.clearParameter();
                DataTable dt = ConvertDatareadertoDataTable(obj_con.ExecuteReader("sp_buildingdeficiencyrepair_selectall", CommandType.StoredProcedure));
                obj_con.CommitTransaction();
                obj_con.closeConnection();
                return(ConvertToList(dt));
            }
            catch (Exception ex)
            {
                throw new Exception("sp_buildingdeficiencyrepair_selectall");
            }
        }
示例#7
0
        public SecurityClass Checkuserlogin(string UserName, string Password)
        {
            try
            {
                obj_con.clearParameter();
                obj_con.addParameter("@UserName", UserName);

                obj_con.addParameter("@Password", Password);
                DataTable dt = ConvertDataReaderToDataTable(obj_con.ExecuteReader("RE_Users_Login", CommandType.StoredProcedure));
                return(ConvertToOjbect(dt));
            }
            catch (Exception ex)
            {
                obj_con.RollbackTransaction();
                throw new Exception("RE_Users_Login : " + ex.Message);
            }
        }