예제 #1
0
        public List <Budget_Programs> SelectAll()
        {
            List <Budget_Programs> ProgramList = null;

            try
            {
                string sSQL = "SELECT * FROM Programs";

                DataSet ds = SqlHelper.ExecuteDataset(ConnectionString, CommandType.Text, sSQL);
                if (ds.Tables[0].Rows.Count > 0)
                {
                    ProgramList = new List <Budget_Programs>();
                    Budget_Programs program = null;
                    for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                    {
                        program                 = new Budget_Programs();
                        program.ProgramOID      = new Guid(ds.Tables[0].Rows[i]["ProgramOID"].ToString());
                        program.Enable          = Convert.ToBoolean(ds.Tables[0].Rows[i]["Enable"].ToString());
                        program.Seq             = Convert.ToInt32(ds.Tables[0].Rows[i]["Seq"].ToString());
                        program.FileName        = ds.Tables[0].Rows[i]["FileName"].ToString();
                        program.BannerFileName  = ds.Tables[0].Rows[i]["BannerFileName"].ToString();
                        program.Title           = ds.Tables[0].Rows[i]["Title"].ToString();
                        program.ShortDes        = ds.Tables[0].Rows[i]["ShortDes"].ToString();
                        program.Descriptions    = ds.Tables[0].Rows[i]["Descriptions"].ToString();
                        program.imageFileName1  = ds.Tables[0].Rows[i]["imageFileName1"].ToString();
                        program.imageFileName2  = ds.Tables[0].Rows[i]["imageFileName2"].ToString();
                        program.imageFileName3  = ds.Tables[0].Rows[i]["imageFileName3"].ToString();
                        program.imageFileName4  = ds.Tables[0].Rows[i]["imageFileName4"].ToString();
                        program.imageFileName5  = ds.Tables[0].Rows[i]["imageFileName5"].ToString();
                        program.imageFileName6  = ds.Tables[0].Rows[i]["imageFileName6"].ToString();
                        program.imageFileName7  = ds.Tables[0].Rows[i]["imageFileName7"].ToString();
                        program.imageFileName8  = ds.Tables[0].Rows[i]["imageFileName8"].ToString();
                        program.imageFileName9  = ds.Tables[0].Rows[i]["imageFileName9"].ToString();
                        program.imageFileName10 = ds.Tables[0].Rows[i]["imageFileName10"].ToString();
                        program.imageFileName11 = ds.Tables[0].Rows[i]["imageFileName11"].ToString();
                        program.imageFileName12 = ds.Tables[0].Rows[i]["imageFileName12"].ToString();
                        program.imageFileName13 = ds.Tables[0].Rows[i]["imageFileName13"].ToString();
                        program.imageFileName14 = ds.Tables[0].Rows[i]["imageFileName14"].ToString();
                        program.imageFileName15 = ds.Tables[0].Rows[i]["imageFileName15"].ToString();
                        ProgramList.Add(program);
                    }
                }
            }
            catch (Exception ex) { }
            return(ProgramList);
        }
예제 #2
0
        public Budget_Programs SelectByOID(Guid guidProgramOID)
        {
            Budget_Programs program = null;

            try
            {
                string         sSQL     = "SELECT * FROM Programs WHERE ProgramOID=@ProgramOID";
                SqlParameter[] sqlParam = new SqlParameter[1];
                sqlParam[0]       = new SqlParameter("@ProgramOID", SqlDbType.UniqueIdentifier);
                sqlParam[0].Value = guidProgramOID;
                DataSet ds = SqlHelper.ExecuteDataset(ConnectionString, CommandType.Text, sSQL, sqlParam);
                if (ds.Tables[0].Rows.Count > 0)
                {
                    program                 = new Budget_Programs();
                    program.ProgramOID      = new Guid(ds.Tables[0].Rows[0]["ProgramOID"].ToString());
                    program.Enable          = Convert.ToBoolean(ds.Tables[0].Rows[0]["Enable"].ToString());
                    program.Seq             = Convert.ToInt32(ds.Tables[0].Rows[0]["Seq"].ToString());
                    program.FileName        = ds.Tables[0].Rows[0]["FileName"].ToString();
                    program.BannerFileName  = ds.Tables[0].Rows[0]["BannerFileName"].ToString();
                    program.Title           = ds.Tables[0].Rows[0]["Title"].ToString();
                    program.ShortDes        = ds.Tables[0].Rows[0]["ShortDes"].ToString();
                    program.Descriptions    = ds.Tables[0].Rows[0]["Descriptions"].ToString();
                    program.imageFileName1  = ds.Tables[0].Rows[0]["imageFileName1"].ToString();
                    program.imageFileName2  = ds.Tables[0].Rows[0]["imageFileName2"].ToString();
                    program.imageFileName3  = ds.Tables[0].Rows[0]["imageFileName3"].ToString();
                    program.imageFileName4  = ds.Tables[0].Rows[0]["imageFileName4"].ToString();
                    program.imageFileName5  = ds.Tables[0].Rows[0]["imageFileName5"].ToString();
                    program.imageFileName6  = ds.Tables[0].Rows[0]["imageFileName6"].ToString();
                    program.imageFileName7  = ds.Tables[0].Rows[0]["imageFileName7"].ToString();
                    program.imageFileName8  = ds.Tables[0].Rows[0]["imageFileName8"].ToString();
                    program.imageFileName9  = ds.Tables[0].Rows[0]["imageFileName9"].ToString();
                    program.imageFileName10 = ds.Tables[0].Rows[0]["imageFileName10"].ToString();
                    program.imageFileName11 = ds.Tables[0].Rows[0]["imageFileName11"].ToString();
                    program.imageFileName12 = ds.Tables[0].Rows[0]["imageFileName12"].ToString();
                    program.imageFileName13 = ds.Tables[0].Rows[0]["imageFileName13"].ToString();
                    program.imageFileName14 = ds.Tables[0].Rows[0]["imageFileName14"].ToString();
                    program.imageFileName15 = ds.Tables[0].Rows[0]["imageFileName15"].ToString();
                }
            }
            catch (Exception ex) { }
            return(program);
        }