예제 #1
0
        public Boolean insertMenuGroup(menugroup mg)
        {
            Boolean status   = true;
            string  utString = "";

            try
            {
                string updateSQL = "insert into MenuGroup " +
                                   "(MenuGroup,Status)" +
                                   " values (" +
                                   "'" + mg.MenuGroup + "'," +
                                   "'" + mg.status + "')";
                utString = utString + updateSQL + Main.QueryDelimiter;
                utString = utString +
                           ActivityLogDB.PrepareActivityLogQquerString("insert", "MenuGroup", "", updateSQL) +
                           Main.QueryDelimiter;
                if (!UpdateTable.UT(utString))
                {
                    status = false;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(this.ToString() + "-" + System.Reflection.MethodBase.GetCurrentMethod().Name + "() : Error");
                status = false;
            }
            return(status);
        }
예제 #2
0
        public List <menugroup> getMenuGroup()
        {
            menugroup        br;
            List <menugroup> MenuGroup = new List <menugroup>();

            try
            {
                SqlConnection conn  = new SqlConnection(Login.connString);
                string        query = "select rowid,MenuGroup,status from MenuGroup ";
                SqlCommand    cmd   = new SqlCommand(query, conn);
                conn.Open();
                SqlDataReader reader = cmd.ExecuteReader();
                while (reader.Read())
                {
                    br           = new menugroup();
                    br.rowid     = reader.GetInt32(0);
                    br.MenuGroup = reader.GetString(1);
                    br.status    = reader.GetInt32(2);
                    MenuGroup.Add(br);
                }
                conn.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(this.ToString() + "-" + System.Reflection.MethodBase.GetCurrentMethod().Name + "() : Error");
            }
            return(MenuGroup);
        }
예제 #3
0
        public Boolean updateMenuGroup(menugroup mg)
        {
            Boolean status   = true;
            string  utString = "";
            string  date     = "";

            try
            {
                string updateSQL = "update MenuGroup set MenuGroup='" + mg.MenuGroup + "', " +
                                   " Status='" + mg.status + "' where " +
                                   " RowID='" + mg.rowid + "'";
                utString = utString + updateSQL + Main.QueryDelimiter;
                utString = utString +
                           ActivityLogDB.PrepareActivityLogQquerString("update", "MenuGroup", "", updateSQL) +
                           Main.QueryDelimiter;
                if (!UpdateTable.UT(utString))
                {
                    status = false;
                }
            }
            catch (Exception)
            {
                MessageBox.Show(this.ToString() + "-" + System.Reflection.MethodBase.GetCurrentMethod().Name + "() : Error");
                status = false;
            }
            return(status);
        }
예제 #4
0
        public Boolean validateMenuGroup(menugroup mg)
        {
            Boolean status = true;

            try
            {
                if (mg.MenuGroup.Trim().Length == 0 || mg.MenuGroup == null)
                {
                    return(false);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(this.ToString() + "-" + System.Reflection.MethodBase.GetCurrentMethod().Name + "() : Error");
                return(false);
            }
            return(status);
        }